TensorRT-LLM icon indicating copy to clipboard operation
TensorRT-LLM copied to clipboard

[Bug]: Qwen3-30B-A3B NVFP4 HF export fails to load in TRT-LLM on DGX Spark/GB10 (weight_scale mismatch)

Open DrHepa opened this issue 7 months ago • 0 comments

System Info

  • CPU architecture: aarch64
  • Host memory: 121 GiB RAM
  • GPU properties:
    • GPU name: NVIDIA GB10 (DGX Spark)
    • GPU memory: UMA / not reported by nvidia-smi --query-gpu=memory.total on this host
  • Libraries / containers tested:
    • Export line:
      • TensorRT-LLM container: nvcr.io/nvidia/tensorrt-llm/release:1.2.0
      • TensorRT-LLM: 1.2.0
      • nvidia-modelopt: 0.37.0
      • transformers during export/smoke overlay: 4.51.0
      • torch: 2.10.0a0+b4e4ee81d3.nv25.12
    • Runtime candidates tested against the SAME exported checkpoint:
      • nvcr.io/nvidia/tensorrt-llm/release:1.3.0rc10 (tensorrt_llm 1.3.0rc10, repo digest sha256:fd68e7500952100df58bb3682c4ea69b6e6723dc4d13dfc911a1bdee80ac389a)
      • nvcr.io/nvidia/tensorrt-llm/release:1.3.0rc9 (tensorrt_llm 1.3.0rc9, repo digest sha256:6c3c31a599a0fe744aa626abc49a49f6f7b642676e8162404f25bf1fef1f0e6d)
    • Model: Qwen/Qwen3-30B-A3B-Instruct-2507
  • NVIDIA driver version: 580.142
  • OS: Linux

Who can help?

@Tracin @Fridah-nv

Information

  • [x] The official example scripts
  • [x] My own modified scripts

Tasks

  • [ ] An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • [x] My own task or dataset (give details below)

Reproduction

We can reproduce this with a Qwen3 MoE NVFP4 HF export on DGX Spark / GB10.

  1. Export the model to HF NVFP4 with ModelOpt 0.37.0. We used the TensorRT-LLM 1.2.0 container with a controlled overlay transformers==4.51.0 because nvidia-modelopt[hf] declares transformers<4.57.

  2. Reuse the exported checkpoint (same export for every runtime candidate):

    • config.json
    • hf_quant_config.json
    • model.safetensors.index.json
    • model-00001-of-00004.safetensors ... model-00004-of-00004.safetensors
  3. Try to load it with TRT-LLM PyTorch runtime. Minimal probe used in 1.3.0rc10 / 1.3.0rc9:

from tensorrt_llm import LLM
from tensorrt_llm.sampling_params import SamplingParams

llm = LLM(
    model="/workspace/model_export",
)
outputs = llm.generate(["Hola"], SamplingParams(max_tokens=8))
print(outputs[0].outputs[0].text)
  1. We also tested with:
export TRTLLM_MOE_BACKEND=TRITON

Observed errors:

  • In 1.2.0 builtin runtime:
Error executing load_single_module with args (model.layers.0.self_attn.qkv_proj, ...)
RuntimeError: The size of tensor a (655360) must match the size of tensor b (327680) at non-singleton dimension 0
  • In 1.3.0rc9 and 1.3.0rc10 runtime direct TRT-LLM:
model.layers.0.self_attn.o_proj
RuntimeError: The size of tensor a (524288) must match the size of tensor b (262144) at non-singleton dimension 0

Additional context from our exported checkpoint:

  • config.json reports Qwen3MoeForCausalLM
  • max_position_embeddings = 262144
  • Export status is complete; the checkpoint is physically materialized and surface HF checks (AutoConfig + AutoTokenizer) pass.
  • We are NOT using dense HF AutoModelForCausalLM.from_pretrained(...) as a success gate anymore, because it gives false negatives on this packaged NVFP4 export format.

Expected behavior

A HF NVFP4 export of Qwen/Qwen3-30B-A3B-Instruct-2507 produced with ModelOpt 0.37.0 should be loadable by a recent TRT-LLM PyTorch runtime on DGX Spark / GB10, at least for a minimal runtime initialization and short generation smoke test.

actual behavior

The export is created successfully, but TRT-LLM runtime fails to load it consistently.

  • 1.2.0 fails while loading self_attn.qkv_proj
  • 1.3.0rc9 and 1.3.0rc10 both fail while loading self_attn.o_proj
  • TRTLLM_MOE_BACKEND=TRITON does not help, which suggests the failure happens before MoE dispatch becomes relevant.

additional notes

  • I searched existing issues and found related NVFP4 scale/export work, especially:
    • #11988
    • PR #11991
    • issue #9503 (different NVFP4 managed-weights failure) but I did not find an issue that matches this exact runtime load pattern for a HF ModelOpt NVFP4 export of Qwen3 MoE on DGX Spark / GB10.
  • The mismatch is consistent across multiple TRT-LLM runtime versions, which makes this look more like a runtime/export contract problem than a one-off container regression.
  • We now treat the export as export_completed_runtime_validation_blocked in our lab state because the exported package exists but TRT-LLM runtime cannot load it yet.
  • If useful, I can provide the exact phase_summary.json, validation_summary.json, and runtime probe logs from these runs.

Before submitting a new issue...

  • [x] Make sure you already searched for relevant issues, and checked the documentation and examples for answers to frequently asked questions.

DrHepa avatar Apr 04 '26 10:04 DrHepa