This document is relevant for: Inf1, Inf2, Trn1, Trn2, Trn3

Deep dive: Port GPU-compatible models to the vLLM Neuron backend with the Autoport skill#

Why read this guide? You are an ML engineer who needs to serve a GPU-compatible transformer model on AWS Trainium through the vLLM Neuron backend. The model architecture is not yet registered with vLLM Neuron, so you need to port it. The Autoport vLLM Neuron skill handles this for you. It is an AI agent workflow that researches the model architecture, generates a vLLM Neuron model implementation, registers it, and validates accuracy against the GPU-compatible reference implementation.

How to use this guide: Use this guide when you need to add a model to the vLLM Neuron backend that is not already in the model registry. Jump to workflow steps if you already have your environment ready.

This skill targets the vLLM Neuron backend and produces a model that plugs into the vLLM model registry for online and offline serving. vLLM Neuron is the supported inference stack on Trn2 and Trn3.

Note

An earlier variant of this skill, Deep dive: Port HuggingFace models to NxD Inference with the Autoport skill (archived), targets the NxD Inference library and compiles to NEFF through the XLA/HLO path. That guide is archived: Neuron 2.33.0 is the last release that supports NxD Inference on Trn2 and Trn3. If you are moving an NxD Inference port to vLLM Neuron, see How to migrate from NxD Inference to vLLM Neuron.

You need experience with PyTorch model development, transformer architectures, and tensor parallelism to get the most out of this content.

Prerequisites#

Before you start, make sure you understand the following topics.

Overview#

Adding a new model architecture to the vLLM Neuron backend usually takes multiple days of engineering work: reading the source implementation, mapping every weight, respecting Trainium hardware constraints, and debugging silent accuracy bugs. The Autoport vLLM Neuron skill replaces that manual effort. An AI coding agent executes the full porting process from architecture research through equivalence validation.

The skill works with dense transformer models (decoder only), models with grouped query attention (GQA) and multi-query attention (MQA), Mixture of Experts (MoE) models that fit within tensor parallelism, large MoE models that require expert parallelism (EP), models with novel attention (sliding window, multi-latent attention), and vision-language models.

A port is not finished when the model produces correct logits on one colocated server. The skill treats two further serving modes as port deliverables: the model must serve under Disaggregated Inference, where prefill engines ship their KV cache to decode engines, and it must serve as a speculative-decoding target. Each one adds generated launch scripts and device tests to the port, and each is decided for the architecture during research rather than attempted at the end.

The workflow has three phases and thirteen steps.

Phase A: Research and analysis.

  1. Architecture research. The agent fetches the source model config, reads the modeling source, inspects the checkpoint weight keys, and computes valid tensor parallel sizes.

  2. Architecture analysis. The agent compares the model to the closest existing vLLM Neuron reference model and produces a summary of the changes needed.

Phase B: Code generation.

  1. Generate boilerplate. The agent creates config.py, factory.py, and __init__.py from templates.

  2. Generate model.py. The agent copies the reference model and modifies it section by section (normalization, RoPE, attention, MLP, MoE, decoder, backbone, LM head, weight loading).

  3. Register the model. The agent adds the model to vllm_neuron/model/registry.py.

  4. Generate example and docs. The agent creates a run script, a results file, and a model README.

  5. Self-review. The agent runs through a checklist before reporting completion.

Phase C: Validation.

  1. Smoke test. The agent runs offline inference and checks for coherent output.

  2. Online serving and APC. The agent serves the model through the vLLM OpenAI API server and runs a battery of completion, batch, streaming, and prefix caching tests.

  3. Logit validation. The agent compares Neuron logits against a CPU reference implementation and reports sigma values across top-k levels.

  4. Deep equivalence validation. The agent invokes the Equivalence skill with the vLLM Neuron adapter for component-level and end-to-end verification.

  5. Disaggregated inference. The agent generates the DI launch scripts and DI logit test, then runs the colocated and multi-node validation rungs.

  6. Speculative decoding. The agent lands the draft head, generates the spec tests and server script, and runs the recompile, logit, and acceptance rungs.

Hardware and software requirements#

  • Instance type. trn2.48xlarge. vLLM Neuron also runs on Trn3 instances; the NeuronCore counts and tensor parallel sizes in this guide are for trn2.48xlarge. On Trn2, each Neuron device exposes roughly 24 GB of HBM shared between two NeuronCores in the default LNC=2 configuration (96 GB per device).

  • Neuron SDK. Installed on the instance. The Amazon Linux 2023 Neuron DLAMI is a good starting point.

  • Python. 3.10 or later.

  • vLLM Neuron package. The vllm_neuron or private_vllm_neuron package must be present in your workspace. The skill stops if it cannot find one.

  • Transformers package. Used to read the reference model config and source.

  • Model weights. Downloaded from a model hub or available locally as .safetensors files.

Note

The Autoport vLLM Neuron skill supports a dry run mode for environments without Trainium hardware. In dry run mode the agent performs architecture research and code generation but skips compilation, inference, and validation. See Dry run mode.

Porting parameters#

The skill accepts the following arguments.

Parameter

Description

model-name

The snake_case name for the port (for example, yi, deepseek_v2). Becomes the directory name under vllm_neuron/model/.

hf-model-id

The source model identifier (for example, 01-ai/Yi-6B-Chat).

--review

Optional flag. Pauses after the architecture analysis (Step 2) so you can confirm or override the agent’s decisions before code generation.

The agent derives the PascalCase class prefix from model-name (for example, yi becomes Yi, gpt_neox becomes GPTNeoX). Model code goes in vllm_neuron/model/<model-name>/ and the example script goes in examples/vllm_neuron/models/<model-name>/.

Workflow#

Phase A: Research and analysis#

Step 1. Research the architecture#

The agent gathers everything it needs before writing any files.

Fetch the source model config. The agent loads AutoConfig for the model and records the architectures field (the exact string used for registry registration), the layer dimensions (hidden_size, intermediate_size, num_hidden_layers), the head counts (num_attention_heads, num_key_value_heads, head_dim), the vocabulary and position limits, the normalization epsilon, the RoPE parameters, the activation function, the tie_word_embeddings flag, the bias flags, and any model-specific fields such as sliding_window or num_local_experts.

Read the reference source. The agent reads the modeling file to confirm exact weight names, whether Q/K/V projections are fused or separate in the checkpoint, which projections carry biases, and any non-standard behavior such as parallel residual connections.

Important

The agent verifies the normalization type by reading the forward() implementation, not the class name. Some models name their class RMSNorm but implement full LayerNorm (with mean subtraction and bias). Using the wrong normalization produces output that passes smoke tests but fails accuracy validation.

Read the porting guide. The agent reads the canonical model bringup guide at doc/vllm_neuron/source/design/framework/model_bringup.md and the parallelism design docs it links. The bringup guide designates GPT-OSS BF16 as the canonical annotated reference, where # >>> PARALLELISM <<< blocks are infrastructure to keep as-is and # <-- MODEL-SPECIFIC blocks are what change per architecture.

Select a reference model. The agent picks the closest existing vLLM Neuron model as a copy source.

If the model has…

Use reference

Standard GQA + RoPE (most common)

llama3/

NoPE layers (per-layer RoPE omission)

smollm3/

QKV bias

llama3/ (add bias params to QKV/O projections)

Q/K per-head RMSNorm

qwen3/ (dense) or qwen3_moe/ (MoE)

Mixture of Experts (fits in TP)

qwen3_moe/

Mixture of Experts (needs EP)

gpt_oss/

Large MoE with multi-latent attention

deepseek_v32/

Vision-language model

qwen3_vl/

Compute valid tensor parallel sizes. The agent finds tensor parallel (TP) sizes that satisfy all five rules.

  1. num_attention_heads % tp_size == 0

  2. (num_attention_heads / tp_size) is even (NKI decode megakernel constraint)

  3. num_key_value_heads % tp_size == 0 or tp_size % num_key_value_heads == 0 (GQA replication)

  4. intermediate_size % tp_size == 0

  5. vocab_size % tp_size == 0 (or use padding)

The agent then applies the memory constraint. With TP=N, each rank holds roughly model_size_bytes / N of weights plus KV cache. If per-rank weight memory exceeds about 20 GB, the agent increases the TP size. It recommends the smallest valid TP size of 2 or greater that also fits the model in memory.

Inspect the checkpoint weight keys. The agent opens the .safetensors files to confirm which layers carry biases, the exact key naming convention, and weight shapes. This is essential for building the load_weights mapping correctly.

Evaluate expert parallelism (MoE models only). If the model is MoE and no single TP size satisfies all five rules while fitting in memory, the model needs Expert Parallelism. EP uses two-level parallelism: a TP sub-group for attention and dense layers, and an EP group for distributing experts. The agent computes the EP degree from the world size (64 on a full trn2.48xlarge) and verifies that num_local_experts divides evenly across EP groups.

Important

Unified collective group for EP. The Neuron Distributed Graph Engine (DGE) cannot handle two different collective group sizes in the same NEFF. All collectives (attention, MLP, MoE, embedding, LM head, sampler) must use a single group, the full world group. Weight sizing uses the sub-group, but collectives go through the unified group. Violating this causes NEFF Warmup failed with status 1006.

Decide whether the architecture can run disaggregated. DI needs no DI-specific model code when prefill and decode run at the same tensor parallel size, but it does need a KV layout the connector can register and transfer. The agent checks that every layer gets the runner’s standard key/value cache and that every piece of per-request state the decode engine reads lives in that cache. Two cases make DI unsupported for the architecture: layers that cache keys only, and linear-attention, DeltaNet, or state-space layers whose recurrent state either never leaves the model buffers or is transferred but already includes the last prompt token that decode re-runs. Either one is recorded with its reason, and Step 12 is skipped rather than attempted. The agent also records the tensor parallel sizes at which the per-rank page size is identical for every layer type, which is what hybrid sliding-window and global-attention models tend to satisfy at some sizes and not others, and whether the model can run hybrid TP, which needs the same key/value head count on every layer.

Decide which speculative-decoding method the model can target. The agent greps the runner for the methods it accepts and picks one for this model: native MTP when the checkpoint ships the nextn weights and the tree has an mtp proposer, EAGLE3 with a published draft head when one matches the target’s hidden size, vocabulary, and tokenizer, and otherwise EAGLE3 with the skill’s synthetic head. It confirms the choice by building vLLM’s speculative configuration on CPU at each planned tensor parallel size, before any code is written. A target that advances recurrent per-request state and cannot roll it back is recorded as unsupported, with an estimate of what the rollback would take, and Step 13 is skipped.

Step 2. Analyze the architecture#

The agent presents a summary comparing the target model to the reference, section by section (normalization, RoPE, attention, MLP, MoE, EP, decoder, backbone, LM head), with the change needed for each and any known pitfalls.

If you passed the --review flag, the agent pauses here and asks you to confirm or override its decisions. Otherwise, the agent prints the analysis and proceeds automatically.

Phase B: Code generation#

The defining rule of code generation is search before implementing. Before writing any module (normalization, RoPE, attention, MLP), the agent searches for an existing implementation in priority order: shared functional ops in vllm_neuron/functional/, shared neural network modules in vllm_neuron/nn/, other ported models in vllm_neuron/model/*/model.py, pre-built NKI kernels in the installed neuronxcc package, and finally production NKI kernels. The agent implements from scratch only when nothing matches.

Step 3. Generate boilerplate#

The agent generates three files from the skill’s templates, filled with values from Step 1.

vllm_neuron/model/<model-name>/config.py     # from config.py.template
vllm_neuron/model/<model-name>/factory.py    # from factory.py.template
vllm_neuron/model/<model-name>/__init__.py   # from init.py.template

Step 4. Generate model.py#

The agent copies the selected reference model’s model.py and modifies it section by section: normalization (RMSNorm vs LayerNorm, eps, biases), RoPE (variant and scaling), attention (bias, sliding window, GQA/MQA head counts), MLP (activation and gating), MoE (router precision, expert loop), decoder (norm placement and residual pattern), backbone (vocab padding, position embeddings), and LM head (tied vs untied, bias). It then builds the complete checkpoint key mapping so that every nn.Parameter has a corresponding load_weights entry, and renames all classes with the model’s PascalCase prefix.

The agent observes four hardware constraints that pass on the CPU simulator but fail on real Trainium hardware.

Constraint

Why it matters

No meta tensors in __init__

vLLM creates models on torch.device("meta") first, then loads weights. Any tensor computation in __init__ (such as RoPE inv_freq) creates meta tensors that later fail with “Cannot copy out of meta tensor”. The agent computes inv_freq lazily in forward().

No .to(device) in forward

On the CPU simulator this is a no-op, but on hardware torch.compile turns it into a cross-device copy that raises NotImplementedError: unimplemented _copy_from. Tensors passed into forward() are already on the correct device.

No .item() in forward

Scalar extraction breaks torch.compile with “Unsupported Tensor.item() call”. The agent uses static values or tensor operations instead.

2D bias shapes for NKI decode

The NF.attention_decode megakernel requires bias tensors to be 2D [1, size], not 1D. The agent unsqueezes bias tensors before passing them.

For MoE models, the agent keeps router gate weights in float32, not bf16, because the softmax over experts is extremely sensitive to precision. For MoE models with EP, the agent implements the unified sp_group pattern: tp_group (the sub-group) sizes weights, while sp_group (the full world) carries every collective. After loading weights, it scales replicated layers (o_proj, dense down_proj) by 1/ep_degree but does not scale MoE expert weights, and it filters expert weight loading by EP rank.

Step 5. Register the model#

The agent edits vllm_neuron/model/registry.py to import the new model and add it to get_models().

Important

The source architecture string must exactly match the architectures field from config.json, including capitalization. For example, a config with "architectures": ["PhiMoEForCausalLM"] requires the registry entry ("PhiMoEForCausalLM", PhiMoEForCausalLM). "PhimoeForCausalLM" would fail to load the model.

Step 6. Generate example and docs#

The agent creates the example run script (examples/vllm_neuron/models/<model-name>/run.py), a results file, and the model README (vllm_neuron/model/<model-name>/README.md). The README includes an architecture parameter table, the key differences from the reference model, and a feature status table (TP/SP/DP/EP, Eagle3, FP8 KV cache) with status markers and notes.

Step 7. Self-review#

Before reporting completion, the agent runs through a checklist: every nn.Parameter has a load_weights mapping, bias shapes are 2D for the decode megakernel, no .to(device) or .item() in the forward path, RoPE inv_freq computed lazily, class names consistent across all files, the registry uses the exact source architecture string, shared modules imported rather than reimplemented, MoE router weights in float32, and normalization type matching the reference source. EP models get an additional checklist covering the unified collective group, weight scaling, and expert rank filtering.

Phase C: Validation#

Step 8. Smoke test#

The agent runs the example script for offline inference.

# Standard (non-EP) models
NEURON_SKIP_EFA_AFFINITY=1 python examples/vllm_neuron/models/<model-name>/run.py

# EP models (requires contiguous collective topology)
NEURON_SKIP_EFA_AFFINITY=1 VLLM_NEURON_SWITCH_CC=1 python examples/vllm_neuron/models/<model-name>/run.py

NEURON_SKIP_EFA_AFFINITY=1 is needed on trn2 instances where the PCI topology does not match the hardcoded mapping. It is safe for single-node TP. The agent checks for successful weight loading (no missing key errors), successful compilation (no NKI shape mismatch errors), and reasonable generated text (not garbage or degenerate repetition), then records the results.

Step 9. Online serving and APC#

The agent starts the vLLM OpenAI API server and runs a test battery: a basic completion, a batch of four prompts, a streaming request, and a counting continuation. It measures latency and throughput over ten requests, then restarts with --enable-prefix-caching (APC) and re-runs the tests.

NEURON_SKIP_EFA_AFFINITY=1 python3 -m vllm.entrypoints.openai.api_server \
    --model <hf-model-id> \
    --tensor-parallel-size <tp-size> \
    --max-model-len 256

Step 10. Validate logits#

The agent generates the canonical logit validation test and runs it. The test compares Neuron output logits against a CPU reference implementation at several top-k levels (5, 50, 1000, all) and reports the difference as sigma values.

Sigma

Interpretation

< 3

Excellent. Within normal numerical noise.

3-5

Acceptable. Minor differences, usually from bf16 quantization.

5-10

Investigate. May indicate a real issue, but can be model-specific.

> 10

Likely a bug in the port.

Note

A logit validation failure is not a hard blocker. The agent reports the sigma values and which top-k levels failed, explains what they mean, and continues to completion. Some models naturally have higher variance at certain top-k levels, and you decide whether the accuracy is acceptable for your use case.

Step 11. Validate deep equivalence#

The agent always runs the full equivalence pipeline for rigorous component-level and end-to-end verification. It invokes the Equivalence skill with the vLLM Neuron adapter (--target-stack vllm_neuron), which handles distributed init, from_configs() instantiation, weight mapping with transpositions and QKV fusion, attention metadata construction, and the vllm.LLM API.

The equivalence pipeline maps each submodule between the GPU-compatible reference implementation and the port, runs component-level R-ratio tests, performs fault localization and debugging if it finds failures, runs a teacher-forced end-to-end comparison (R-ratio, cosine similarity, KL divergence), and generates an equivalence report.

  • All R < 1.2 and the end-to-end test passes: the port is verified at the component level.

  • Component failures: the equivalence report includes patches showing what is wrong. The agent uses these as a guide to fix the model code.

Step 12. Validate disaggregated inference#

Unless Step 1 found the architecture unsupported, the agent generates the port’s DI artifacts and validates them. The artifacts are a pair of launch scripts for a prefill and a decode server plus a proxy, a DI logit test placed next to the port’s colocated logit test, and an optional throughput test. The DI logit test deliberately reuses the port’s own reference, prompts, and tolerances, so its result compares directly with the Step 10 number instead of being graded on a separate scale.

Two topologies are validated. Colocated puts the prefill and decode engines on one Trn2 instance with disjoint, contiguous core windows, so (P + D) × TP must fit the instance. Multi-node puts one engine per node, or, for a port whose engine already spans several nodes, one API node and the remaining headless nodes per engine; colocated is then not applicable.

The rungs run in order and stop at the first failure:

  • Static contract. The recorded KV layout and page-size findings from Step 1 hold for every shipped tensor parallel size. No device time.

  • Colocated smoke. The agent starts the prefill server, the decode server, and the proxy, and checks that both servers are healthy, that the decode log shows the KV handshake and a completed transfer, and that the greedy completion matches a non-DI server started with the same flags.

  • Colocated logit validation. The DI logit test runs under mpirun with two ranks. The gate is the per-prompt top-k errors against the port’s own tolerance map, with a completed KV transfer. As in Step 10, a sigma miss is reported and the port continues.

  • Multi-node logit validation. The same comparison across (P + D) × N nodes, one MPI rank per node. When the cluster does not have enough nodes, or no node passes the preflight, the agent records multi-node as not run with the reason. It never records a pass it did not measure.

Note

A failing static-contract assertion at server start means DI is unsupported for that architecture, or at that tensor parallel size. It is not a connector bug, and the agent records it rather than patching the KV connector from a model port.

The agent prefers a port-side fix over a framework change. Where a framework change is genuinely needed it lands as its own commit, is recorded with the port’s results, and the port’s non-DI tests are re-run. The connector rules, the environment and core layout, the failure triage table, and the CI manifest entries are in the skill’s disaggregated-inference reference.

Step 13. Validate the speculative-decoding target#

Unless Step 1 found speculation unsupported, the port is validated as a speculative-decoding target. The target surface itself is written in Step 4 with the rest of the model, not bolted on afterwards: the auxiliary hidden-state tap in the backbone, the capability declaration the runner looks for, and the verify step shape that evaluates a token and k drafts at once.

The agent lands the draft first. For a published EAGLE3 head it downloads only the head and rewrites it so the Neuron draft loader accepts it; with no published head it generates a random-initialized one; for native MTP the draft is the checkpoint’s own nextn layers. A CPU test then checks the auxiliary tensors against the reference model’s hidden states and is required to fail under two deliberate mutations, so a tap in the wrong place cannot pass by accident.

The device rungs are:

  • No recompile. Generating to the full context length with recompilation treated as an error must complete without compiling a new graph.

  • Target logits. The target’s logits through the speculative server are compared with the port’s own Step 10 reference, prompts, and tolerances at more than one draft length, so the sigma sits next to the non-speculative sigma.

  • Acceptance. Greedy completions are compared token for token against a non-speculative control, and the acceptance length is read from the server’s metrics. Every prompt must match exactly or differ only at a near tie, and acceptance must clear a floor that depends on how trusted the draft head is.

Important

Acceptance length is the only gate that exercises the draft path. A wrong tap, wrong auxiliary layer ids, or wrong padding leave the logits correct and drop acceptance to roughly 1.0, which means no draft is ever accepted. A port validated with the synthetic head is reported as target-side ready, never as passing, because a random head cannot produce a meaningful acceptance rate.

The method contracts, the draft formats, the full rung definitions, and the failure triage table are in the skill’s speculative-decoding reference.

Dry run mode#

When Trainium hardware is not available, the agent operates in dry run mode. It skips the agent-level prerequisites (package import checks, the neuron-ls NeuronCore check), activates the provided virtual environment, and resolves source paths by filesystem lookup rather than by importing packages. Phase A (research) and Phase B (code generation) run normally. The agent skips Phase C (compilation, inference, and validation) because no hardware is present.

Invoke dry run mode by specifying dry-run when calling the skill.

File organization#

The skill produces files in these locations.

vllm_neuron/model/<model-name>/
├── __init__.py          # Exports the factory ForCausalLM class
├── config.py            # Model config class
├── factory.py           # Model factory
├── model.py             # The ported model implementation (final product)
└── README.md            # Architecture table and feature status

vllm_neuron/model/registry.py            # Modified: new model registered

examples/vllm_neuron/models/<model-name>/
├── run.py               # Offline inference example
├── results/results.md   # Offline, online, DI, and spec results
├── di/                  # DI-supported models only
│   ├── run_di_server.sh # Prefill or decode server, selected by ROLE
│   └── run_di_proxy.sh  # Proxy, sends one completion and stays up
└── spec/                # Spec-supported models only
    └── run_spec_server.sh   # Speculative server

test/vllm_neuron/model/<model-name>/bf16/e2e/
├── test_logits.py       # Logit validation test
├── test_logits_di.py    # DI logit validation (DI-supported models only)
├── test_spec_no_recompile.py    # Spec-supported models only
├── test_spec_target_logits.py   # Spec-supported models only
└── test_spec_acceptance.py      # Spec-supported models only

test/vllm_neuron/model/<model-name>/bf16/performance/
└── test_di_throughput.py    # Optional manual DI throughput suite

ci/test-manifest-di.yaml                 # Modified, when the tree registers DI tests

Note

The agent locates the port’s existing test directory rather than assuming this layout, and places the DI and speculative tests next to the port’s colocated logit test wherever that happens to be on your checkout.

Common issues#

Inference and compilation failures#

Symptom

Likely cause and fix

Cannot copy out of meta tensor

RoPE or another tensor computed in __init__. Move it to forward() and compute it lazily.

Bias shape must be [1, I], got (N,)

1D bias passed to the NKI decode megakernel. Add .unsqueeze(0) before passing to NF.attention_decode.

unimplemented _copy_from xla:0 neuron:N

A .to(device) call in the forward path. Remove it; tensors are already on device.

Unsupported Tensor.item()

A .item() call in the forward path. Use static values or tensor ops.

Checkpoint key(s) not found

Weight mapping mismatch. Check load_weights mappings against the actual checkpoint keys.

size mismatch for lm_head.bias

lm_head bias not mapped correctly. Use a separate nn.Parameter and an explicit mapping.

nrt_tensor_allocate status=4

HBM out of memory. Increase the TP size.

No EFA device found

PCI topology mismatch. Set NEURON_SKIP_EFA_AFFINITY=1.

Degenerate output (the the the...)

Decode path bug (bias, KV cache, or norm). Test prefill only (max_tokens=1), then debug decode.

Registry AttributeError: no attribute 'from_configs'

Architecture string mismatch in the registry. Verify the exact source architecture string from config.json.

Expert parallelism failures#

These apply only to MoE models that use expert parallelism.

  • NEFF Warmup failed with status 1006 or a DGE scatter/gather out-of-bound error. Mixed collective group sizes in one NEFF. Unify all collectives to one group (sp_group).

  • OOM during weight loading. Expert weights are not filtered by EP rank. Map only the local expert range.

  • Garbage output but no crash. Check the o_proj and down_proj scaling (missing div_(ep_degree)), and confirm the router gate is replicated, not EP-sharded.

  • Compilation OOM or timeout. With many experts in a loop, the compiler unrolls all iterations. Switch to the NF.moe_cte (prefill) and NF.moe_block_tkg (decode) kernels.

Disaggregated inference and speculative decoding failures#

Symptom

Likely cause and fix

All kv cache tensors must have the same number of blocks at startup, with use_mla: True in the log

vLLM treats the architecture as multi-latent attention, so the connector registers the key/value tensor as one region. Set VLLM_MLA_DISABLE=1 on every DI engine and confirm the log reports use_mla: False. This is not a page-size problem.

Colocated output is wrong but each server alone is correct

FI_EFA_ENABLE_SHM_TRANSFER is not 0. Export it as 0 for colocated runs, or single-node DI can return silently wrong output.

Invalid device index or a local rank count mismatch at engine start

The core window is wrong for that engine. Each engine needs a disjoint, contiguous, zero-based NEURON_VISIBLE_DEVICES window, and colocated DI needs (P + D) × TP to fit the instance.

Decode hangs waiting for remote KV, or the handshake never completes

Side-channel ports collide, the engine id is reused, or the side-channel host is not reachable. Give each engine a distinct port and a unique, deterministic engine id.

Slab size mismatch or non-uniform block lengths

Per-layer page bytes differ at this tensor parallel size. Use a size where they match, or record DI as unsupported there.

A draft load fails listing draft architectures, or on a missing embed_tokens.weight

A published head in SpecForge format. Run it through the skill’s head adapter, which rewrites the registry architecture and supplies the target’s embedding.

Acceptance length is roughly 1.0 but the target logits are correct

The auxiliary tap, the auxiliary layer ids, or the hidden padding are wrong. The logits cannot catch this; re-run the CPU auxiliary-tensor test.

Out of memory at warmup, or on device under concurrency, with speculation enabled

The draft and the extra graphs per bucket need more headroom than non-speculative serving. Raise VLLM_NEURON_RESERVED_HEADROOM_GIB, then re-measure at the highest planned concurrency. Changing it changes the KV block count and forces a recompile.

Note

Do not clear /var/tmp/neuron-compile-cache as a pre-flight step. It is a shared system directory that other processes may depend on. Clear it only reactively if you hit an [NLA001] JSON parse error or a FileNotFoundError on neff output paths.