-
Notifications
You must be signed in to change notification settings - Fork 450
[Fix][CuteDSL] add support for tanh/tanhf (fixes #1595) #1597
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
Conversation
|
👋 Hi! Thank you for contributing to the TileLang project. Please remember to run We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀 |
📝 WalkthroughWalkthroughAdds tanh/tanhf fastmath canonicalization to CuTeDSL codegen and a fastmath-backed tanh user-op in the CuTeDSL math DSL, enabling selection of an inline-assembly fastmath tanh path. Changes
Sequence Diagram(s)(omitted — changes are localized and do not introduce multi-component sequential flows) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tilelang/contrib/cutedsl/math.py
🧰 Additional context used
🪛 Ruff (0.14.10)
tilelang/contrib/cutedsl/math.py
5-5: Unused noqa directive (non-enabled: F401)
Remove unused noqa directive
(RUF100)
15-15: Unused function argument: fastmath
(ARG001)
🔇 Additional comments (2)
tilelang/contrib/cutedsl/math.py (2)
4-4: LGTM! Imports are appropriate.All added imports are utilized in the new tanh implementation.
Also applies to: 7-9
30-32: LGTM! The fastmath delegation logic is correct.The function correctly delegates to
__tanhffor fast approximation whenfastmath=True, or tomath.tanhfor standard precision whenfastmath=False. PassingFalseas the second parameter to_math_opis appropriate since the operation choice already encodes the fast/slow decision.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.