Skip to content

[Common] Store swizzled MXFP8 rowwise scales directly in the register-resident - #3694

Draft
kainzhong wants to merge 1 commit into
NVIDIA:mainfrom
kainzhong:mxfp8_g2r_rowwise_swizzled_direct_scale_store
Draft

kainzhong wants to merge 1 commit into
NVIDIA:mainfrom
kainzhong:mxfp8_g2r_rowwise_swizzled_direct_scale_store

Conversation

@kainzhong

@kainzhong kainzhong commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

TODO: let me review it

The GEMM-swizzled path of quantize_contiguous_kernel gathered each 16-byte scale run through warp shuffles and shared memory, then flushed it after a CTA barrier. Store each scale byte directly at its swizzled index instead, as the packed path does. Outputs are bit-identical; swizzled bf16 rowwise quantization is ~2.4% faster on average (up to ~5.5%) on GB200.

Description

Please include a brief summary of the changes, relevant motivation and context.

Benchmark: https://claude.ai/artifact/VpCXcAtAvbCe7gfxWBEwLV?sk=XE0XRwAptECOploI4sXZeA

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

Please list the changes introduced in this PR:

  • Change A
  • Change B

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

… cast kernel

The GEMM-swizzled path of quantize_contiguous_kernel gathered each 16-byte
scale run through warp shuffles and shared memory, then flushed it after a
CTA barrier. Store each scale byte directly at its swizzled index instead,
as the packed path does. Outputs are bit-identical; swizzled bf16 rowwise
quantization is ~2.4% faster on average (up to ~5.5%) on GB200.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Kaining Zhong <kainingz@nvidia.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant