-
Notifications
You must be signed in to change notification settings - Fork 635
[Cache] Introduce detailed target information for the disk kernel cache #780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
287bf3a
5f44aef
b2e85c0
aeff94d
200e366
0b4dc07
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,6 +20,7 @@ | |||||||||||||||||
| from tvm.target import Target | ||||||||||||||||||
|
|
||||||||||||||||||
| from tilelang.jit.kernel import JITKernel | ||||||||||||||||||
| from tilelang.utils.target import determine_target | ||||||||||||||||||
| from tilelang.cache import cached | ||||||||||||||||||
| from os import path, makedirs | ||||||||||||||||||
| from logging import getLogger | ||||||||||||||||||
|
|
@@ -34,7 +35,7 @@ def compile( | |||||||||||||||||
| out_idx: Union[List[int], int, None] = None, | ||||||||||||||||||
| execution_backend: Literal["dlpack", "ctypes", "cython", "nvrtc"] = "cython", | ||||||||||||||||||
| target: Union[str, Target] = "auto", | ||||||||||||||||||
| target_host: Union[str, Target] = None, | ||||||||||||||||||
| target_host: Union[str, Target, None] = None, | ||||||||||||||||||
| verbose: bool = False, | ||||||||||||||||||
| pass_configs: Optional[Dict[str, Any]] = None, | ||||||||||||||||||
| compile_flags: Optional[Union[List[str], str]] = None, | ||||||||||||||||||
|
|
@@ -69,6 +70,10 @@ def compile( | |||||||||||||||||
| assert isinstance(func, PrimFunc), f"target function must be a PrimFunc but got {type(func)}" | ||||||||||||||||||
| if isinstance(compile_flags, str): | ||||||||||||||||||
| compile_flags = [compile_flags] | ||||||||||||||||||
|
|
||||||||||||||||||
| # This path is not a performance critical path, so we can afford to convert the target. | ||||||||||||||||||
| target = Target(determine_target(target)) | ||||||||||||||||||
|
|
||||||||||||||||||
|
Comment on lines
+72
to
+76
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do not convert the 'auto' sentinel into a TVM Target; this will fail.
Apply: - # This path is not a performance critical path, so we can afford to convert the target.
- target, target_host = Target(target), Target(target_host) if target_host else None
+ # Normalize targets for caching while preserving the 'auto' sentinel.
+ if not isinstance(target, Target) and not (isinstance(target, str) and target == "auto"):
+ target = Target(target)
+ if target_host is not None and not isinstance(target_host, Target):
+ target_host = Target(target_host)Optionally, to centralize validation/coercion, consider using 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| return cached( | ||||||||||||||||||
| func=func, | ||||||||||||||||||
| out_idx=out_idx, | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Restore stream format flags after hex/scientific emission
std::hexfloat and std::scientific persist on the stream and can leak into later emissions. Also add a separating space before the comment for readability.
Repeat the same change in the float8/float4 branch.
Also applies to: 1967-1969
🏁 Script executed:
Length of output: 1897
Restore default float formatting after hex/scientific and add space before comment
std::hexfloat and std::scientific persist on the stream and will affect later emissions—append std::defaultfloat to reset formatting and insert a space before the comment. Apply in both the bfloat16 (≈1959–1961) and float8/float4 (≈1967–1969) branches:
🤖 Prompt for AI Agents