Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/190822
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 2937357 with merge base 3ee461f ( 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 Jul 22, 2026
Closed
Contributor
Author
AI-Review
No verified issues found. |
mlazos
added a commit
that referenced
this pull request
Jul 23, 2026
Allow template scheduling to claim a complete reduction chain as one fusion unit and retain the output identity needed by multi-output template kernels. This prevents partial fusion from consuming layout or finalizer nodes before NVGEMM can validate the complete grouped pattern. Test Plan: ```bash lintrunner -a ``` Authored with an AI assistant. ghstack-source-id: 1b35327 Pull-Request: #190822
This was referenced Aug 25, 2026
This was referenced Sep 1, 2026
Collaborator
|
Starting merge as part of PR stack under #192928 |
1 similar comment
Collaborator
|
Starting merge as part of PR stack under #192928 |
pytorchmergebot
pushed a commit
that referenced
this pull request
Sep 2, 2026
prepares dense kernel for direct cutedsl codegen (instead of EVT) > This updates the vendored dense matrix-multiply kernel so it can run the > post-processing function generated directly by Inductor. It maps captured > tensors such as biases into the layout expected by the kernel, exposes the > operations used by the generated function, and stores each requested output. > > The older metadata format remains supported in this commit so the kernel > change can land separately from the scheduler change that starts using the > direct path. > > ## Example > > The direct epilogue represents a computation such as: > > ```python > def fn(a, b, bias): > return torch.relu((a @ b) + bias) > ``` > > Given generated source for this epilogue, the adapter maps the bias into the > dense kernel's broadcast layout, evaluates the addition and ReLU, and stores > the result. This commit teaches the provider to accept that direct function; > the following commit switches scheduler selection from the older CUTLASS > expression-graph representation to this path. > > ## Test Plan > > ```bash > CUDA_VISIBLE_DEVICES=0 TORCHINDUCTOR_COMPILE_THREADS=1 python test/inductor/test_nv_universal_gemm.py -k matmul_pointwise_epilogue_fusion -v > CUDA_VISIBLE_DEVICES=0 TORCHINDUCTOR_COMPILE_THREADS=1 python test/inductor/test_nv_universal_gemm.py TestNVUniversalGemmEpilogueFusion.test_matmul_multi_store_epilogue_fusion -v > lintrunner -a > ``` > > Description drafted with an AI assistant. Pull Request resolved: #191514 Approved by: https://github.com/drisspg ghstack dependencies: #192298, #190822
pytorchmergebot
pushed a commit
that referenced
this pull request
Sep 2, 2026
…191515) > Enable shared Loop IR to CuTeDSL lowering for dense NVGEMM epilogues. The > scheduler selects generated CuTeDSL source when the complete captured > expression is supported and retains CUTLASS EVT lowering as the fallback. > > Preserve captured input dtypes and broadcast layouts, compose bias through > the same epilogue plan, reuse common subexpressions, and reject unsupported > operand swaps or reduction layouts before selecting the direct path. > > ## Example > > ```python > result = (a @ b).float() > return torch.relu(result), result + bias > ``` > > Both stores are generated from one captured Loop IR program. Expressions that > cannot be represented by the direct path continue through EVT. > > ## Test Plan > > ```bash > PYTORCH_WORKTREE=$PWD env -u PYTHONPATH python agent_space/run_worktree_python.py test/inductor/test_nv_universal_gemm.py TestNVUniversalGemmEpilogueFusion.test_matmul_multi_store_epilogue_fusion -v > lintrunner -a > ``` > > Description drafted with an AI assistant. Pull Request resolved: #191515 Approved by: https://github.com/drisspg ghstack dependencies: #192298, #190822, #191514
pytorchmergebot
pushed a commit
that referenced
this pull request
Sep 2, 2026
> Add focused parity coverage for generated CuTeDSL callbacks across dense and > block-scaled grouped reductions. The tests cover both reduction axes, > primitive and pointwise-transformed sources, multiple reductions in one > epilogue, reduction consumers, and finalization after cross-warp combination. > > Keep the transposed output layout explicit when NVGEMM swaps the GEMM operands. > Let FlexGEMM request the broader tuned NVGEMM configuration while rejecting > unsupported NVGEMM options. > > ## Test Plan > > ```bash > PYTHONPATH=/data/users/mlazos/pytorch/agent_space/runtime_overlay PYTORCH_BOUNDARY_ROOT=$PWD python test/inductor/test_nv_universal_gemm.py TestNVUniversalGemmHeuristics -v > PYTHONPATH=/data/users/mlazos/pytorch/agent_space/runtime_overlay PYTORCH_BOUNDARY_ROOT=$PWD python test/inductor/test_nv_universal_gemm.py TestNVUniversalGemmEpilogueFusion.test_bf16_grouped_m_reduce_finalizes_after_cross_warp_combine TestNVUniversalGemmEpilogueFusion.test_bf16_grouped_n_composite_reduction_fusion TestNVUniversalGemmEpilogueFusion.test_scaled_mm_grouped_n_composite_reduction_fusion TestNVUniversalGemmEpilogueFusion.test_scaled_mm_grouped_m_reduce_finalizes_after_cross_warp_combine -v > PYTHONPATH=/data/users/mlazos/pytorch/agent_space/runtime_overlay PYTORCH_BOUNDARY_ROOT=$PWD python test/inductor/test_nv_universal_gemm.py TestNVUniversalGemmEpilogueFusion.test_bf16_grouped_reduce_epilogue_fusion_axis_1_group_4_sum TestNVUniversalGemmEpilogueFusion.test_bf16_grouped_reduce_epilogue_fusion_axis_0_group_64_abs_amax TestNVUniversalGemmEpilogueFusion.test_flex_gemm_grouped_n_reduce_epilogue_fusion_feeds_main_True -v > lintrunner -a > ``` > > Description drafted with an AI assistant. Pull Request resolved: #190825 Approved by: https://github.com/karthickai ghstack dependencies: #192298, #190822, #191514, #191515
pytorchmergebot
pushed a commit
that referenced
this pull request
Sep 2, 2026
doesn't run hese tests in fbcode until we add operator API internally > This skips two low-level tests only in fbcode because fbcode does not include > the optional CUTLASS package those tests use to construct and run kernel > objects directly. The tests fail while importing or creating the operator, > before they exercise the NVGEMM behavior they are intended to check. > > The tests still run in the open-source build, and the higher-level > `torch.compile` tests remain enabled in fbcode. > > ## Architecture > > This is a test-only environment boundary. The two tests that directly import > the optional CUTLASS Operator API are skipped individually when `IS_FBCODE` is > true. No production lowering, provider registration, or generated-kernel > behavior changes. The tests continue running in open source, while fbcode > retains the higher-level compiler coverage. > > ## Example > > The affected tests directly compile a grouped-reduction provider and a > unit-dimension epilogue on a non-current CUDA stream. In fbcode, the required > operator-construction API is absent, so skipping those two tests avoids > reporting an environment limitation as an NVGEMM correctness failure. > > > ```python > @unittest.skipIf( > IS_FBCODE, > "CUTLASS Operator API is not available in fbcode", > ) > def test_scaled_gemm_grouped_n_reduce_provider(self): > ... > ``` > > ## Test Plan > > ```bash > PYTORCH_TEST_FBCODE=1 python test/inductor/test_nv_universal_gemm.py TestNVUniversalGemm.test_scaled_gemm_grouped_n_reduce_provider TestNVUniversalGemm.test_scaled_gemm_unit_dim_epilogue_non_current_stream -v > python test/inductor/test_nv_universal_gemm.py TestNVUniversalGemm.test_scaled_gemm_grouped_n_reduce_provider TestNVUniversalGemm.test_scaled_gemm_unit_dim_epilogue_non_current_stream -v > lintrunner -a > ``` > > Description drafted with an AI assistant. Pull Request resolved: #192928 Approved by: https://github.com/karthickai ghstack dependencies: #192298, #190822, #191514, #191515, #190825
Sanskaaar1
pushed a commit
to Sanskaaar1/pytorch
that referenced
this pull request
Sep 8, 2026
<human note needed> > Add scheduler hooks that let a CUDA template backend keep a validated > reduction region together during fusion. Reduction-pair compatibility and > reduction-epilogue decisions are delegated to the backend before generic > fusion can consume only part of the region. > > NVGEMM uses these hooks to prioritize supported reduction chains, reject > conflicting partial fusions, and keep NVGEMM boolean outputs out of unrelated > horizontal fusion. The Loop IR capture and validation logic lives in the > preceding commits; this commit only adds the scheduler coordination needed to > treat its result atomically. > > ## Test Plan > > ```bash > lintrunner -a > ``` > > Description drafted with an AI assistant. Pull Request resolved: pytorch#190822 Approved by: https://github.com/drisspg ghstack dependencies: pytorch#192298
Sanskaaar1
pushed a commit
to Sanskaaar1/pytorch
that referenced
this pull request
Sep 8, 2026
…ch#191514) prepares dense kernel for direct cutedsl codegen (instead of EVT) > This updates the vendored dense matrix-multiply kernel so it can run the > post-processing function generated directly by Inductor. It maps captured > tensors such as biases into the layout expected by the kernel, exposes the > operations used by the generated function, and stores each requested output. > > The older metadata format remains supported in this commit so the kernel > change can land separately from the scheduler change that starts using the > direct path. > > ## Example > > The direct epilogue represents a computation such as: > > ```python > def fn(a, b, bias): > return torch.relu((a @ b) + bias) > ``` > > Given generated source for this epilogue, the adapter maps the bias into the > dense kernel's broadcast layout, evaluates the addition and ReLU, and stores > the result. This commit teaches the provider to accept that direct function; > the following commit switches scheduler selection from the older CUTLASS > expression-graph representation to this path. > > ## Test Plan > > ```bash > CUDA_VISIBLE_DEVICES=0 TORCHINDUCTOR_COMPILE_THREADS=1 python test/inductor/test_nv_universal_gemm.py -k matmul_pointwise_epilogue_fusion -v > CUDA_VISIBLE_DEVICES=0 TORCHINDUCTOR_COMPILE_THREADS=1 python test/inductor/test_nv_universal_gemm.py TestNVUniversalGemmEpilogueFusion.test_matmul_multi_store_epilogue_fusion -v > lintrunner -a > ``` > > Description drafted with an AI assistant. Pull Request resolved: pytorch#191514 Approved by: https://github.com/drisspg ghstack dependencies: pytorch#192298, pytorch#190822
Sanskaaar1
pushed a commit
to Sanskaaar1/pytorch
that referenced
this pull request
Sep 8, 2026
…ytorch#191515) > Enable shared Loop IR to CuTeDSL lowering for dense NVGEMM epilogues. The > scheduler selects generated CuTeDSL source when the complete captured > expression is supported and retains CUTLASS EVT lowering as the fallback. > > Preserve captured input dtypes and broadcast layouts, compose bias through > the same epilogue plan, reuse common subexpressions, and reject unsupported > operand swaps or reduction layouts before selecting the direct path. > > ## Example > > ```python > result = (a @ b).float() > return torch.relu(result), result + bias > ``` > > Both stores are generated from one captured Loop IR program. Expressions that > cannot be represented by the direct path continue through EVT. > > ## Test Plan > > ```bash > PYTORCH_WORKTREE=$PWD env -u PYTHONPATH python agent_space/run_worktree_python.py test/inductor/test_nv_universal_gemm.py TestNVUniversalGemmEpilogueFusion.test_matmul_multi_store_epilogue_fusion -v > lintrunner -a > ``` > > Description drafted with an AI assistant. Pull Request resolved: pytorch#191515 Approved by: https://github.com/drisspg ghstack dependencies: pytorch#192298, pytorch#190822, pytorch#191514
Sanskaaar1
pushed a commit
to Sanskaaar1/pytorch
that referenced
this pull request
Sep 8, 2026
> Add focused parity coverage for generated CuTeDSL callbacks across dense and > block-scaled grouped reductions. The tests cover both reduction axes, > primitive and pointwise-transformed sources, multiple reductions in one > epilogue, reduction consumers, and finalization after cross-warp combination. > > Keep the transposed output layout explicit when NVGEMM swaps the GEMM operands. > Let FlexGEMM request the broader tuned NVGEMM configuration while rejecting > unsupported NVGEMM options. > > ## Test Plan > > ```bash > PYTHONPATH=/data/users/mlazos/pytorch/agent_space/runtime_overlay PYTORCH_BOUNDARY_ROOT=$PWD python test/inductor/test_nv_universal_gemm.py TestNVUniversalGemmHeuristics -v > PYTHONPATH=/data/users/mlazos/pytorch/agent_space/runtime_overlay PYTORCH_BOUNDARY_ROOT=$PWD python test/inductor/test_nv_universal_gemm.py TestNVUniversalGemmEpilogueFusion.test_bf16_grouped_m_reduce_finalizes_after_cross_warp_combine TestNVUniversalGemmEpilogueFusion.test_bf16_grouped_n_composite_reduction_fusion TestNVUniversalGemmEpilogueFusion.test_scaled_mm_grouped_n_composite_reduction_fusion TestNVUniversalGemmEpilogueFusion.test_scaled_mm_grouped_m_reduce_finalizes_after_cross_warp_combine -v > PYTHONPATH=/data/users/mlazos/pytorch/agent_space/runtime_overlay PYTORCH_BOUNDARY_ROOT=$PWD python test/inductor/test_nv_universal_gemm.py TestNVUniversalGemmEpilogueFusion.test_bf16_grouped_reduce_epilogue_fusion_axis_1_group_4_sum TestNVUniversalGemmEpilogueFusion.test_bf16_grouped_reduce_epilogue_fusion_axis_0_group_64_abs_amax TestNVUniversalGemmEpilogueFusion.test_flex_gemm_grouped_n_reduce_epilogue_fusion_feeds_main_True -v > lintrunner -a > ``` > > Description drafted with an AI assistant. Pull Request resolved: pytorch#190825 Approved by: https://github.com/karthickai ghstack dependencies: pytorch#192298, pytorch#190822, pytorch#191514, pytorch#191515
Sanskaaar1
pushed a commit
to Sanskaaar1/pytorch
that referenced
this pull request
Sep 8, 2026
doesn't run hese tests in fbcode until we add operator API internally > This skips two low-level tests only in fbcode because fbcode does not include > the optional CUTLASS package those tests use to construct and run kernel > objects directly. The tests fail while importing or creating the operator, > before they exercise the NVGEMM behavior they are intended to check. > > The tests still run in the open-source build, and the higher-level > `torch.compile` tests remain enabled in fbcode. > > ## Architecture > > This is a test-only environment boundary. The two tests that directly import > the optional CUTLASS Operator API are skipped individually when `IS_FBCODE` is > true. No production lowering, provider registration, or generated-kernel > behavior changes. The tests continue running in open source, while fbcode > retains the higher-level compiler coverage. > > ## Example > > The affected tests directly compile a grouped-reduction provider and a > unit-dimension epilogue on a non-current CUDA stream. In fbcode, the required > operator-construction API is absent, so skipping those two tests avoids > reporting an environment limitation as an NVGEMM correctness failure. > > > ```python > @unittest.skipIf( > IS_FBCODE, > "CUTLASS Operator API is not available in fbcode", > ) > def test_scaled_gemm_grouped_n_reduce_provider(self): > ... > ``` > > ## Test Plan > > ```bash > PYTORCH_TEST_FBCODE=1 python test/inductor/test_nv_universal_gemm.py TestNVUniversalGemm.test_scaled_gemm_grouped_n_reduce_provider TestNVUniversalGemm.test_scaled_gemm_unit_dim_epilogue_non_current_stream -v > python test/inductor/test_nv_universal_gemm.py TestNVUniversalGemm.test_scaled_gemm_grouped_n_reduce_provider TestNVUniversalGemm.test_scaled_gemm_unit_dim_epilogue_non_current_stream -v > lintrunner -a > ``` > > Description drafted with an AI assistant. Pull Request resolved: pytorch#192928 Approved by: https://github.com/karthickai ghstack dependencies: pytorch#192298, pytorch#190822, pytorch#191514, pytorch#191515, pytorch#190825
pytorchmergebot
pushed a commit
that referenced
this pull request
Sep 10, 2026
Orient generated reduction geometry, output layouts, and runtime tensors when NVGEMM swaps GEMM operands. Dense and block-scaled epilogues continue to use the shared generated source, combine, and finalizer callbacks. Keep the kernel reduction mechanism unchanged. Candidate validation filters physical tile layouts that cross CTA or warp ownership, leaving valid configurations in the normal autotuning set and falling back safely when a layout cannot implement the reduction. ## Test Plan ```bash PYTHONPATH=/data/users/mlazos/pytorch/agent_space/runtime_overlay PYTORCH_BOUNDARY_ROOT=$PWD python test/inductor/test_nv_universal_gemm.py -k swap_ab PYTHONPATH=/data/users/mlazos/pytorch/agent_space/runtime_overlay PYTORCH_BOUNDARY_ROOT=$PWD python test/inductor/test_nv_universal_gemm.py -k grouped_reduce spin quicklint lintrunner -a ``` Authored with an AI assistant. Pull Request resolved: #195538 Approved by: https://github.com/karthickai ghstack dependencies: #192298, #190822, #191514, #191515, #190825, #192928
pytorchmergebot
pushed a commit
that referenced
this pull request
Sep 10, 2026
Generate vendored dense EFC variants for the validated SM100 N-tile widths through 256, including 160, 192, and 224. This makes the configurations available to nvMatmulHeuristics without retaining them unconditionally. Keep the existing supplemented benchmark space unchanged. Wider candidates enter autotuning only when nvMatmulHeuristics selects them, avoiding additional profiling by default. ## Test Plan ```bash PYTHONPATH=/data/users/mlazos/pytorch/agent_space/runtime_overlay PYTORCH_BOUNDARY_ROOT=$PWD python test/inductor/test_nv_universal_gemm.py TestNVUniversalGemm.test_vendored_dense_efc_exposes_wide_n_tiles -v lintrunner -a ``` Authored with an AI assistant. Pull Request resolved: #195539 Approved by: https://github.com/karthickai ghstack dependencies: #192298, #190822, #191514, #191515, #190825, #192928, #195538
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