Skip to content

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

Open
kainzhong wants to merge 2 commits into
mainfrom
fix_triton_smem_oom
Open

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

Conversation

@kainzhong

@kainzhong kainzhong commented Aug 28, 2026

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 on L40. 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 to its pruned configuration set.

  • Uses num_stages=2 as the first configuration when Triton autotuning is disabled.
  • Makes the lower-shared-memory configuration available during normal autotuning.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
transformer_engine/common/triton/mhc.py Adds a supported two-stage projection configuration, reducing the disabled-autotuning default’s shared-memory demand without changing kernel reduction semantics.

Reviews (2): Last reviewed commit: "Merge branch 'main' into fix_triton_smem..." | Re-trigger Greptile

@ptrendx

ptrendx commented Aug 31, 2026

Copy link
Copy Markdown
Member

/te-ci pytorch

@ptrendx ptrendx added the 2.19 label Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants