Skip to content

Add FP8×INT4 rowwise GEMM for ROCm (f8i4bf16_rowwise) - #502

Open
q10 wants to merge 1 commit into
meta-pytorch:mainfrom
q10:export-D116965755
Open

Add FP8×INT4 rowwise GEMM for ROCm (f8i4bf16_rowwise)#502
q10 wants to merge 1 commit into
meta-pytorch:mainfrom
q10:export-D116965755

Conversation

@q10

@q10 q10 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary:
NOTE: No linked task. Please associate a task with this diff.

Adds a ROCm Triton implementation of mslk::f8i4bf16_rowwise for FP8 activations and packed INT4 weights while reusing the existing BF16×INT4 kernel.

  • Defines the operator schema on both CUDA and ROCm so the HIP Python implementation can register reliably.
  • Specializes the shared kernel with HAS_X_SCALE, two BF16 dot operations for FP8-backed inputs, and fused per-row activation scaling.
  • Adds FP8-specific autotune candidates and pruning while preserving the prior BF16 tuning space.
  • Validates tensor shapes, dtypes, devices, grouping invariants, and contiguous scale layouts.
  • Avoids allocating unused split-K workspace for large-M shapes.
  • Registers the ROCm benchmark implementation and adds a ROCm correctness/dispatch regression test.

Upstream PR: #495

Reviewed By: jwfromm

Differential Revision: D116965755

Summary:
NOTE: No linked task. Please associate a task with this diff.

Adds a ROCm Triton implementation of `mslk::f8i4bf16_rowwise` for FP8 activations and packed INT4 weights while reusing the existing BF16×INT4 kernel.

- Defines the operator schema on both CUDA and ROCm so the HIP Python implementation can register reliably.
- Specializes the shared kernel with `HAS_X_SCALE`, two BF16 dot operations for FP8-backed inputs, and fused per-row activation scaling.
- Adds FP8-specific autotune candidates and pruning while preserving the prior BF16 tuning space.
- Validates tensor shapes, dtypes, devices, grouping invariants, and contiguous scale layouts.
- Avoids allocating unused split-K workspace for large-M shapes.
- Registers the ROCm benchmark implementation and adds a ROCm correctness/dispatch regression test.

Upstream PR: meta-pytorch#495

Reviewed By: jwfromm

Differential Revision: D116965755
@meta-codesync

meta-codesync Bot commented Aug 24, 2026

Copy link
Copy Markdown

@q10 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D116965755.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant