Skip to content

[ROCm] Refine from_recipe_name to support mxfp8 on rocm.#3620

Merged
vkuzo merged 2 commits intopytorch:mainfrom
RuibinCheung:rocm/support_mxfp8
Jan 15, 2026
Merged

[ROCm] Refine from_recipe_name to support mxfp8 on rocm.#3620
vkuzo merged 2 commits intopytorch:mainfrom
RuibinCheung:rocm/support_mxfp8

Conversation

@RuibinCheung
Copy link
Contributor

Summary

Support mxfp8 on gfx950 by refine MXLinearConfig.from_recipe_name

It will encounter error when called triton's quantize kernel with rceil on rocm because PTX instructions was called in kernel. So we chose implementation of torch.compile to workaround.

TODO

  • Implement quantize kernel with rceil mode in triton.

@pytorch-bot
Copy link

pytorch-bot bot commented Jan 12, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/3620

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 60a5e32 with merge base 4b3ebc4 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 12, 2026
return MXLinearConfig(
kernel_preference=KernelPreference.AUTO,
mxfp8_cast_kernel_choice=MXFP8Dim1CastKernelChoice.CUDA,
mxfp8_cast_kernel_choice=MXFP8Dim1CastKernelChoice.TRITON
Copy link
Contributor

Choose a reason for hiding this comment

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

style nit: can we rewrite as below to improve readability

# add a descriptive comment here
mxfp8_cast_kernel_choice = MXFP8Dim1CastKernelChoice.TRITON is if_ROCM() else MXFP8Dim1CastKernelChoice.CUDA

return MXLinearConfig(..., mxfp8_cast_kernel_choice)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ACK. Thanks.

@vkuzo
Copy link
Contributor

vkuzo commented Jan 12, 2026

lgtm, could we update the style per my comment

@RuibinCheung
Copy link
Contributor Author

RuibinCheung commented Jan 13, 2026

lgtm, could we update the style per my comment

Thanks for your suggestion. But the ruff-format will modify the code if I follow your style. I can't find a method to disable ruff-format in a line.

Do you have any further suggestions?

@RuibinCheung RuibinCheung requested a review from vkuzo January 13, 2026 02:29
@vkuzo vkuzo added the topic: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories) label Jan 13, 2026
@RuibinCheung
Copy link
Contributor Author

Hi @vkuzo, I saw my PR was blocked by Dr.CI. Could you help me trigger it ?

@vkuzo vkuzo merged commit f222b9e into pytorch:main Jan 15, 2026
21 of 22 checks passed
@RuibinCheung RuibinCheung deleted the rocm/support_mxfp8 branch January 16, 2026 02:17
tianyu-l pushed a commit to pytorch/torchtitan that referenced this pull request Jan 20, 2026
* Support mxfp8 on gfx950.

It depends on TorchAO (pytorch/ao#3620).
jcaip pushed a commit that referenced this pull request Jan 22, 2026
* [ROCm] Refine from_recipe_name to support mxfp8 on rocm.

* resolve reviewer issue
wwwjn pushed a commit to wwwjn/torchtitan that referenced this pull request Jan 30, 2026
* Support mxfp8 on gfx950.

It depends on TorchAO (pytorch/ao#3620).
xrsrke pushed a commit to NousResearch/torchtitan that referenced this pull request Feb 13, 2026
* Support mxfp8 on gfx950.

It depends on TorchAO (pytorch/ao#3620).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. device: rocm topic: improvement Use this tag if this PR is an improvement (doesn't fit into any of the other categories)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants