This document is relevant for: Trn3
Troubleshooting: TorchAO Neuron#
Overview#
This topic covers common failure modes when training with the TorchAO Neuron fused MXFP8 linear, on its own or through TorchTitan Neuron. Use it when an MXFP8 run fails to start, fails on a kernel option, or behaves differently from the bf16 baseline. Scope is MXFP8-specific. For TorchTitan run failures see Troubleshooting: TorchTitan Neuron; for lower-level TorchNeuron issues see Troubleshooting: TorchNeuron.
Common symptoms and solutions#
Symptom:
ValueError: cannot shard <name> of local shape <shape> by <degree> and keep every local dim a multiple of 32during model setup with pre-quantized weights. A related message names the dimension that sharding cannot rescue:... can be sharded on dim <d>, but dim <other> is <N>, which is not a multiple of 32 and is not divided by sharding.Possible causes:
The pre-quantized path reads each weight twice, once as stored and once transposed, so both dimensions of every rank’s local shard must be a multiple of 32. SimpleFSDP already chooses each weight’s shard dimension to satisfy this, preferring the dimension tensor parallelism did not split, so this error means no dimension can satisfy it at the current parallelism: the sharded dimension must be divisible by the FSDP degree times 32, and the dimension left unsharded must be a multiple of 32 on its own. See 1D dynamic FSDP.
Solutions:
Lower the FSDP shard degree, for example by raising the tensor-parallel degree, so a dimension divides evenly.
Run the recipe without
prequantize_weights. See Tutorial: Train Qwen3 in MXFP8 on Neuron.
Symptom:
Python lower_func failed for cache_key: ... Kernel validation exception: K must be divisible by 32 for unswizzled loading. The required multiple is either 32 or 128, so the message may name either value.Possible causes:
The contraction dimension of a matmul is not a multiple of the alignment the NKI kernel requires when it loads an operand unswizzled, that is, in its original layout rather than pre-arranged into the layout the matmul expects. The required multiple is 32 with the
1x32quantization layout or a fast DMA transpose, and 128 otherwise. Operands that are already swizzled are not subject to the check.
Solutions:
Skip quantizing particular linear layers that do not fit the MXFP8 shape constraints. See Tutorial: Train Qwen3 in MXFP8 on Neuron for details on how to filter specific layers from the
MXFP8LinearConverterin TorchTitan Neuron.
Symptom: The training step time does not improve with MXFP8 quantization.
Possible causes:
Untuned kernels. The default MXFP8 kernel configurations may not suit your shapes.
The step is not matmul-bound. MXFP8 accelerates only the linear and blockwise MoE matmuls. Core attention, the loss function, LayerNorm, RoPE and exposed collectives do not get faster, so a step dominated by those shows little gain. A low BF16 MFU is the signal. MXFP8
grouped_mmis not yet supported on TorchAO Neuron.If matmuls are a fraction
pof the BF16 step time and MXFP8 speeds them up bys, the step speeds up by1 / ((1 - p) + p / s).
Solutions:
Tune the MXFP8 NKI kernels using Tutorial: Auto-tune MXFP8 kernel configs for TorchTitan Neuron training.
Profile the step with Capture PyTorch profiles with Neuron Explorer to find what dominates it, and address those bottlenecks first. See Troubleshooting: TorchTitan Neuron.
Symptom:
ValueError: disable_dma_transpose=True is 1x32 only; wrapX always uses the fast DMA transpose.Possible causes:
NkiKernelOptions(disable_dma_transpose=True)combined withquant_scheme=QuantScheme.WRAPX.
Solutions:
Use
quant_scheme=QuantScheme.ONE_X32withdisable_dma_transpose, or dropdisable_dma_transposeforwrapX.
Symptom:
ValueError: logical_layout=True is 1x32 only.Possible causes:
NkiKernelOptions(logical_layout=True)combined withquant_scheme=QuantScheme.WRAPX.
Solutions:
logical_layoutapplies to the pre-quantized weight path with the1x32scheme only. Switch the scheme or drop the option.