[Bug]: Gemma4 HF NVFP4 export cannot be loaded by TRT-LLM builtin runtime on DGX Spark/GB10 (tokenizer/runtime skew)
System Info
- CPU architecture: aarch64
- Host memory: 121 GiB RAM
- GPU: NVIDIA GB10 (DGX Spark)
- Driver: 580.142
- OS: Linux
Export line:
- Container:
nvcr.io/nvidia/tensorrt-llm/release:1.2.0 - Container digest:
sha256:4c120954694e33e9d1bd206b422728f53e65df0d1e9718656de33a995a09c457 tensorrt_llm:1.2.0nvidia-modelopt:0.37.0- Export overlay for HF/model side:
transformers==5.5.0 - Model:
google/gemma-4-31b-it - Export type: HF
NVFP4
Runtime line under test:
- Same TRT-LLM builtin container/runtime (
1.2.0) - Builtin
transformers:4.57.3
Who can help?
@Tracin @Fridah-nv
Information
- [x] The official example scripts
- [x] My own modified scripts
Tasks
- [ ] An officially supported task in the
examplesfolder (such as GLUE/SQuAD, ...) - [x] My own task or dataset (give details below)
Reproduction
We can reproduce this on DGX Spark / GB10 with a Gemma4 multimodal HF NVFP4 export.
-
Produce an HF NVFP4 export of
google/gemma-4-31b-itusing ModelOpt 0.37.0.- In our case, the export itself required a local backport for the
_amaxexport issue to complete. - Final export run reference:
experiments/gemma-4-31b-it/quantization/20260404T222137Z/
- In our case, the export itself required a local backport for the
-
The exported package contains at least:
config.jsonhf_quant_config.jsontokenizer.jsontokenizer_config.json- weight file(s)
-
Validate with the builtin TRT-LLM runtime path used by ModelOpt examples:
examples/llm_ptq/run_tensorrt_llm.py- which internally calls
AutoTokenizer.from_pretrained(...)
Observed failures:
Failure A — original exported tokenizer config with builtin runtime
Builtin TRT-LLM runtime fails immediately in the Gemma tokenizer path:
AttributeError: list object has no attribute keys
Stack points to:
transformers/models/gemma/tokenization_gemma_fast.pytransformers/tokenization_utils_base.py
Relevant detail from exported tokenizer_config.json:
extra_special_tokensis serialized as a list
Failure B — sanitized tokenizer config (diagnostic only)
We created a non-destructive sanitized copy only for diagnosis, normalizing extra_special_tokens from list to mapping.
This gets us past Failure A, but builtin runtime then fails later with:
ValueError: The checkpoint you are trying to load has model type `gemma4` but Transformers does not recognize this architecture.
Failure C — force transformers==5.5.0 inside same container/runtime
If we force transformers==5.5.0 inside the builtin TRT-LLM container, TRT-LLM itself breaks on import:
ImportError: cannot import name AutoModelForVision2Seq from transformers
So the situation is:
- export side needs a newer Transformers surface for Gemma4
- builtin TRT-LLM runtime stays on an older/incompatible one
- forcing the newer one breaks TRT-LLM imports
Expected behavior
A completed HF NVFP4 export of google/gemma-4-31b-it should be loadable by the builtin TRT-LLM runtime path used by the ModelOpt validation flow, at least for tokenizer initialization and minimal runtime setup.
actual behavior
The export completes, but builtin TRT-LLM runtime cannot consume it:
- original tokenizer config fails with
extra_special_tokenslist handling - sanitized config gets farther but then fails because
gemma4is not recognized by the builtin Transformers surface - upgrading builtin Transformers to match export semantics breaks TRT-LLM imports (
AutoModelForVision2Seq)
additional notes
- This is a different issue from our already-opened TRT-LLM runtime bug for Qwen3 NVFP4:
NVIDIA/TensorRT-LLM#12762
- For Gemma4, the export itself is now real and complete; the blocker is runtime/tokenizer compatibility.
- Validation evidence lives in:
validation_summary.jsonbuiltin_trtllm.stderr.logbuiltin_trtllm_sanitized.stderr.logbuiltin_trtllm_transformers_5_5_0.stderr.log
- I searched for duplicates around Gemma4/tokenizer/extra_special_tokens/model_type in TRT-LLM and did not find a matching open bug.
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.
Could we download this nvfp4 version https://huggingface.co/nvidia/Gemma-4-31B-IT-NVFP4 directly?
Gemma 4 support is coming?
Gemma 4
Gemma 4 can be found in Supported Models table, but only via the AutoDeploy, and text-only :)
Gemma 4 is now supported on the latest main.