vLLM crashes initialising an NVFP4 model because the emulation lookup table stays on the CPU
When no hardware NVFP4 backend is available, vLLM falls back to an emulation path that unpacks four-bit values through a small constant lookup table. The table is indexed by a tensor that lives on the GPU while the table itself was built on the CPU, so engine initialisation fails before a single token is generated.
Read the startup line naming the selected NvFp4 backend. If it says EMULATION, the accelerated backends were excluded, usually by batch-invariant mode, and restoring one avoids the broken fallback entirely.
- Symptom
[nvfp4.py:283] Using 'EMULATION' NvFp4 MoE backend out of potential backends: ['FLASHINFER_TRTLLM', 'FLASHINFER_CUTEDSL', 'FLASHINFER_CUTLASS', 'VLLM_CUTLASS', 'MARLIN', 'EMULATION'].- Root cause
- PyTorch requires the index tensor and the tensor being indexed to live on one device, or the index to be on the CPU. The emulation helper builds its constant table as a plain tensor, which lands on the CPU, and then indexes it with values that have already been moved to the accelerator, so the pair straddles the boundary the rule forbids. The path is only reached when backend selection has exhausted every accelerated option.
- Recommended fix
- Check which backend was chosen. The log states the selected NvFp4 backend and lists the alternatives, and emulation appearing there is the signal that no accelerated path was available.
- How Denpex helps
- Denpex investigates vLLM crashes initialising an NVFP4 model because the emulation lookup table stays on the CPU using the evidence you provide or your connected workload collects. Earlier rank, host or application evidence is needed to distinguish an initiating failure from a downstream report.
What this failure is
An initialisation-time crash in vLLM's software NVFP4 fallback, where a constant unpacking table allocated on the CPU is indexed by accelerator-resident values, violating PyTorch's requirement that both live on one device.
Is this what broke your run? Paste your log.
You're reading about vLLM crashes initialising an NVFP4 model because the emulation lookup table stays on the CPU. Paste your own traceback and relevant evidence for an investigation of your workload, with a next action or a specific missing fact. A reference entry does not establish your cause. No account or card for the free diagnosis. Review data handling before submitting sensitive logs.
Before uploading, review cloud data handling and local options.
Upload your log file. Large files are processed in your browser. Only selected evidence is submitted when you run diagnosis.
Why it happens (the mechanism)
Backend selection is automatic and silent, and emulation is the last resort. Because it is rarely reached, its helper carries an assumption that no accelerated path makes: that the small constant table and the values indexing it are on the same device. The moment the fallback is genuinely used, that assumption meets a tensor already moved to the accelerator and PyTorch refuses the operation.
What you'll observe
- The model loads and then the engine dies during initialisation rather than during generation
- The same checkpoint is reported working elsewhere, on hardware with a real NVFP4 backend
- The error names an indexing rule rather than the quantization format, so the connection is not obvious
- Nothing in the launch command mentions emulation, which was selected automatically
Common symptoms and what they mean
Check possible explanations against the incident evidence. A matching symptom alone does not establish its cause.
| Symptom | Possible explanation |
|---|---|
| RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu) | PyTorch requires the index tensor and the tensor being indexed to live on one device, or the index to be on the CPU. The emulation helper builds its constant table as a plain tensor, which lands on the CPU, and then indexes it with values that have already been moved to the accelerator, so the pair straddles the boundary the rule forbids. |
| Traceback ending in nvfp4_emulation_utils.py, in break_fp4_bytes | The path is only reached when backend selection has exhausted every accelerated option. That makes the failure look hardware-specific when it is really a fallback that few deployments exercise, which is why the same checkpoint is reported working on machines that never enter emulation. |
| A log line stating that the EMULATION NvFp4 MoE backend was selected out of the potential backends | It fires during initialisation because the unpacking happens while weights are being prepared rather than while tokens are being produced, so there is no partially working server to inspect. |
| The crash occurring during engine init, before any generation | PyTorch requires the index tensor and the tensor being indexed to live on one device, or the index to be on the CPU. The emulation helper builds its constant table as a plain tensor, which lands on the CPU, and then indexes it with values that have already been moved to the accelerator, so the pair straddles the boundary the rule forbids. |
Which systems are affected
- NVFP4 and modelopt_fp4 checkpoints served by vLLM
- Hardware or builds where no FlashInfer, CUTLASS or Marlin NVFP4 backend is available, leaving emulation as the only option
- Mixture-of-experts models, where the emulated path is reached through the MoE layers
- Deployments that set the batch-invariant mode, which can exclude the faster backends
How to confirm this is the problem
Use this checklist to test the hypothesis against a small reproduction. No single line proves the root cause, so preserve the preceding events and compare one variable at a time.
- ✓Search the startup log for the line naming the selected NvFp4 backend. Emulation there confirms the fallback was taken and the accelerated paths were unavailable.
- ✓Check whether batch-invariant mode is set in the environment, since it can remove the accelerated backends from consideration.
- ✓Launch the identical checkpoint on hardware with a supported NVFP4 backend. Success there localises the fault to the fallback path rather than to the weights.
Root cause
- PyTorch requires the index tensor and the tensor being indexed to live on one device, or the index to be on the CPU. The emulation helper builds its constant table as a plain tensor, which lands on the CPU, and then indexes it with values that have already been moved to the accelerator, so the pair straddles the boundary the rule forbids.
- The path is only reached when backend selection has exhausted every accelerated option. That makes the failure look hardware-specific when it is really a fallback that few deployments exercise, which is why the same checkpoint is reported working on machines that never enter emulation.
- It fires during initialisation because the unpacking happens while weights are being prepared rather than while tokens are being produced, so there is no partially working server to inspect.
The fix and how to prevent it
How to fix it
- Check which backend was chosen. The log states the selected NvFp4 backend and lists the alternatives, and emulation appearing there is the signal that no accelerated path was available.
- Remove whatever excluded the faster backends. Batch-invariant mode is the common cause, and clearing it restores selection of an accelerated backend that never touches the emulated helper.
- Install or enable a build providing a real NVFP4 backend for the target device, since emulation exists as a correctness fallback rather than as a serving path.
- Serve a checkpoint quantized to a format the deployment has hardware support for when no NVFP4 backend can be provided, rather than relying on emulation to bridge the gap.
Step-by-step remediation
- 1Search the startup log for the notice naming the selected NvFp4 backend and the alternatives considered.
- 2EMULATION in that line means no accelerated backend was available and the software path was taken.
- 3Clear batch-invariant mode, or install a build that provides a real NVFP4 backend for the device.
- 4Serve a quantization the hardware supports rather than relying on emulation.
- 5Assert the selected backend at startup so a fallback refuses to serve instead of crashing during init.
How to prevent it
- Assert the selected backend at startup and refuse to serve on emulation, so the fallback is a deployment error rather than a latent crash.
- Include the intended quantization format in the deployment test on the target hardware, because backend availability is a property of the pair and not of the checkpoint.
- Treat any automatically selected fallback as something to be logged loudly, since it changes both the code path and the performance profile without changing the command.
Save this diagnosis and catch the next crash automatically
All root cause, fix, and prevention steps above are free to read. Create a free account with any email or GitHub to keep your saved diagnosis history across the encyclopedia and run cloud checks, or use a work email below for the 30-day Team evaluation. No card required.
Or start a 30-day free Team trial (work email)
Verified work email unlocks all 14 fleet diagnostic tools, Slack alerts, and team history for 30 days. No card and no automatic charge.
Searchable error signature
[nvfp4.py:283] Using 'EMULATION' NvFp4 MoE backend out of potential backends: ['FLASHINFER_TRTLLM', 'FLASHINFER_CUTEDSL', 'FLASHINFER_CUTLASS', 'VLLM_CUTLASS', 'MARLIN', 'EMULATION'].
File ".../vllm/model_executor/layers/quantization/utils/nvfp4_emulation_utils.py", line 38, in break_fp4_bytes
values = kE2M1[abs_vals] * torch.where(signs, -1.0, 1.0)
RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)Use this text as a lookup key in logs and upstream issue trackers. It is not presented as a captured customer log. Confirm the cause from your own preceding events, versions, configuration and the cited references.
Diagnose your own log automatically
The root cause and fix steps above stay free. Create a free account to analyze full job logs, attribute the first failed rank, and keep saved incident history.
Sign up free. Analyze your cluster logsNo credit card. Daily allowance follows verified trust tier. Instant access.
Why the recommended fix works
Restoring an accelerated backend removes the emulated helper from the execution path altogether, so the mismatched pair is never constructed. It is a better fix than forcing the table onto the accelerator would be, because emulation is a correctness reference rather than something a served deployment should be running on at all.
Best practices by model family
| Model / Stack | Recommendation | Notes |
|---|---|---|
| Batch-invariant mode set | Clear it and re-check the selected backend | It is the reported cause of the accelerated backends being excluded. |
| No NVFP4 backend on the device | Serve a format the hardware supports | Emulation is a correctness fallback, not a serving path. |
| Any NVFP4 deployment | Assert the selected backend at startup | Turns a silent fallback into a refusal to start. |
| Works on one machine, not another | Compare the backend selection lines, not the checkpoints | Availability is a property of the hardware and build pair. |
With the fix vs without the fix
| Dimension | With the fix | Without the fix |
|---|---|---|
| What the error names | A PyTorch indexing device rule | Read as a problem with the checkpoint |
| Why one machine works | It selected an accelerated backend | Assumed to be a difference in the weights |
| Role of emulation | A correctness fallback rarely exercised | Assumed to be a supported serving path |
Diagnostic note
“The most useful line in the whole log is the one nobody reads: the backend selection notice printed before the traceback. It names the chosen backend and every alternative that was considered, which turns an opaque indexing error into an obvious statement that the deployment fell back to software. Assert on that line at startup and this class of failure stops being a crash and becomes a configuration message.”
Visual fingerprint
kE2M1 lookup table built as a plain tensor -> CPU
abs_vals indices unpacked from weights -> GPU
|
kE2M1[abs_vals] -> RuntimeError
reached only when backend selection falls through to EMULATIONDiagnose this failure in VS Code
Select the traceback or open the failed terminal, then run Denpex locally to inspect matched failure patterns, supporting evidence and next checks without uploading the log. Verify recommendations against your workload before changing production.
Install the free VS Code extensionvLLM errors in context
vLLM failures cross request, model, KV cache, worker, kernel and host boundaries. The hub compares common signatures and evidence checks that help distinguish possible causes.
Compare related vllm errorsRelated failures to investigate next
Frequently asked questions
Questions engineers and on-call staff commonly ask about this failure.
Is the checkpoint corrupt?
Can I just move the lookup table to the GPU?
Why did it pick emulation at all?
Why does it crash before generating anything?
Don't just read the fix, diagnose your run
The encyclopedia explains documented failure patterns. Denpex investigates your logs, configuration and stack, shows the supporting evidence, and asks for missing details when needed.