[inductor][cutlass] Add neg() and constant() EVT ops for SiLU epilogue fusion#186197
Open
xuhancn wants to merge 1 commit into
Open
[inductor][cutlass] Add neg() and constant() EVT ops for SiLU epilogue fusion#186197xuhancn wants to merge 1 commit into
xuhancn wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/186197
Note: Links to docs will display an error until the docs builds have been completed. ❌ 15 Pending, 1 Unrelated Failure, 6 Unclassified FailuresAs of commit 6622b21 with merge base cc46af7 ( UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Jun 4, 2026
b60a572 to
6622b21
Compare
…e fusion Add two missing EVT ops needed by decomposed SiLU (x / (1 + exp(-x))): - neg(x): Emits (0.0 - x) since CUTLASS PythonASTFrontend lacks visit_UnaryOp - constant(value, dtype): Returns str(float(value)) for CUTLASS literal parsing Without these ops, any epilogue containing neg or constant raises NotImplementedError, preventing SiLU (and sigmoid) from being fused into CUTLASS GEMM epilogues. Tests: - test_py_codegen_neg_constant: validates neg + constant + exp composition - test_py_codegen_sigmoid_decomposed: validates full sigmoid decomposition 1/(1+exp(-x)) Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement the
neg()andconstant()operations inCutlassEVTOpsMixInthat were previously raisingNotImplementedError.Changes
constant(value, dtype): Returnsstr(float(value))— consistent with CUTLASSPythonASTFrontendliteral parsing (e.g.,1→"1.0")neg(x): Emits(0.0 - x)instead of unary minus because CUTLASSPythonASTFrontendhasvisit_BinOpbut novisit_UnaryOpMotivation
These ops are required for decomposed SiLU to be representable in the CUTLASS EVT Python DSL:
x / (1 + exp(-x))neg()(for-x) andconstant(1)(for the literal1)Without these ops,
_can_fuse_epilogue_impl()rejects any epilogue containing SiLU, preventing GEMM + SiLU fusion.Testing
test_py_codegen_neg_constant: Validates EVT code generation forconstant(1) + exp(neg(x))test_py_codegen_sigmoid_decomposed: Validates full sigmoid decomposition1/(1+exp(-x))with composed neg/constant/exp/add/truedivcc @eellison @etaf