Skip to content

Support exporting MXFP8 values and scales from TE quantized tensors #3644

Open

Description

@sbhavani

Is your feature request related to a problem? Please describe.

RL frameworks frequently synchronize training weights with inference engines. For low-precision inference, this requires exporting quantized values and their associated scales.

There are two common workflows:

  1. Reuse existing quantized weights. When training already stores compatible, MXFP8 params, export their values and scales directly.
  2. Quantize weights for inference. When training stores BF16 parameters or inference needs different quantization, quantize the exported weights, then extract the resulting values and scales.

Both workflows need access to TE’s quantized tensor components. Today, downstream frameworks handle storage details such as padding, scale layouts, and byte interpretation themselves.

For example, NVIDIA-NeMo/RL#3908 extracts native MXFP8 storage through TE metadata, while Miles accesses internal buffers after TE quantization.

Describe the solution you'd like

Provide a supported way to export a TE quantized tensor’s values, scales, and the metadata needed to interpret them outside TE, initially for MXFP8.

This should support both existing quantized training parameters and newly quantized tensors. The goal is to let downstream integrations consume these components without depending on TE’s internal storage conventions.

Where compatible quantized storage already exists, export should preserve that representation without unnecessary dequantization and requantization. Copying, layout conversion, and storage lifetime behavior should be clear to callers.

Model-level conversion and distributed mappings would remain in tools such as Megatron Bridge. Synchronization, transport, and inference-specific loading would remain in downstream RL frameworks.

Describe alternatives you've considered

  • Read TE metadata or internal buffers downstream. This works today but requires each integration to understand and maintain TE-specific extraction logic.
  • Always convert to BF16 and requantize. This adds unnecessary work when compatible quantized storage already exists.

Additional context

Examples of relevant work:

Activity

  1. bhargavchintam commented on Oct 31, 2026

    @bhargavchintam

    Hi, first contribution here. If nobody has started on this yet, I'd like to take it.

    NeMo RL #3908, Megatron-Bridge #5917 and the Miles helper all view _rowwise_data as float8_e4m3fn and cut the padded _rowwise_scale_inv down to [*shape[:-1], K/32] by hand. I'd make that the supported output, as views where possible, copying only to drop padded scale columns or unswizzle optimize_for_gemm scales. If that's the wrong output, please say so. My first step is a test in test_quantized_tensor.py that checks those bytes against dequantize().

    I'm starting with a method on MXFP8TensorStorage. Would you rather have one standalone function that can also quantize a BF16 weight first, so both workflows share one call?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions