Skip to content

Is there a supported FP8 storage dtype on TRN2? F8E4M3FN is rejected even when never used as an operand #1393

Description

@dadmobile

Describe the bug

Our checkpoint ships natively in FP8 with 128x128 blockwise scales. We keep the
expert weights in torch.float8_e4m3fn purely as storage and dequantise them to
BF16 inside forward, so the hardware never sees an e4m3 operand. The compiler
rejects the tensor regardless:

[ERROR] [NCC_EVRF051] Data type F8E4M3FN is not supported on TRN1/TRN2.
Target TRN3 or later hardware

For a 313B-parameter MoE this is the difference between 19.03 GB and 9.51 GB of
expert weight per rank, which in turn decides how much context and batch fit.

What we are missing is what to do instead:

  1. Is there an FP8 storage dtype that is accepted in a graph on TRN2?
  2. If not, is uint8 storage plus a 256-entry lookup table the intended pattern?
    That is exact, since e4m3 has exactly 256 values, but it materialises BF16 on the
    read, so it saves resident HBM rather than bandwidth.
  3. torch._scaled_mm does compile on TRN2 and NeuronCore-v3 does e4m3 arithmetic.
    Is a true FP8 GEMM the only supported route to FP8 weights on this hardware?

Model Name

GLM-5.3-Flash (glm5_next), 313B parameters, 288 routed experts, FP8 checkpoint
with 128x128 blockwise scales.

Describe the workload type

Inference. Tensor parallel 32, expert parallel 32. The FP8 tensors are expert
weights only, held as storage and dequantised per layer inside forward.

Instance Type

trn2.48xlarge, logical-neuroncore-config: 2

Release version

neuronx-cc                2.27.5334.0+f702b353
aws-neuronx-runtime-lib   2.34.10.0-ac18d186d
aws-neuronx-dkms          2.30.2.0
torch                     2.11.0
torch-xla                 2.11.0

Reproduction Steps

Any graph containing an f8e4m3fn tensor reproduces it. Minimally:

import torch, torch_xla.core.xla_model as xm
dev = xm.xla_device()
w8 = torch.zeros(256, 256, dtype=torch.float8_e4m3fn, device=dev)
scale = torch.ones(2, 2, device=dev)
# dequantise before any arithmetic: the FP8 value is never an operand to a matmul
w = (w8.to(torch.float32) * scale.repeat_interleave(128, 0).repeat_interleave(128, 1))
x = torch.randn(8, 256, device=dev)
y = x @ w.to(torch.bfloat16).t()
xm.mark_step()
print(y.sum().cpu())

Expected: compiles, since no e4m3 operand ever reaches the hardware.
Actual: NCC_EVRF051.

Regression Issue

  • Select this option if this issue appears to be a regression.

Possible Solution

If f8e4m3fn cannot be permitted as an inert storage dtype, documenting the intended
alternative would be enough. "The checkpoint is FP8, so keep it FP8" is the obvious
first thing to try with any recent MoE checkpoint, and there is currently nothing
pointing to the supported path.

Logs/Context/Additional Information

We fell back to BF16 storage at 19.59 GB/rank, which does fit on one trn2.48xlarge,
so this is not blocking us. It cost us the headroom we had planned to spend on
longer context and larger batches.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions