Guides writing and modifying NKI kernels for AWS Neuron: creating kernels from PyTorch/NumPy/natural language, editing existing kernels, adding shape/dtype support, refactoring tiling strategies, and implementing new features.
Ships in neuron. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill guides writing and modifying NKI (Neuron Kernel Interface) kernels — from new kernel creation (PyTorch/NumPy/natural language translation) to editing existing kernels (adding shape/dtype support, refactoring tiling, implementing new features). Focus on correctness using documented APIs.
BEFORE writing any NKI code, read references/nki-language-constraint.md for the complete list of required and forbidden API patterns. Each rule is labelled with the release that made it a breaking change (0.x.0+), so the file covers every current release rather than one migration step. Violating ANY rule is a compilation failure.
The PSUM free-dimension limit is generation- and dtype-gated and has changed across releases. Current values:
float32 dst, 8192 for a bfloat16 dst (entire PSUM)This is not a queryable tile_size field — nl.tile_size.psum_bank_fmax is
a fixed 512 (fp32 elements per bank) and is neither dtype- nor generation-aware,
so do not use it as the free-dim limit. Authoritative source: the nc_matmul,
nc_matmul_mx, and dma_transpose API blocks via /neuron-nki-docs. Treat any
PSUM free-dim number inlined in this skill's reference files as illustrative;
confirm against those API blocks.
tile_size does authoritatively report other limits — use it for those:
nl.tile_size.pmax (128), nl.tile_size.psum_num_banks (bank cycling),
nl.tile_size.gemm_moving_fmax (matmul moving-operand SBUF free dim), and
nl.tile_size.sbuf_fmax / sbuf_fmax_bytes (SBUF capacity).
Minimal working kernel structure:
import nki
import nki.isa as nisa
import nki.language as nl
@nki.jit
def my_kernel(input_hbm: nl.ndarray) -> nl.ndarray:
"""One-line description of kernel operation."""
# 1. Allocate SBUF tile
tile = nl.ndarray(input_hbm.shape, dtype=input_hbm.dtype, buffer=nl.sbuf)
# 2. Load from HBM to SBUF
nisa.dma_copy(dst=tile, src=input_hbm[0:input_hbm.shape[0], 0:input_hbm.shape[1]])
# 3. Compute (example: element-wise exp)
result = nl.ndarray(tile.shape, dtype=tile.dtype, buffer=nl.sbuf)
nisa.activation(dst=result, data=tile, op=nl.exp)
# 4. Allocate and store to HBM
output = nl.ndarray(input_hbm.shape, dtype=input_hbm.dtype, buffer=nl.shared_hbm)
nisa.dma_copy(dst=output, src=result)
return output
Before reading references, classify the task to avoid unnecessary overhead:
Simple (element-wise op, single reduction, activation, layernorm, add/multiply):
Medium (matmul, softmax, multi-step fusion, transpose with tiling):
references/common-patterns.md, references/api-translation.md and references/memory-patterns.mdComplex (multi-head attention, transformer blocks, state-space models, MoE):
Start writing code as soon as possible. Reference reading should supplement coding, not precede it. Write the kernel structure first, then consult references for specific API details as needed.
Map PyTorch/NumPy operations to NKI equivalents using references/api-translation.md.
NKI operates on tiles with hardware constraints:
| Constraint | Limit | Notes |
|---|---|---|
| Partition dimension (P) | ≤ 128 | First dimension of SBUF tensor |
| PSUM free dimension | 512 (gen2/3); gen4: 4096 fp32 / 8192 bf16 | For matrix multiply results — authoritative: nc_matmul doc block (see "Hardware limits" above) |
SBUF free dim and MatMul K (contraction) are not fixed constants — look them up rather than hardcoding. SBUF free-dim capacity is a per-partition byte limit (
nl.tile_size.sbuf_fmax/sbuf_fmax_bytes, generation-/dtype-dependent). Per-instruction MatMul K is the partition dim, K ≤ 128 (effective 256/512 withdouble_row/ Quad-MX packing). Authoritative source: thenc_matmultile-size block in the/neuron-nki-docsskill (api-nki-isa-tensor.md).
For tensors exceeding these limits, tile explicitly. Two mechanisms, both remainder-safe:
nl.tiles / nl.blocks (NKI 0.7.0+, language-native) — view the tensor as a grid
addressed by tile coordinate, e.g. src_tiles = nl.tiles(src, tile_shape=(128, 256)) then
src_tiles[i, j].data. Prefer this when the alternative is hand-computed offsets and
strides, and use nl.alloc_tiles / nl.alloc_blocks to allocate on-chip grids. Boundary
tiles clamp to the real extent automatically. See references/indexing-patterns.md
("Tiled and Blocked Layouts").TiledRange (nkilib helper) — iterate a tiled dimension, giving .start_offset /
.size per step for plain slicing. Still valid and widely used in nkilib kernels; see
Utility Selection Guide below.Consult the Utility Selection Guide to choose the right utilities for the kernel's access patterns,
then follow references/memory-patterns.md and references/transpose-and-layout.md:
TensorView.slice(step=N) for gather/scatter patterns (see transpose-and-layout.md)TiledRange for dimensions requiring tiling with remainder handlingnisa.nc_transpose() for P↔F transpose, TensorView for layout manipulationstream_shuffle_broadcast when a bias/scale in partition 0 must reach all PEsSbufManager when the kernel has 4+ SBUF allocations or shared sub-functionsUse ISA functions with explicit dst parameter:
# Element-wise
nisa.activation(dst=result, data=input, op=nl.exp)
nisa.tensor_tensor(dst=result, data1=a, data2=b, op=nl.add)
nisa.tensor_scalar(dst=result, data=input, op0=nl.multiply, operand0=2.0)
# Reductions
nisa.tensor_reduce(dst=result, data=input, op=nl.add, axis=1)
# Matrix multiply
nisa.nc_matmul(dst=psum_result, stationary=a, moving=b)
Important: Always compute reference results on CPU, not on the XLA device. Every on-device XLA graph generates a separate NEFF file, making it hard to identify the NKI kernel's NEFF during profiling. Use tensor.cpu() before computing PyTorch/NumPy references.
For simple kernels (single operation, few tiles), comparing the final output against a PyTorch/NumPy reference is usually sufficient. For complex kernels with multiple computation stages, validate incrementally:
This catches translation errors early — a mismatch in the final output of a 5-stage kernel is much harder to diagnose than a mismatch after stage 2.
Use multiple complementary checks (atol/rtol, max absolute difference, tensor norm of the difference, cosine similarity) rather than relying on a single metric.
| Buffer | Max P | Max F | Use Case |
|---|---|---|---|
nl.sbuf | 128 | nl.tile_size.sbuf_fmax (per-partition byte limit; gen/dtype-dependent) | General compute |
nl.psum | 128 | 512 (gen2/3); gen4: 4096 fp32 / 8192 bf16 | MatMul accumulation |
nl.shared_hbm | - | - | Input/output tensors |
| Loop Type | Use Case | Unrolling |
|---|---|---|
range(N) | Any compile-time-bounded loop — the default | Full unroll |
nl.fori_loop(lower, upper, body_fun, step=1) | Counted loop with runtime bound | Structured on-chip loop (not unrolled) |
nl.while_loop(init, body_fun) | Data-dependent condition-driven loop | Structured on-chip loop (not unrolled) |
nl.no_reorder() (context manager) | Constrain scheduling of a region | n/a — a scheduling directive, not a loop |
nl.affine_range / nl.sequential_range / nl.static_range are deprecated aliases for
range() — use range(). All three are literally return range(start, stop, step) on the
default frontend and in the CPU simulator, and each carries an explicit "This API is deprecated
and will be removed in future releases. Prefer using range() directly instead" warning. They do
not differ in unrolling or scheduling:
nl.sequential_range does not serialize execution or express a loop-carried dependency.
Choosing it over nl.affine_range changes nothing. To constrain scheduling, use the
nl.no_reorder() region; to carry state across iterations, keep it in SBUF/PSUM and mutate in
place — correctness comes from the data dependency, not from the loop function.Runtime/data-dependent loops (NKI 0.7.0+): use nl.fori_loop (counted, runtime bound) or
nl.while_loop (condition-driven), NOT for i in nl.dynamic_range(...) or bare while reg: —
those cannot work on the default standard frontend, where a runtime register has no value at
trace time. See references/nki-language-constraint.md for the before/after patterns and rules, and
/neuron-nki-docs (api-nki-language-dims.md) for the fori_loop / while_loop API signatures.
For detailed code examples, anti-patterns, and production patterns (cumsum, rmsnorm_quant), see references/common-patterns.md.
nisa.activation() / nisa.tensor_tensor()nl.ndarray(..., buffer=nl.psum) — uninitialized is correct; do NOT nisa.memset the PSUM tile before the K looprange() — the deprecated nl.*_range aliases are the same function and none of them serializesaccumulate=(k_idx > 0): the first K tile overwrites (initializes) PSUM, later tiles accumulate — this replaces any separate memset/zero-init of PSUM[K≤128, M≤128], moving [K≤128, N≤512/4096], result [M, N] in PSUMnisa.tensor_copy() before further opsexamples/simple_matmul.py for complete examplesnisa.activation(op=nl.exp, data=x, scale=s) → exp(x * s) in one instructionnisa.tensor_tensor_scan instead of explicit sequential loopsout[i] = op0(data[i], out[i-1]) op1 data1[i]initial= to next tile's scanexamples/associative_scan.py for complete patternReferences are tiered to minimize overhead on simple tasks. Load only what you need based on the Complexity Assessment above.
references/nki-language-constraint.md - MANDATORY: Required and forbidden API patterns (version-gated per release), frontend selection, reference kernel templatereferences/common-patterns.md - Full code examples: matmul PSUM accumulation, fused ScalarE, associative scan, production patternsreferences/api-translation.md - PyTorch/NumPy to NKI operation mappingreferences/kernel-template.md - Standard kernel template with self-contained utilitiesreferences/indexing-patterns.md - Complete indexing guide: memory-type rules (HBM/SBUF/PSUM), tiled/blocked layouts (nl.tiles, nl.blocks, nl.alloc_tiles), operation constraints (matmul/transpose/reduce), dynamic indexing with DGE modesreferences/tile-grain-selection.md - How to CHOOSE the tile_shape / block_shape values: size the tile to the consuming nisa.* op rather than to the tensor, keep the tunable grain at the block level, two-level loop structure. Authoring heuristics, not compilation rulesreferences/memory-patterns.md - DMA and tiling patterns with code examplesreferences/nkilib/core/tiled-range.md - TiledRange: dimension tiling with remainder handlingreferences/nkilib/core/kernel-helpers.md - Math helpers, SPMD, dtype utilitiesreferences/transpose-and-layout.md - Transpose and layout transformation guide: nc_transpose, TensorView, array patterns, strided DMA, decision trees for layout operationsreferences/nkilib/core/tensor-view.md - TensorView: zero-copy tensor manipulation/neuron-nki-docs (query it, not duplicated here):NkiTensor view methods — composable, zero-copy views callable directly on a tensor: slice, select, permute, broadcast, expand_dim, squeeze_dim, reshape_dim, flatten_dims, rearrange, reshape, view, vector_select, plus query methods is_contiguous / is_indirect and low-level ap / get_pattern. These are the native tensor methods (e.g. t.slice(1, 0, 256)); the TensorView helper above wraps the same ops for composing complex 3D+ .ap() patterns. Look up signatures/examples via /neuron-nki-docs → api-nki-tensor.md..indirect()) — on NeuronCore-v4+, gather/scatter for on-chip compute (not just DMA): pass a .indirect(index) view as dst or data to nc_matmul, nc_matmul_mx, tensor_tensor, tensor_scalar, tensor_reduce, tensor_copy, tensor_copy_predicated, tensor_scalar_reduce, tensor_scalar_cumulative, activation, activation_reduce, activate2, exponential. Subject to quadrant/partition-alignment rules (group size 16 for vector/scalar/gpsimd, 32 for tensor engine). This extends the DMA-only vector_offset indirection to compute. Look up NkiTensor.indirect and the per-op notes via /neuron-nki-docs.references/performance-basics.md - Optimization patterns (fusion, double buffering)references/nkilib/core/allocator.md - SbufManager: stack/heap SBUF allocationreferences/nkilib/core/tile-info.md - TiledDimInfo: tile tracking with subtile supportreferences/nkilib/ops/ - Copy/broadcast operations (stream-shuffle, tp-broadcast)references/nkilib/types/ - Enum types and logging utilitiesreferences/nkilib/patterns/ - Reusable kernel patterns (quantization, normalization, layout conversion, MoE)Full source for nkilib/core utilities and subkernels:
references/nkilib/core/utils/ - Utility source (TensorView, TiledRange, kernel_helpers, SbufManager, etc.)references/nkilib/core/subkernels/ - Reusable sub-operations (RMSNorm, LayerNorm, normalization utils)Default: inline nkilib utility source directly into the user's kernel file from the bundled source above.
If nkilib is installed in the user's environment, use from nkilib.core.utils.X import Y imports instead.
| Utility | Adopt When |
|---|---|
div_ceil(n, d) | Any tile count computation. Never write (n + d - 1) // d inline. |
kernel_assert() | Any input validation. Never use Python assert. |
| Utility | Adopt When | Reference |
|---|---|---|
nl.tiles / nl.blocks | Addressing a tensor by tile (or block) coordinate instead of computing offsets and strides by hand | references/indexing-patterns.md ("Tiled and Blocked Layouts") |
nl.alloc_tiles / nl.alloc_blocks | Allocating on-chip storage that is itself a tile/block grid | references/indexing-patterns.md ("Tiled and Blocked Layouts") |
TiledRange | Tiled dimension iteration with remainder handling | references/nkilib/core/tiled-range.md |
TensorView | Strided/interleaved DMA, broadcasting, reshape without copy, dynamic selection | references/nkilib/core/tensor-view.md |
stream_shuffle_broadcast | Replicate partition-0 value (bias, scale) to all 128 partitions | references/nkilib/ops/stream-shuffle-broadcast.md |
SbufManager | 4+ SBUF tensors or sub-functions sharing SBUF | references/nkilib/core/allocator.md |
NkiTensor view methods | Zero-copy reshape/slice/permute/broadcast directly on a tensor (t.slice(...), t.reshape_dim(...), etc.) | /neuron-nki-docs → api-nki-tensor.md |
.indirect() on compute ops | On-chip gather/scatter (NeuronCore-v4+) for matmul/tensor/activation ops via an index tensor | /neuron-nki-docs → NkiTensor.indirect |
Specialized: TiledDimInfo (subtile metadata), tp_broadcast (P→F broadcast, very rare).
Kernel needs tiling?
├─ Tiles addressed by coordinate (and would otherwise need manual offset/stride math)?
│ └─ Yes → nl.tiles(src, tile_shape=...) → src_tiles[i, j].data
│ Allocate on-chip grids with nl.alloc_tiles(...)
├─ Coarser transfer/reuse grain above the compute tile?
│ └─ Yes → nl.blocks(src, tile_shape=..., block_shape=...) → block.data for one DMA
├─ Plain iteration over a tiled dimension → TiledRange for each tiled dimension
│ Use div_ceil() for tile count computations
├─ Nested tiles (subtiles within tiles)?
│ └─ Yes → TiledRange supports nesting: TiledRange(outer_tile, subtile_size)
│ For CTE-style metadata tracking → also consider TiledDimInfo
└─ No tiling → Plain range()
Kernel accesses tensors non-contiguously?
├─ Strided/interleaved → TensorView.slice(step=N)
├─ Broadcasting → TensorView.broadcast(dim, size)
├─ Reshape without copy → TensorView.reshape_dim() / flatten_dims()
├─ Dynamic expert selection → TensorView.select(dim, scalar_offset)
└─ Simple contiguous → plain tensor[start:end, :]
Kernel needs to broadcast a scalar/vector to all partitions?
├─ 1D value in partition 0 → stream_shuffle_broadcast(src, dst)
└─ Column vector (P-dim) to row (F-dim) → tp_broadcast(src, dst, ...)
Kernel allocates many SBUF buffers?
├─ 4+ buffers, or sub-functions share SBUF → SbufManager
└─ 1-3 simple buffers → plain nl.ndarray(..., buffer=nl.sbuf)
Follow these conventions unless the user's instructions or existing project style indicate otherwise.
kernel_assert() over Python assert - Produces structured error messages ([NCC_INKI016] Kernel validation exception: ...) that clearly identify errors originating from NKI kernels, which is helpful when kernels run inside larger frameworks. The kernel template (references/kernel-template.md) provides an inline definition; alternatively, import from nkilib if installed.partition_idx not p)These are basic efficiency practices to follow when writing any kernel. They do not require advanced allocation or pipelining — just sensible layout, tiling, and data flow choices.
If the input/output tensor layout would make the kernel significantly harder to write (e.g., requiring many strided DMAs or complex reshaping), ask the user:
"The current tensor layout [describe issue] would require [strided DMA / reshaping]. Would you allow changing the layout to [proposed layout]? This would simplify the kernel and improve performance."
Layout changes that typically help:
DMA efficiency depends on the free dimension (second dimension onwards) being large and contiguous in memory. Target ≥2KB contiguous free dimension to saturate memory bandwidth.
Key concept: In a tile [P, F], the partition dimension P (first dim) is distributed across
hardware partitions. The free dimension F (second dim onwards) should be large and contiguous.
| Data Type | Minimum Free Dimension (Contiguous) |
|---|---|
| float32 | 512 elements (2KB) |
| bfloat16 | 1024 elements (2KB) |
| float8 | 2048 elements (2KB) |
What "contiguous" means: The free dimension elements are adjacent in HBM memory with stride=1.
Production example from mlp_tkg_gate_up_projection.py:169-181:
# Weight layout: [H, I] where I is the contiguous free dimension
# Load weight tile [HTile=2048, I] where I is large and contiguous
# HTile = 2048 for non-quantized (reshapes to [128, 16, I] in SBUF)
nisa.dma_copy(
dst=weight_tiles[weight_idx][0:H0, 0:h1_tiles, 0:I], # SBUF: [128, h1_tiles, I]
src=unsharded_weight.ap(
pattern=[
[H1 * unsharded_weight.shape[1], H0], # Partition dim
[unsharded_weight.shape[1], h1_tiles], # Batch dim
[1, I], # Free dim - contiguous (stride=1)
],
offset=h_offset * dims.I + weight_shard_offset,
),
)
# Here I (intermediate dimension) is the large contiguous free dimension
Why this matters: Strided DMA (free dim not contiguous) has significant overhead. If your tensor layout requires strided access, consider asking the user to change the layout (see Tensor Layout Flexibility above).
Avoid unnecessary HBM round-trips by keeping intermediate results in SBUF between operations.
Common pattern: MatMul → Element-wise → HBM
# MatMul result in PSUM
psum_result = nl.ndarray((P, F), dtype=nl.float32, buffer=nl.psum)
nisa.nc_matmul(dst=psum_result, stationary=a, moving=b)
# Copy to SBUF for element-wise ops (PSUM → SBUF, no HBM)
sbuf_result = nl.ndarray((P, F), dtype=nl.float32, buffer=nl.sbuf)
nisa.tensor_copy(dst=sbuf_result, src=psum_result)
# Element-wise activation in SBUF (still no HBM)
nisa.activation(dst=sbuf_result, data=sbuf_result, op=nl.gelu)
# Only final result written to HBM
nisa.dma_copy(dst=output_hbm, src=sbuf_result)
Anti-pattern to avoid:
# BAD: Writing matmul result to HBM, then reading back for activation
nisa.dma_copy(dst=hbm_temp, src=psum_result) # Unnecessary write
nisa.dma_copy(dst=sbuf_for_act, src=hbm_temp) # Unnecessary read
nisa.activation(dst=sbuf_for_act, data=sbuf_for_act, op=nl.gelu)
Always try to use the full partition dimension (128) for hardware parallelism.
Production example from mlp_tkg_constants.py:156:
# Hardware partition dimension constraint - always use 128
_pmax = nl.tile_size.pmax # Max partition dimension in SBUF = 128
# Derived dimensions maximize partition usage
H0 = _pmax # 128 (partition dimension)
H1 = H // H0 # Remaining hidden dimension
# All SBUF tiles use full partition dimension
tile = nl.ndarray((H0, free_dim), dtype=dtype, buffer=nl.sbuf) # [128, ...]
| Operation | Minimum Tile Size | Rationale |
|---|---|---|
| MatMul (nc_matmul) | (128, 512) | Partition=128, PSUM free=512 for pipelining |
| Vector/Scalar ops | (128, 64) | Partition=128, free dim ≥64 for efficiency |
Production MatMul example from mlp_tkg_gate_up_projection.py:188-204:
# Standard matmul tile: stationary [128, T], moving [128, 512]
for i_tiles in TiledRange(I, dims._psum_fmax): # _psum_fmax = 512
nisa.nc_matmul(
dst=result_psums[i_tiles.index][
nl.ds(dims.column_tiling_dim * column_idx, T),
0 : i_tiles.size, # Up to 512
],
stationary=hidden.ap(
pattern=[[T * H1, H0], [H1, T]],
offset=h_offset + column_tile_offset,
),
moving=weight_tiles[weight_idx][
0:H0, # 128 partition dim
column_tile_offset,
nl.ds(i_tiles.start_offset, i_tiles.size), # Up to 512
],
)
Vector/Scalar tile sizing from mlp_tkg_constants.py:194-206:
# column_tiling_dim sets the free dimension for vector/scalar ops
# (e.g., activation functions, element-wise ops after matmul)
# Minimum 64 ensures efficient hardware utilization
if T <= 32:
column_tiling_dim = 32 # Small T: use 32
elif T <= 64:
column_tiling_dim = 64 # Medium T: use 64 (minimum for efficiency)
else:
column_tiling_dim = 128 # Large T: use 128
| Skill | Use When |
|---|---|
/neuron-nki-docs | Look up specific API documentation |
/neuron-nki-debugging | Debug compiler errors on device |
/neuron-nki-profiling | Profile kernel performance |
/neuron-nki-profile-querying | Query and analyze kernel profile data |
examples/associative_scan.py (opens in a new tab)examples/elementwise_exp.py (opens in a new tab)examples/simple_matmul.py (opens in a new tab)references/api-translation.md (opens in a new tab)references/common-patterns.md (opens in a new tab)references/indexing-patterns.md (opens in a new tab)references/kernel-template.md (opens in a new tab)references/memory-patterns.md (opens in a new tab)references/nki-language-constraint.md (opens in a new tab)references/nkilib/core/allocator.md (opens in a new tab)references/nkilib/core/kernel-helpers.md (opens in a new tab)references/nkilib/core/subkernels/__init__.py (opens in a new tab)references/nkilib/core/subkernels/find_nonzero_indices.py (opens in a new tab)references/nkilib/core/subkernels/indexed_flatten.py (opens in a new tab)references/nkilib/core/subkernels/indexed_flatten_torch.py (opens in a new tab)references/nkilib/core/subkernels/layernorm_tkg.py (opens in a new tab)references/nkilib/core/subkernels/layernorm_torch.py (opens in a new tab)references/nkilib/core/subkernels/norm_tkg_utils.py (opens in a new tab)references/nkilib/core/subkernels/rmsnorm_mx_quantize_tkg.py (opens in a new tab)references/nkilib/core/subkernels/rmsnorm_tkg.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/neuron:neuron-nki-writing [operation, PyTorch/Numpy code, or existing kernel file]from neuron
neuron@tsvikas is listed by tsvikas/skills — review the source before installing
npx claudepluginhub tsvikas/skills --plugin neuron13 skills in this plugin
/neuron-explorer-profile-schemaReference for the neuron-explorer profile schema (the parquet tables produced
when `neuron-explorer view`/`ingest` processes a profile). Use when the user
asks "what tables are in the profile", "what fields are in <Table>", "where
does this field come from", "where can I find matmul/source-line info in the
schema", or wants to fetch the canonical schema YAML matching the installed
neuron-explorer version. Companion to /neuron-nki-profile-querying — that
skill writes SQL; this skill explains what the columns mean and where the
data originates.
/neuron-framework-autoportPort a HuggingFace model to NeuronX Distributed Inference for AWS Trainium/Inferentia.
Use when the user says "port model", "autoport", "convert to neuron",
"compile for trainium", or invokes /neuron-framework-autoport. Handles the full workflow:
knowledge base analysis, architecture analysis, NeuronX implementation,
compilation, inference testing, and accuracy validation (95%+ token match).
/neuron-framework-autoport-vllm-neuronPort a HuggingFace model architecture to the vLLM-Neuron Trainium2 backend. Handles architecture research, code generation, and validation./neuron-framework-equivalenceVerifies functional equivalence between two implementations of the same model using a hierarchical 8-stage algorithm. Orchestrates model tree comparison, component-level R-ratio testing, E2E logit comparison, and distributional checks. Use when porting models between frameworks, hardware targets, or precision regimes — e.g., HuggingFace to NxDI, PyTorch to ONNX, GPU to Neuron, FP32 to BF16, or any source-target pair./neuron-framework-profile-analysis-vllm-neuronIngests vllm-neuron model execution artifacts into parquet using
neuron-explorer and guides profile analysis: identifies
prefill/decode NEFFs, segments by collective boundaries,
computes per-engine bounds and DMA efficiency, and produces
structured workload reports.
Use when encountering "analyze profile", "ingest profile",
"query system trace", "what's the bottleneck",
"decode step time", "prefill breakdown",
"segment by layer", "DMA efficiency".
/neuron-framework-profiling-vllm-neuronGuides profiling vllm-neuron models on Trainium: capturing device (NTFF) and
system traces from a live server via vLLM's /start_profile and /stop_profile
endpoints (the primary method), or offline via `vllm bench throughput` +
`neuron-explorer capture` (fallback). Covers the neuron_profiler config,
steady-state decode capture, and the common traps.
Use when encountering "profile model", "benchmark vllm-neuron",
"profile running server", "start_profile", "stop_profile",
"profile live vllm serve", "capture NEFF from vllm", "get system trace",
"capture NTFF from model run", "get profiling artifacts", "profile decode step",
"profile MoE model", "per-rank profiling".
Other plugins' skills for the same job