Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions unsloth/kernels/moe/grouped_gemm/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@

# Precompute TMA support to avoid graph breaks
# TMA requires both:
# 1. GPU capability >= 9 (Hopper+)
# 1. NVIDIA GPU with capability >= 9 (Hopper+)
# 2. Triton version with TMA API (make_tensor_descriptor or _experimental_make_tensor_descriptor)
def _check_tma_support():
if DEVICE_TYPE == "xpu":
if DEVICE_TYPE in ("xpu", "hip"):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While adding "hip" to the check correctly fixes the bug for AMD GPUs, a more robust and future-proof approach would be to explicitly check for "cuda" devices, since TMA is an NVIDIA-specific feature. This prevents similar issues if support for other hardware is added in the future.

Suggested change
if DEVICE_TYPE in ("xpu", "hip"):
if DEVICE_TYPE != "cuda":

return False
import triton.language as tl

Expand Down