-
Notifications
You must be signed in to change notification settings - Fork 359
[LazyJIT] Move Type Annotations to Function Body #1480
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
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
|
This PR:
|
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
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.
Actionable comments posted: 1
♻️ Duplicate comments (1)
tilelang/jit/__init__.py (1)
409-416: Non-lazy path logic is correct, pending fix for__tune_paramsbug.The non-lazy path correctly returns the kernel object itself (line 416) rather than executing it, which aligns with the
jitdecorator's return typeJITKernel[_KP, _T]. However, this code is affected by the critical__tune_paramsdouble-pop bug identified in lines 376-381.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
tilelang/cache/kernel_cache.pytilelang/jit/__init__.py
🚧 Files skipped from review as they are similar to previous changes (1)
- tilelang/cache/kernel_cache.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Test for Python 3.12 with Metal (on macos-latest)
🔇 Additional comments (6)
tilelang/jit/__init__.py (6)
275-275: LGTM!Type annotation correctly includes
LazyJITFunc[_KP, _T]to support lazy JIT compilation paths.
291-292: LGTM!Correctly delegates to
LazyJITFunc.get_tirfor lazy JIT functions. Consistent with the two-phase elaboration pattern described in PR objectives.
496-514: LGTM!The
jitdecorator correctly checks forPrimFuncinstances and constructsJITImplwithlazy_jit=False. Removal ofPrimFuncCreaterhandling aligns with PR objectives.
569-573: LGTM!The
lazy_jitdecorator correctly creates aLazyJITFuncviaprim_func(func, lazy_jit=True)and wraps it inJITImplwithlazy_jit=True, enabling the lazy compilation flow.
27-27: No issues found. LazyJITFunc is properly exported from tilelang.language.v2 and implements the expected methods (get_tir and parse_args).
400-407: No changes needed. Thekernel_argsreturned byLazyJITFunc.parse_argsis a dict (tensor_argsin the implementation) initialized as{}and populated with tensor arguments. Callingkernel(*kernel_args.values())is correct.Likely an incorrect or invalid review comment.
|
@codex review |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
in your comments, A, B, C is annotated with |
|
Updated, user doesn't need to annotate |
|
Overall LGTM, but just for |
We already have a ptr based test and it can pass. |
|
@codex review |
In the previous version of LazyJIT, some constant/symblic are written outside of the function. This makes the global namespace crowded and name conflict.
In this revision, we move the type annotation inside function, which is simpler and clear:
TODO
T.emptyand return valuesT.ptrannotation completelySummary by CodeRabbit
New Features
Refactor
Documentation
Tests
✏️ Tip: You can customize this high-level summary in your review settings.