Skip to content

trimul-gpumode: fix kernel_global on H100 - #1374

Closed
jaygala223 wants to merge 1 commit into
huggingface:mainfrom
jaygala223:trimul-fix-kernel-global
Closed

jaygala223 wants to merge 1 commit into
huggingface:mainfrom
jaygala223:trimul-fix-kernel-global

Conversation

@jaygala223

Copy link
Copy Markdown

Related issue

Closes #1256

What does this PR do?

Fixes kernel_global in trimul-gpumode, which crashes on every GPU that isn't capability 8.x.

Motivation

On H100, kernel_global (which is also what benchmarks/benchmark.py calls) fails with:

TypeError: two_mm_kernel_configs_wrapper.<locals>.two_mm_kernel_configs() takes 0 positional arguments but 3 were given

@iemAnshuman found this in #1256 and suggested the fix. They didn't have an H100 to check it on, and I do.

Changes

  • capability 9: two_mm_kernel_configs_wrapper now returns get_optimal_two_mm_config_h100, which is what two_mm calls with (B, seq_len, K)
  • capability 10: removed the B200 branch in two_mm. Its config table was already disabled with and False, so B200 now autotunes like the other GPUs
  • tl._experimental_make_tensor_descriptor -> tl.make_tensor_descriptor (the old name was removed in Triton 3.4)

I didn't touch ROCm. The issue also mentions that MI100 reports capability 9 and takes the H100 path; I can look at that in a follow-up.

Testing

On an H100 NVL, with torch 2.15.0 + Triton 3.9.0 and again with torch 2.13.0 + Triton 3.7.1:

  • the published v1 kernel_global fails with the TypeError above
  • the patched kernel_global matches the reference from benchmarks/benchmark.py (atol/rtol 2e-2) on 8 shapes from (1, 128, 128) to (1, 1024, 1024) with random masks. Max abs diff is 4e-4
  • the capability 8 and 10 paths also match, which I checked by faking the reported capability on the H100. I don't have a B200 or an MI100

There are no tests for this kernel yet, and CI runs on sm89, which only reaches the capability 8 path, so I didn't add one.

Checklist

  • This PR is linked to an issue that was discussed and approved
  • I have tested these changes locally
  • New/changed functionality has test coverage
  • LLM disclosure:
    • I did not use an LLM to create this PR.
    • I used an LLM for assistance while creating this PR.
    • This PR was mostly or completely generated by an LLM.

@sayakpaul @danieldk I'm not on the vouch list for this repo, so the bot will probably close this. Could one of you vouch for me or reopen it? I had huggingface/kernels#675 merged earlier.

@github-actions

Copy link
Copy Markdown

This PR changes source code for the following kernel(s): trimul-gpumode.

If you have the kernel-bot build permissions, then trigger /kernel-bot build trimul-gpumode yourself. Otherwise, a maintainer will review the PR and will take an appropriate action. Thanks for your patience.

@github-actions github-actions Bot added the chore Version bumps, releases, misc maintenance label Nov 26, 2026
@github-actions

Copy link
Copy Markdown

Hi @jaygala223, thanks for your interest in contributing!

This project requires that pull request authors are vouched, and you are not in the list of vouched users.

This PR will be closed automatically. See https://github.com/huggingface/kernels-community/blob/main/CONTRIBUTING.md for more details.

@github-actions github-actions Bot closed this Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Version bumps, releases, misc maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

trimul-gpumode: kernel_global crashes on capability 9/10 and on rocm

1 participant