Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/195231
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 0323127 with merge base 96043a9 ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Aug 28, 2026
mlazos
marked this pull request as ready for review
August 28, 2026 23:53
drisspg
approved these changes
Aug 29, 2026
Contributor
Author
AI-Review
Verified Issues
|
Contributor
Author
|
@pytorchbot merge |
Collaborator
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Collaborator
Merge failedReason: New commits were pushed while merging. Please rerun the merge command. Details for Dev Infra teamRaised by workflow job |
This was referenced Sep 1, 2026
Collaborator
|
Starting merge as part of PR stack under #194873 |
1 similar comment
Collaborator
|
Starting merge as part of PR stack under #194873 |
pytorchmergebot
pushed a commit
that referenced
this pull request
Sep 1, 2026
<human note needed> > Introduce the semantic lowering and CuTeDSL emission layer for scheduler-owned > GEMM epilogues. A candidate sequence of scheduler nodes is captured as Loop IR, > classified from iteration ranges and access strides, and represented as one > `NVGemmEpilogueProgram` containing pointwise work, grouped reduction regions, > output ownership, and any callbacks required by the kernel. > > ## Architecture > > `NVGemmEpilogueCapture` interprets the candidate nodes without selecting a > named reduction algorithm. `reduction_type` identifies only the associative > primitive; the captured expressions define source transforms, finalizers, > consumers, and compositions of multiple reductions with pointwise operations. > > `LoopIRCuteDSLCodegen` replays those expressions through the shared CuTeDSL > operation overrides. Fragment-local reductions remain in the generated tensor > epilogue. When a reduction crosses fragments or threads, the generated plan > supplies combine and finalize callbacks while the vendored kernel owns > traversal, synchronization, and storage. > > `NVGemmEpilogueProgram` is the validation boundary used by scheduling. It > records which nodes belong to reduction regions, which outputs remain visible, > whether a reduction feeds the main GEMM output, and whether every reduction in > the candidate prefix has a supported lowering. > > ## Examples > > A pointwise epilogue becomes one generated callback: > > ```python > result = a @ b > return torch.relu(result.float() + bias) > ``` > > Multiple reductions and pointwise consumers remain one semantic program: > > ```python > result = a @ b > grouped = result.float().view(m, n // 4, 4) > scale = grouped.sum(-1) + grouped.amax(-1) > return (grouped / scale.unsqueeze(-1)).reshape(m, n), scale > ``` > > The second example is represented as an N-axis reduction with group size four. > The generated epilogue computes both primitive reductions and the division; a > larger or cross-thread geometry additionally receives generated physical > reduction callbacks. > > ## Test Plan > > ```bash > spin lint torch/_inductor/codegen/nv_universal_gemm/epilogue_lowering.py torch/_inductor/kernel/loop_ir_cutedsl_codegen.py > lintrunner -a > python -m py_compile torch/_inductor/codegen/nv_universal_gemm/epilogue_lowering.py torch/_inductor/kernel/loop_ir_cutedsl_codegen.py > ``` > > Description drafted with an AI assistant. Pull Request resolved: #194873 Approved by: https://github.com/drisspg ghstack dependencies: #194792, #194793, #190821, #195231
orrangetabby17
pushed a commit
to orrangetabby17/pytorch
that referenced
this pull request
Sep 2, 2026
…h#195231) <human note needed> > Define a shared representation for grouped GEMM reductions and use it as the > boundary between epilogue analysis and backend-specific code generation. > > ## Shared reduction representation > > `GemmReductionGeometry` describes which logical GEMM output axis is reduced > and how many adjacent elements belong to each group. It also determines > whether the reduction fits inside one TensorSSA fragment or requires physical > cross-thread combination. > > `GemmReductionPlan` carries the complete semantic contract: > > - the grouped reduction geometry; > - the associative primitive, such as sum, product, minimum, or maximum; > - generated source, combine, finalize, and consumer callbacks; > - the primary and auxiliary output buffers; > - whether the reduction feeds the primary GEMM output; and > - whether the generated tensor epilogue returns a fragment-local reduction. > > This separates the mathematical operation from the physical reduction > mechanism. Backends implement fragment traversal, synchronization, and > storage, while generated callbacks describe the computation applied at each > stage. > > ## Loop IR analysis > > Extend the Loop IR analysis to recognize both explicit reduction nodes and > reductions expressed as unrolled pointwise operations. For an unrolled > reduction, the analysis: > > 1. Finds the repeated loads from the GEMM output. > 2. Uses their index ranges and strides to infer the group size and M/N axis. > 3. Verifies that every lane applies the same pointwise source expression. > 4. Identifies the associative primitive. > 5. Preserves the source expression for later CuTeDSL callback generation. > > For example, an expression equivalent to: > > ```python > grouped = output.float().view(m, n // 4, 4) > reduced = torch.exp(grouped).sum(dim=-1) > ``` > > is represented as an N-axis group-of-four sum whose source expression is > `exp(value)`. > > ## FlexGEMM integration > > Replace FlexGEMM's parallel template-time reduction description with a wrapper > around `GemmReductionPlan`. The FlexGEMM wrapper retains only provider-specific > information: the auxiliary-output index, output layout, and operand-swap > state. > > FlexGEMM lowering now passes `epilogue_analysis.reduction_plan` directly into > that wrapper. The shared geometry also owns the fragment-width and > physical-callback decision previously implemented by a FlexGEMM-specific > helper. > > This gives FlexGEMM and NVGEMM the same semantic reduction plan while allowing > each provider to retain its own runtime ABI and code-generation machinery. > > ## Relationship between FlexGEMM and NVGEMM > > Both backends use the same semantic reduction plan, while retaining their > existing analysis and runtime interfaces: > > ```mermaid > flowchart LR > FX["FlexGEMM FX epilogue"] --> FXA["GemmLocalReduceAnalysis"] > LOOP["NVGEMM scheduler Loop IR"] --> LIA["GemmEpilogueIRAnalysis"] > > FXA --> PLAN["GemmReductionPlan<br/>geometry, primitive, callbacks, outputs"] > LIA --> CFG["GemmReductionConfig"] > CFG --> PLAN > > PLAN --> FLEXCFG["FlexGemmEpilogueLocalReduceConfig<br/>plan + output index + layout + swap_ab"] > FLEXCFG --> FLEXRT["FlexGemmRuntimeLocalReducePlan"] > FLEXRT --> QUACK["FlexGEMM / QuACK"] > > PLAN --> NVCAP["NVGEMM capability validation"] > NVCAP --> NVARGS["GemmReductionArguments"] > NVARGS --> NVKERNEL["Vendored NVGEMM kernel"] > ``` > > `GemmReductionPlan` is the shared semantic boundary. FlexGEMM adds only the > output placement and layout information needed by its template, while NVGEMM > binds the plan to runtime tensors and cache-specialization fields. > > ## Testing > > Unit coverage for the shared reduction plan and FlexGEMM adapter is included > in this PR. > > End-to-end dense and block-scaled generated-epilogue coverage is provided by > [pytorch#190825](pytorch#190825). > > ```bash > lintrunner -a > ``` > > Description drafted with an AI assistant. Pull Request resolved: pytorch#195231 Approved by: https://github.com/drisspg ghstack dependencies: pytorch#194792, pytorch#194793, pytorch#190821
orrangetabby17
pushed a commit
to orrangetabby17/pytorch
that referenced
this pull request
Sep 2, 2026
…h#194873) <human note needed> > Introduce the semantic lowering and CuTeDSL emission layer for scheduler-owned > GEMM epilogues. A candidate sequence of scheduler nodes is captured as Loop IR, > classified from iteration ranges and access strides, and represented as one > `NVGemmEpilogueProgram` containing pointwise work, grouped reduction regions, > output ownership, and any callbacks required by the kernel. > > ## Architecture > > `NVGemmEpilogueCapture` interprets the candidate nodes without selecting a > named reduction algorithm. `reduction_type` identifies only the associative > primitive; the captured expressions define source transforms, finalizers, > consumers, and compositions of multiple reductions with pointwise operations. > > `LoopIRCuteDSLCodegen` replays those expressions through the shared CuTeDSL > operation overrides. Fragment-local reductions remain in the generated tensor > epilogue. When a reduction crosses fragments or threads, the generated plan > supplies combine and finalize callbacks while the vendored kernel owns > traversal, synchronization, and storage. > > `NVGemmEpilogueProgram` is the validation boundary used by scheduling. It > records which nodes belong to reduction regions, which outputs remain visible, > whether a reduction feeds the main GEMM output, and whether every reduction in > the candidate prefix has a supported lowering. > > ## Examples > > A pointwise epilogue becomes one generated callback: > > ```python > result = a @ b > return torch.relu(result.float() + bias) > ``` > > Multiple reductions and pointwise consumers remain one semantic program: > > ```python > result = a @ b > grouped = result.float().view(m, n // 4, 4) > scale = grouped.sum(-1) + grouped.amax(-1) > return (grouped / scale.unsqueeze(-1)).reshape(m, n), scale > ``` > > The second example is represented as an N-axis reduction with group size four. > The generated epilogue computes both primitive reductions and the division; a > larger or cross-thread geometry additionally receives generated physical > reduction callbacks. > > ## Test Plan > > ```bash > spin lint torch/_inductor/codegen/nv_universal_gemm/epilogue_lowering.py torch/_inductor/kernel/loop_ir_cutedsl_codegen.py > lintrunner -a > python -m py_compile torch/_inductor/codegen/nv_universal_gemm/epilogue_lowering.py torch/_inductor/kernel/loop_ir_cutedsl_codegen.py > ``` > > Description drafted with an AI assistant. Pull Request resolved: pytorch#194873 Approved by: https://github.com/drisspg ghstack dependencies: pytorch#194792, pytorch#194793, pytorch#190821, pytorch#195231
bobrenjc93
added a commit
to bobrenjc93/pytorch
that referenced
this pull request
Sep 3, 2026
Use object instead of Any for the expression-tree walker inputs in loop_ir_epilogue_lowering.py. These helpers walk a tree whose leaves are genuinely heterogeneous (nested GemmEpilogueIRExpression nodes, sympy indices, dtypes, ints, floats), which is precisely why the parameter cannot just be the IR type. Every helper already isinstance-narrows before touching expression members, so object captures the accepted boundary while removing the unchecked attribute access Any permits. This is a rebase onto current main. The file was largely rewritten upstream by the NVGEMM epilogue work (pytorch#194793, pytorch#195231, pytorch#192298), which deleted ten of the seventeen helpers this change originally touched -- the affine/softmax/variance matchers, including _source_transform. Seven of the original sites survive; the same treatment is applied to the three walkers that rewrite introduced (_expression_pattern, _synthetic_reduction_element_ir, _synthetic_reductions_ir) so the module is consistent rather than half converted. Return types are deliberately left as Any. These walkers hand back raw tree leaves, so narrowing the returns is a separate and much larger change to every caller. Test Plan: ``` lintrunner --take PYFMT,RUFF,CODESPELL,FLAKE8 \ torch/_inductor/kernel/loop_ir_epilogue_lowering.py ``` Pyrefly 0.58.0 reports 0 errors on the file both before and after, so there are no net-new type errors: ``` uvx [email protected] check \ torch/_inductor/kernel/loop_ir_epilogue_lowering.py ``` The module's tests pass locally on an H100 (21 passed, 168 skipped; the skips are the Blackwell-gated end-to-end cases, and the tests that do run cover the walkers directly -- grouped reduction pattern matching, region construction and the reduction finalizer): ``` python -m pytest test/inductor/test_nv_universal_gemm.py -q ``` Authored with assistance from an AI coding assistant.
pytorchmergebot
pushed a commit
to bobrenjc93/pytorch
that referenced
this pull request
Sep 3, 2026
Use object instead of Any for the expression-tree walker inputs in loop_ir_epilogue_lowering.py. These helpers walk a tree whose leaves are genuinely heterogeneous (nested GemmEpilogueIRExpression nodes, sympy indices, dtypes, ints, floats), which is precisely why the parameter cannot just be the IR type. Every helper already isinstance-narrows before touching expression members, so object captures the accepted boundary while removing the unchecked attribute access Any permits. This is a rebase onto current main. The file was largely rewritten upstream by the NVGEMM epilogue work (pytorch#194793, pytorch#195231, pytorch#192298), which deleted ten of the seventeen helpers this change originally touched -- the affine/softmax/variance matchers, including _source_transform. Seven of the original sites survive; the same treatment is applied to the three walkers that rewrite introduced (_expression_pattern, _synthetic_reduction_element_ir, _synthetic_reductions_ir) so the module is consistent rather than half converted. Return types are deliberately left as Any. These walkers hand back raw tree leaves, so narrowing the returns is a separate and much larger change to every caller. Test Plan: ``` lintrunner --take PYFMT,RUFF,CODESPELL,FLAKE8 \ torch/_inductor/kernel/loop_ir_epilogue_lowering.py ``` Pyrefly 0.58.0 reports 0 errors on the file both before and after, so there are no net-new type errors: ``` uvx [email protected] check \ torch/_inductor/kernel/loop_ir_epilogue_lowering.py ``` The module's tests pass locally on an H100 (21 passed, 168 skipped; the skips are the Blackwell-gated end-to-end cases, and the tests that do run cover the walkers directly -- grouped reduction pattern matching, region construction and the reduction finalizer): ``` python -m pytest test/inductor/test_nv_universal_gemm.py -q ``` Authored with assistance from an AI coding assistant.
pytorchmergebot
pushed a commit
to bobrenjc93/pytorch
that referenced
this pull request
Sep 4, 2026
Use object instead of Any for the expression-tree walker inputs in loop_ir_epilogue_lowering.py. These helpers walk a tree whose leaves are genuinely heterogeneous (nested GemmEpilogueIRExpression nodes, sympy indices, dtypes, ints, floats), which is precisely why the parameter cannot just be the IR type. Every helper already isinstance-narrows before touching expression members, so object captures the accepted boundary while removing the unchecked attribute access Any permits. This is a rebase onto current main. The file was largely rewritten upstream by the NVGEMM epilogue work (pytorch#194793, pytorch#195231, pytorch#192298), which deleted ten of the seventeen helpers this change originally touched -- the affine/softmax/variance matchers, including _source_transform. Seven of the original sites survive; the same treatment is applied to the three walkers that rewrite introduced (_expression_pattern, _synthetic_reduction_element_ir, _synthetic_reductions_ir) so the module is consistent rather than half converted. Return types are deliberately left as Any. These walkers hand back raw tree leaves, so narrowing the returns is a separate and much larger change to every caller. Test Plan: ``` lintrunner --take PYFMT,RUFF,CODESPELL,FLAKE8 \ torch/_inductor/kernel/loop_ir_epilogue_lowering.py ``` Pyrefly 0.58.0 reports 0 errors on the file both before and after, so there are no net-new type errors: ``` uvx [email protected] check \ torch/_inductor/kernel/loop_ir_epilogue_lowering.py ``` The module's tests pass locally on an H100 (21 passed, 168 skipped; the skips are the Blackwell-gated end-to-end cases, and the tests that do run cover the walkers directly -- grouped reduction pattern matching, region construction and the reduction finalizer): ``` python -m pytest test/inductor/test_nv_universal_gemm.py -q ``` Authored with assistance from an AI coding assistant.
pytorchmergebot
pushed a commit
that referenced
this pull request
Sep 4, 2026
…194825) The tree's leaves are genuinely heterogeneous (nested `GemmEpilogueIRExpression` nodes, sympy indices, dtypes, ints, floats), which is precisely why the parameter cannot just be the IR type. Every walker already `isinstance`-narrows before touching expression members, so `object` captures the accepted boundary while removing the unchecked attribute access `Any` permits. **Rebased onto current main.** The file was largely rewritten upstream by the NVGEMM epilogue work (#194793, #195231, #192298), which deleted ten of the seventeen helpers this PR originally touched -- the affine/softmax/variance matchers, including `_source_transform`. Seven of the original sites survive, and the same treatment is applied to the three walkers that rewrite introduced (`_expression_pattern`, `_synthetic_reduction_element_ir`, `_synthetic_reductions_ir`) so the module is consistent rather than half converted. Return types are deliberately left as `Any`: these walkers hand back raw tree leaves, so narrowing the returns is a separate and much larger change to every caller. ### Test plan ``` lintrunner --take PYFMT,RUFF,CODESPELL,FLAKE8 \ torch/_inductor/kernel/loop_ir_epilogue_lowering.py ``` Pyrefly 0.58.0 reports 0 errors on the file both before and after, so there are no net-new type errors: ``` uvx [email protected] check \ torch/_inductor/kernel/loop_ir_epilogue_lowering.py ``` The module's tests pass locally on an H100 (21 passed, 168 skipped; the skips are the Blackwell-gated end-to-end cases, and the tests that do run cover the walkers directly -- grouped reduction pattern matching, region construction and the reduction finalizer): ``` python -m pytest test/inductor/test_nv_universal_gemm.py -q ``` Authored with assistance from an AI coding assistant. Pull Request resolved: #194825 Approved by: https://github.com/pytorchgreenlight
Sanskaaar1
pushed a commit
to Sanskaaar1/pytorch
that referenced
this pull request
Sep 8, 2026
…h#195231) <human note needed> > Define a shared representation for grouped GEMM reductions and use it as the > boundary between epilogue analysis and backend-specific code generation. > > ## Shared reduction representation > > `GemmReductionGeometry` describes which logical GEMM output axis is reduced > and how many adjacent elements belong to each group. It also determines > whether the reduction fits inside one TensorSSA fragment or requires physical > cross-thread combination. > > `GemmReductionPlan` carries the complete semantic contract: > > - the grouped reduction geometry; > - the associative primitive, such as sum, product, minimum, or maximum; > - generated source, combine, finalize, and consumer callbacks; > - the primary and auxiliary output buffers; > - whether the reduction feeds the primary GEMM output; and > - whether the generated tensor epilogue returns a fragment-local reduction. > > This separates the mathematical operation from the physical reduction > mechanism. Backends implement fragment traversal, synchronization, and > storage, while generated callbacks describe the computation applied at each > stage. > > ## Loop IR analysis > > Extend the Loop IR analysis to recognize both explicit reduction nodes and > reductions expressed as unrolled pointwise operations. For an unrolled > reduction, the analysis: > > 1. Finds the repeated loads from the GEMM output. > 2. Uses their index ranges and strides to infer the group size and M/N axis. > 3. Verifies that every lane applies the same pointwise source expression. > 4. Identifies the associative primitive. > 5. Preserves the source expression for later CuTeDSL callback generation. > > For example, an expression equivalent to: > > ```python > grouped = output.float().view(m, n // 4, 4) > reduced = torch.exp(grouped).sum(dim=-1) > ``` > > is represented as an N-axis group-of-four sum whose source expression is > `exp(value)`. > > ## FlexGEMM integration > > Replace FlexGEMM's parallel template-time reduction description with a wrapper > around `GemmReductionPlan`. The FlexGEMM wrapper retains only provider-specific > information: the auxiliary-output index, output layout, and operand-swap > state. > > FlexGEMM lowering now passes `epilogue_analysis.reduction_plan` directly into > that wrapper. The shared geometry also owns the fragment-width and > physical-callback decision previously implemented by a FlexGEMM-specific > helper. > > This gives FlexGEMM and NVGEMM the same semantic reduction plan while allowing > each provider to retain its own runtime ABI and code-generation machinery. > > ## Relationship between FlexGEMM and NVGEMM > > Both backends use the same semantic reduction plan, while retaining their > existing analysis and runtime interfaces: > > ```mermaid > flowchart LR > FX["FlexGEMM FX epilogue"] --> FXA["GemmLocalReduceAnalysis"] > LOOP["NVGEMM scheduler Loop IR"] --> LIA["GemmEpilogueIRAnalysis"] > > FXA --> PLAN["GemmReductionPlan<br/>geometry, primitive, callbacks, outputs"] > LIA --> CFG["GemmReductionConfig"] > CFG --> PLAN > > PLAN --> FLEXCFG["FlexGemmEpilogueLocalReduceConfig<br/>plan + output index + layout + swap_ab"] > FLEXCFG --> FLEXRT["FlexGemmRuntimeLocalReducePlan"] > FLEXRT --> QUACK["FlexGEMM / QuACK"] > > PLAN --> NVCAP["NVGEMM capability validation"] > NVCAP --> NVARGS["GemmReductionArguments"] > NVARGS --> NVKERNEL["Vendored NVGEMM kernel"] > ``` > > `GemmReductionPlan` is the shared semantic boundary. FlexGEMM adds only the > output placement and layout information needed by its template, while NVGEMM > binds the plan to runtime tensors and cache-specialization fields. > > ## Testing > > Unit coverage for the shared reduction plan and FlexGEMM adapter is included > in this PR. > > End-to-end dense and block-scaled generated-epilogue coverage is provided by > [pytorch#190825](pytorch#190825). > > ```bash > lintrunner -a > ``` > > Description drafted with an AI assistant. Pull Request resolved: pytorch#195231 Approved by: https://github.com/drisspg ghstack dependencies: pytorch#194792, pytorch#194793, pytorch#190821
Sanskaaar1
pushed a commit
to Sanskaaar1/pytorch
that referenced
this pull request
Sep 8, 2026
…h#194873) <human note needed> > Introduce the semantic lowering and CuTeDSL emission layer for scheduler-owned > GEMM epilogues. A candidate sequence of scheduler nodes is captured as Loop IR, > classified from iteration ranges and access strides, and represented as one > `NVGemmEpilogueProgram` containing pointwise work, grouped reduction regions, > output ownership, and any callbacks required by the kernel. > > ## Architecture > > `NVGemmEpilogueCapture` interprets the candidate nodes without selecting a > named reduction algorithm. `reduction_type` identifies only the associative > primitive; the captured expressions define source transforms, finalizers, > consumers, and compositions of multiple reductions with pointwise operations. > > `LoopIRCuteDSLCodegen` replays those expressions through the shared CuTeDSL > operation overrides. Fragment-local reductions remain in the generated tensor > epilogue. When a reduction crosses fragments or threads, the generated plan > supplies combine and finalize callbacks while the vendored kernel owns > traversal, synchronization, and storage. > > `NVGemmEpilogueProgram` is the validation boundary used by scheduling. It > records which nodes belong to reduction regions, which outputs remain visible, > whether a reduction feeds the main GEMM output, and whether every reduction in > the candidate prefix has a supported lowering. > > ## Examples > > A pointwise epilogue becomes one generated callback: > > ```python > result = a @ b > return torch.relu(result.float() + bias) > ``` > > Multiple reductions and pointwise consumers remain one semantic program: > > ```python > result = a @ b > grouped = result.float().view(m, n // 4, 4) > scale = grouped.sum(-1) + grouped.amax(-1) > return (grouped / scale.unsqueeze(-1)).reshape(m, n), scale > ``` > > The second example is represented as an N-axis reduction with group size four. > The generated epilogue computes both primitive reductions and the division; a > larger or cross-thread geometry additionally receives generated physical > reduction callbacks. > > ## Test Plan > > ```bash > spin lint torch/_inductor/codegen/nv_universal_gemm/epilogue_lowering.py torch/_inductor/kernel/loop_ir_cutedsl_codegen.py > lintrunner -a > python -m py_compile torch/_inductor/codegen/nv_universal_gemm/epilogue_lowering.py torch/_inductor/kernel/loop_ir_cutedsl_codegen.py > ``` > > Description drafted with an AI assistant. Pull Request resolved: pytorch#194873 Approved by: https://github.com/drisspg ghstack dependencies: pytorch#194792, pytorch#194793, pytorch#190821, pytorch#195231
Sanskaaar1
pushed a commit
to Sanskaaar1/pytorch
that referenced
this pull request
Sep 8, 2026
…ytorch#194825) The tree's leaves are genuinely heterogeneous (nested `GemmEpilogueIRExpression` nodes, sympy indices, dtypes, ints, floats), which is precisely why the parameter cannot just be the IR type. Every walker already `isinstance`-narrows before touching expression members, so `object` captures the accepted boundary while removing the unchecked attribute access `Any` permits. **Rebased onto current main.** The file was largely rewritten upstream by the NVGEMM epilogue work (pytorch#194793, pytorch#195231, pytorch#192298), which deleted ten of the seventeen helpers this PR originally touched -- the affine/softmax/variance matchers, including `_source_transform`. Seven of the original sites survive, and the same treatment is applied to the three walkers that rewrite introduced (`_expression_pattern`, `_synthetic_reduction_element_ir`, `_synthetic_reductions_ir`) so the module is consistent rather than half converted. Return types are deliberately left as `Any`: these walkers hand back raw tree leaves, so narrowing the returns is a separate and much larger change to every caller. ### Test plan ``` lintrunner --take PYFMT,RUFF,CODESPELL,FLAKE8 \ torch/_inductor/kernel/loop_ir_epilogue_lowering.py ``` Pyrefly 0.58.0 reports 0 errors on the file both before and after, so there are no net-new type errors: ``` uvx [email protected] check \ torch/_inductor/kernel/loop_ir_epilogue_lowering.py ``` The module's tests pass locally on an H100 (21 passed, 168 skipped; the skips are the Blackwell-gated end-to-end cases, and the tests that do run cover the walkers directly -- grouped reduction pattern matching, region construction and the reduction finalizer): ``` python -m pytest test/inductor/test_nv_universal_gemm.py -q ``` Authored with assistance from an AI coding assistant. Pull Request resolved: pytorch#194825 Approved by: https://github.com/pytorchgreenlight
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.
Stack from ghstack (oldest at bottom):
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo