Repository navigation
loop_ir_epilogue_lowering.py expression-tree walkers -> object - #194825
bobrenjc93 wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/194825
Note: Links to docs will display an error until the docs builds have been completed. ⏳ 1 Pending, 1 Unrelated FailureAs of commit b799042 with merge base 1e9d530 ( GREEN LIGHT - PR approved to be merged without human review:
reason: 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. |
|
Claude finished @bobrenjc93's task in 7m 57s —— View job Review completeAnnotation-only change with no runtime effect — safe to land, but the tightening stops short of its stated goal: Full reviewPR Review: #194825SummaryChanges 17 expression-tree walker parameters in Code Quality
API Design
TestingNot a blocker for an annotation-only change, and no new tests are warranted. Flagging for context: the module's only coverage is Backward CompatibilityNo concern. All 17 names are private (14 module-level underscore-prefixed, 3 nested closures), the module has no RecommendationApprove Nothing here is a correctness or compatibility risk, and the change is strictly directionally right. The findings are about it being an incomplete version of itself: four sibling parameters left on Note: no |
6e857ed to
9a37aac
Compare
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Successfully rebased |
9a37aac to
452364a
Compare
|
@pytorchbot drci |
|
@pytorchbot merge |
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 |
Merge failedReason: 1 jobs have failed, first few of them are: torchtitan-test / torchtitan-x-pytorch-test / test (torchtitan_models_integration, 1, 1, lf-l-x86aavx2-189-704-a10g-8) Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 1 checks: torchtitan-test / torchtitan-x-pytorch-test / test (torchtitan_models_integration, 1, 1, lf-l-x86aavx2-189-704-a10g-8) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command |
|
@pytorchbot merge |
|
@pytorchbot rebase |
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 |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
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.
|
Successfully rebased |
452364a to
b799042
Compare
Merge failedReason: New commits were pushed while merging. Please rerun the merge command. Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 0 checks: Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 jobs have failed, first few of them are: torchtitan-test / torchtitan-x-pytorch-test / test (torchtitan_models_integration, 1, 1, mt-l-x86aavx2-189-704-a10g-8) Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -i |
1 similar comment
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 1 checks: torchtitan-test / torchtitan-x-pytorch-test / test (torchtitan_models_integration, 1, 1, mt-l-x86aavx2-189-704-a10g-8) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…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
The tree's leaves are genuinely heterogeneous (nested
GemmEpilogueIRExpressionnodes, sympy indices, dtypes, ints, floats), which is precisely why the parameter cannot just be the IR type. Every walker alreadyisinstance-narrows before touching expression members, soobjectcaptures the accepted boundary while removing the unchecked attribute accessAnypermits.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
Pyrefly 0.58.0 reports 0 errors on the file both before and after, so there are no net-new type errors:
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):
Authored with assistance from an AI coding assistant.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo