pytorch - 💡(How to fix) Fix [Inductor][NVGEMM] tile_M<128 EFC kernels broadcast incorrectly [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
pytorch/pytorch#181901Fetched 2026-04-30 06:17:48
View on GitHub
Comments
0
Participants
1
Timeline
47
Reactions
0
Participants
Timeline (top)
mentioned ×19subscribed ×19labeled ×8renamed ×1

NVGEMM EFC kernels with tile_M < 128 produce incorrect results for epilogue broadcasts due to a bug in cutlass_api's broadcast handling. We currently filter these kernels out at choice-enumeration time as a workaround.

Root Cause

NVGEMM EFC kernels with tile_M < 128 produce incorrect results for epilogue broadcasts due to a bug in cutlass_api's broadcast handling. We currently filter these kernels out at choice-enumeration time as a workaround.

Fix Action

Resolution

Once the cutlass_api bug is fixed, remove the tile_M >= 128 constraint from _include_efc_kernels_only and the -1 branch from _classify. EFC kernels with smaller tiles (e.g. tile_M=64) would then be available for autotuning, which can be a meaningful win for small-M decode shapes.

Workaround

torch/_inductor/codegen/nv_universal_gemm/nv_universal_gemm.py_include_efc_kernels_only rejects EFC kernels with tile_M < 128. The _classify callback in _add_nv_gemm_choices_impl drops them (returns -1).

RAW_BUFFERClick to expand / collapse

Summary

NVGEMM EFC kernels with tile_M < 128 produce incorrect results for epilogue broadcasts due to a bug in cutlass_api's broadcast handling. We currently filter these kernels out at choice-enumeration time as a workaround.

Workaround

torch/_inductor/codegen/nv_universal_gemm/nv_universal_gemm.py_include_efc_kernels_only rejects EFC kernels with tile_M < 128. The _classify callback in _add_nv_gemm_choices_impl drops them (returns -1).

Resolution

Once the cutlass_api bug is fixed, remove the tile_M >= 128 constraint from _include_efc_kernels_only and the -1 branch from _classify. EFC kernels with smaller tiles (e.g. tile_M=64) would then be available for autotuning, which can be a meaningful win for small-M decode shapes.

Disclosure

Filed by Claude on behalf of @NikhilAPatel.

cc @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @aakhundov @coconutruben @jataylo

extent analysis

TL;DR

Remove the tile_M >= 128 constraint from _include_efc_kernels_only and the -1 branch from _classify once the cutlass_api bug is fixed to enable EFC kernels with smaller tiles.

Guidance

  • Identify the cutlass_api bug fix version to determine when to apply the changes.
  • Remove the tile_M >= 128 constraint from _include_efc_kernels_only to allow EFC kernels with smaller tiles.
  • Update the _classify callback in _add_nv_gemm_choices_impl to remove the -1 branch that drops EFC kernels with tile_M < 128.
  • Verify the changes by testing EFC kernels with smaller tiles (e.g., tile_M=64) and checking for correct results.

Notes

The provided solution assumes that the cutlass_api bug has been fixed. If the bug fix version is not available, the workaround of filtering out EFC kernels with tile_M < 128 should remain in place.

Recommendation

Apply the workaround until the cutlass_api bug is fixed, then remove the constraints to enable EFC kernels with smaller tiles, as this will allow for more efficient autotuning and potentially better performance for small-M decode shapes.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

pytorch - 💡(How to fix) Fix [Inductor][NVGEMM] tile_M<128 EFC kernels broadcast incorrectly [1 participants]