Skip to content

[Common] Reduce default cfg's SMEM usage for mhc triton kernel - #3442

Open
kainzhong wants to merge 1 commit into
mainfrom
fix_triton_smem_oom
Open

[Common] Reduce default cfg's SMEM usage for mhc triton kernel#3442
kainzhong wants to merge 1 commit into
mainfrom
fix_triton_smem_oom

Conversation

@kainzhong

Copy link
Copy Markdown
Collaborator

Description

Somehow with triton 3.8 it allocates more SMEM for my triton kernels than previous triton 3.6, which causes the mhc tests to fail due to OOM. Add stage=2 to reduce the default config's SMEM usage and let the CI pass for now

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

Please list the changes introduced in this PR:

  • Make the mhc proj kernel's default config (the first one) use a smaller stage number to reduce SMEM usage

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Signed-off-by: Kaining Zhong <kainingz@nvidia.com>
@greptile-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR reduces shared-memory usage in the MHC Triton projection kernel by adding a two-stage configuration.

  • Makes num_stages=2 the first configuration used when Triton autotuning is disabled.
  • Adds the two-stage option to the candidates considered when autotuning is enabled.

Confidence Score: 5/5

The PR appears safe to merge, with the lower-stage configuration covered by the existing MHC correctness-test path.

The change only adjusts the Triton pipeline-depth candidates, and the forced default configuration is exercised across representative MHC projection shapes and data types without violating any identified kernel constraint.

Important Files Changed

Filename Overview
transformer_engine/common/triton/mhc.py Expands the forward projection kernel’s stage candidates from [3, 4] to [2, 3, 4]; no actionable correctness issue was identified.

Reviews (1): Last reviewed commit: "[Common] Reduce default cfg's SMEM usage..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant