Skip to content

HipKittens MXFP8 GEMM Support#566

Merged
alextmagro merged 40 commits into
devfrom
hipkittens_mxfp8
Jun 25, 2026
Merged

HipKittens MXFP8 GEMM Support#566
alextmagro merged 40 commits into
devfrom
hipkittens_mxfp8

Conversation

@alextmagro

@alextmagro alextmagro commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Creates an MXFP8 GEMM with HipKittens that outperforms hipBLASlt, and offers additional epilogues such as BIAS and GELU AUX

Requires a workspace sized relative to the model. Often larger than hipBLASlt, but with significant performance improvements. Only builds for gfx950, and requires M / 256 and N / 256.

Adds hipKittens header library as a submodule.

Comment thread tests/cpp/operator/test_cublaslt_gemm.cu Outdated
Comment thread tests/cpp/operator/test_cublaslt_gemm.cu Outdated
Comment thread tests/cpp/operator/test_cublaslt_gemm.cu Outdated
Comment thread tests/cpp/operator/test_cublaslt_gemm.cu
Comment thread tests/jax/utils.py
Comment thread tests/cpp/operator/test_cublaslt_gemm.cu Outdated
Comment thread transformer_engine/common/gemm/kittens/mxfp8_gemm.hip Outdated
Comment thread transformer_engine/common/gemm/kittens/mxfp8_gemm.cpp
Comment thread transformer_engine/pytorch/cpp_extensions/gemm.py Outdated
Comment thread transformer_engine/pytorch/cpp_extensions/gemm.py
@alextmagro
alextmagro requested a review from wangye805 May 5, 2026 20:26
Comment thread transformer_engine/common/gemm/kittens/mxfp8_gemm.cpp
Comment thread transformer_engine/common/gemm/kittens/mxfp8_gemm.cpp
Comment thread transformer_engine/common/gemm/kittens/mxfp8_gemm.cpp
Comment thread transformer_engine/common/gemm/kittens/mxfp8_gemm.cpp
Comment thread tests/cpp/operator/test_cublaslt_gemm.cu Outdated
Comment thread tests/cpp/operator/test_cublaslt_gemm.cu
Comment thread tests/cpp/operator/test_cublaslt_gemm.cu Outdated
Comment thread tests/cpp/operator/test_cublaslt_gemm.cu Outdated
Comment thread tests/cpp/operator/test_cublaslt_gemm.cu Outdated
Comment thread transformer_engine/common/gemm/kittens/mxfp8_gemm.h
Comment thread transformer_engine/common/gemm/kittens/mxfp8_gemm.cpp
Comment thread transformer_engine/common/CMakeLists.txt Outdated
Comment thread transformer_engine/pytorch/cpp_extensions/gemm.py Outdated
@alextmagro
alextmagro requested review from aris134 and ipanfilo May 12, 2026 13:24
Comment thread tests/cpp/operator/test_cublaslt_gemm.cu Outdated
@alextmagro
alextmagro requested a review from ipanfilo May 29, 2026 19:34
Comment thread transformer_engine/common/gemm/kittens/mxfp8_gemm.cpp
@alextmagro
alextmagro requested a review from ipanfilo June 17, 2026 21:09
Comment thread transformer_engine/common/gemm/kittens/mxfp8_gemm.cpp
Comment thread transformer_engine/pytorch/cpp_extensions/gemm.py
Comment thread transformer_engine/jax/cpp_extensions/gemm.py
@alextmagro
alextmagro requested a review from ipanfilo June 18, 2026 22:47

@ipanfilo ipanfilo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Some comments in rocm_gemm and test_cublas_gemm are still open

@alextmagro
alextmagro requested a review from ipanfilo June 22, 2026 21:38

@ipanfilo ipanfilo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The remaining open question is WS size calculation for JAX

n = reduce(operator.mul, rhs_non_contracting_shape)
k = lhs_contracting_size
layout = ("T" if lhs_is_transposed else "N") + ("T" if rhs_is_transposed else "N")
workspace_size = max(workspace_size,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Original MXFP8 workspace_size here consist of hipblasLt requirements + optional pre-swizzling WS on gfx1250, why are they honored in hipKittens case?
Is pre-swizzling applied when hipKittens is enabled (ignoring the fact that they are for different archs)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hipKittens does not use pre-swizzling, this issue was introduced during a dev merge, should be fixed now.

Comment thread transformer_engine/pytorch/cpp_extensions/gemm.py Outdated
@alextmagro
alextmagro requested a review from ipanfilo June 23, 2026 15:07
@alextmagro
alextmagro merged commit 6dd7bcb into dev Jun 25, 2026
1 check passed
@alextmagro
alextmagro deleted the hipkittens_mxfp8 branch June 25, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-level 3 CI test level 3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants