Skip to content

[Common] Fix Grouped MXFP8 tensor-map validation and synchronization - #3483

Open
Oleg-Goncharov wants to merge 9 commits into
NVIDIA:mainfrom
Oleg-Goncharov:pr_fixed_tensormap_update_protocol
Open

[Common] Fix Grouped MXFP8 tensor-map validation and synchronization#3483
Oleg-Goncharov wants to merge 9 commits into
NVIDIA:mainfrom
Oleg-Goncharov:pr_fixed_tensormap_update_protocol

Conversation

@Oleg-Goncharov

Copy link
Copy Markdown
Collaborator

Description

This PR fixes two correctness issues in the Grouped MXFP8 quantization kernels introduced by the optimized work mapper.

First, the direct VARYING_FIRST_DIM path assumed that every tensor's first dimension was aligned to the 128-row kernel tile, but only the combined logical dimension was validated. This could allow a CTA to cross an expert boundary and use incorrect per-expert metadata.

Second, device-modified TMA descriptors were copied from shared to global memory without the release/acquire protocol required by the TMA memory model. The descriptor updater now follows the recommended warp-collective publication sequence.

Addresses #3474

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:

  • Restore validation that every VARYING_FIRST_DIM tensor has a first dimension divisible by the 128-row kernel tile.
  • Align shared-memory CUtensorMap storage to 128 bytes.
  • Publish modified TMA descriptors with a warp-collective tensormap.cp_fenceproxy operation using GPU-scope release semantics.
  • Use the matching GPU-scope acquire fence before consuming descriptors from another CTA.
  • Launch the descriptor updater with a full warp and update the grouped quantize and dequantize paths accordingly.

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

@greptile-apps

greptile-apps Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR fixes Grouped MXFP8 tensor-map validation and safely publishes device-modified TMA descriptors across CTAs.

  • Restores per-tensor row-alignment validation for the direct varying-first-dimension mapper.
  • Uses aligned shared descriptor storage with warp-collective GPU-scope release and matching acquire semantics.
  • Launches descriptor updaters with a full warp and updates dynamic shared-memory alignment call sites.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the descriptor updater now launches a complete warp, reaches the warp-collective publication instruction convergently, and pairs GPU-scope release and acquire operations across updater and consumer CTAs.

Important Files Changed

Filename Overview
transformer_engine/common/cast/core/grouped_tma.cuh Implements aligned, warp-collective tensor-map publication and a matching GPU-scope acquire; the previously reported publication issue is fixed.
transformer_engine/common/cast/mxfp8/group_quantize_mxfp8.cuh Restores per-tensor direct-mapper validation and launches the descriptor updater with the required full warp.
transformer_engine/common/cast/mxfp8/group_dequantize_mxfp8.cuh Makes the updater body warp-convergent and preserves a full-warp launch for tensor-map publication.
transformer_engine/common/cast/fp8_blockwise/group_quantize_fp8_blockwise.cuh Replaces the removed shared-memory alignment helper with the common aligned-pointer utility.
transformer_engine/common/cast/mxfp8/group_scaled_swiglu_mxfp8.cuh Migrates dynamic shared-memory alignment to the common utility without changing the buffer layout.
transformer_engine/common/cast/nvfp4/specialized/quantize_transpose_nvfp4_tuned_1D.cuh Migrates dynamic shared-memory alignment to the common utility without changing kernel behavior.

Reviews (3): Last reviewed commit: "[pre-commit.ci] auto fixes from pre-comm..." | Re-trigger Greptile

Oleg-Goncharov and others added 3 commits September 4, 2026 19:40
Signed-off-by: Oleg Goncharov <ogoncharov@nvidia.com>
Signed-off-by: Oleg Goncharov <ogoncharov@nvidia.com>
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