Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add aws-neuron/neuron-agentic-development --skill neuron-nki-mxfp8-moe-config-tuninggit clone --depth 1 https://github.com/aws-neuron/neuron-agentic-developmentWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/aws-neuron/neuron-agentic-development/neuron-nki-mxfp8-moe-config-tuning)<a href="https://agentmods.dev/skills/aws-neuron/neuron-agentic-development/neuron-nki-mxfp8-moe-config-tuning"><img src="https://agentmods.dev/badge/skills/aws-neuron/neuron-agentic-development/neuron-nki-mxfp8-moe-config-tuning/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/aws-neuron/neuron-agentic-development/neuron-nki-mxfp8-moe-config-tuning"><img src="https://agentmods.dev/badge/skills/aws-neuron/neuron-agentic-development/neuron-nki-mxfp8-moe-config-tuning.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00276 | $0.10868 |
| Opus 5.5 | $0.00110 | $0.04347 |
| Sonnet 5.5 | $0.00055 | $0.02174 |
| Haiku 4.5 | $0.00028 | $0.01087 |
Grade A, and why
neuron-nki-mxfp8-moe-config-tuning scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 543 lines — stays where its author put it; the contents beside it link to each section on GitHub.
MXFP8 MoE Kernel Config Tuning
How to use (for people)
1. Where it runs. On the Trn3 instance that runs your training, in its Python environment
(same neuronx-cc, nkilib and torchtitan-neuron). Kernel timings and even legality change
across compilers; a harness on another fleet or compiler tunes a different kernel.
2. Tell the agent your training run:
| input | example |
|---|---|
| the training command | your torchrun ... -m torchtitan.train --module ... --config ... (e.g. a 128-expert MoE cut to 6 layers, TP4 FSDP16 EP64, SAC, SimpleFSDP, MXFP8 NKI experts) |
| the experts converter | `NeuronMXFP8GroupedExpertsConverter.Config(quant_scheme="1x32" |
| (optional) an existing tuning JSON | a JSON for the same or a similar run (e.g. from examples/): it is re-measured as a seed |
3. You get back: tuned.ntt.json (the converter's tuning_path file) with
tuned.provenance.json; the training config out (the command plus how tuning_path is set);
step time and loss of baseline / tuned / baseline from the same instance.
Budget (one trn3.48xlarge): ~70 min of kernel search for MoE-128E-dense-EP (6 layers, EP64
dense experts; two sites, ~470 measurements), plus ~4-6 training runs (~20 min each). Measured
results: references/validation.md (round 1: 1x32 step -40%; round 2: wrapX + full-count search,
another -7% step, 1.80x vs untuned 1x32).
Fixed for every run: the training config, numerics and loss chunking stay as given (Scope rules).
Model labels used below (MoE-128E-dense-EP, MoE-128E-routed, MoE-32E-biased-swish, MoE-64E-shared)
describe the measured models by their traits; references/validation.md defines them.
The rest of this file is the procedure the agent follows.
Core principles
General kernel-tuning principles, applied to a kernel whose phases interact:
- Tune the calls the run makes. Capture them (shapes, block size, routed/dense, quant scheme,
static/dynamic blocks) from a real run, and replay them through torchtitan-neuron's own ops
(
mxfp8_moe_fwd/mxfp8_moe_bwdwithtuning=<the JSON text>), so the kernel config is built by the framework's ownparse_tuning->_fwd_config/_bwd_config. Every set knob is checked to reach the kernel config (hits). - Tune in the training environment. Same instance image, same compiler, same nkilib.
- The phases interact: search them jointly. One-phase-at-a-time from the default
(coordinate descent from one point) misses wins that only appear on top of another phase's
change (e.g. phase-4 DMA transposes turn tiling winners into losers). Every neighbor round
holds the other phases at the best measured map, and the
fusedstage measures combinations of the top entries of the phases that gained most. - Routed only: screen cheap, decide exact. A routed kernel unrolls ceil(T*top_k/B)+E blocks; the exact MoE-128E-routed backward compiles for ~20-30 min. Screening runs on a proxy call with E/8 experts and T/8 tokens: the same rows per expert, so each block does the same work, ~8x fewer blocks. Finals re-measure the top maps on the exact call.
- Medians of interleaved repeats, never single samples. Finals: >= 3 reps, rep-major.
- Correctness on every job. Each output is compared with the kernel's default-config output (cosine >= 0.9995, rel <= 2%) and an fp32 CPU reference (error <= 1.25x the default's).
- The training step decides. A kernel saving can be off the critical path; A/B the shipped JSON against bracketing baselines, and check the converter log line and the loss.
What ships with it
25 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- examples/moe-128e-dense-ep64_tp4_1x32.ntt.json 3.3 KB
- examples/moe-128e-routed_tp2_sac_b512_inplace.ntt.json 1.2 KB
- examples/moe-32e-biased-swish_tp2_bf16w.ntt.json 1.5 KB
- examples/moe-64e-shared_tp4_bf16w.ntt.json 1.5 KB
- examples/README.md 2.4 KB
- references/method.md 1.7 KB
- references/moe_results_table.md 3.8 KB
- references/moe-mxfp8.md 4.4 KB
- references/routed_moe_tp2_report.md 6.0 KB
- references/step_decomposition.md 10 KB
- references/validation.md 16 KB
- scripts/ingraph_moe.py 4.7 KB runs code
- scripts/kct_worker.py 11 KB runs code
- scripts/kct.py 101 KB runs code
- scripts/moe_capture/sitecustomize.py 8.4 KB runs code
- scripts/moe_json.py 2.2 KB runs code
- scripts/moe_routing.py 3.9 KB runs code
- scripts/plugins/__init__.py 806 B runs code
- scripts/plugins/moe_mxfp8.py 56 KB runs code
- scripts/setup_env.sh 7.5 KB runs code
- scripts/step_profile.py 8.0 KB runs code
- scripts/tests/data/real_dump_moe128e_routed_tp4.jsonl 2.0 KB
- scripts/tests/test_moe_mxfp8_plugin.py 33 KB runs code
- scripts/tests/test_step_profile.py 4.5 KB runs code
- scripts/titan_ab.py 5.8 KB runs code
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- today First seen · 543 lines · 276 tokens per session scan A cf22a38f8071
neuron-nki-mxfp8-moe-config-tuning is a skill published in the GitHub repository aws-neuron/neuron-agentic-development (72 stars, last pushed yesterday), licensed Apache-2.0. It adds 276 tokens to every session and 10,868 once invoked, about $0.0011 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-12-01.
neuron-nki-mxfp8-moe-config-tuning compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| neuron-nki-mxfp8-moe-config-tuningaws-neuron/neuron-agentic-development | Skill | 72 | yesterday | Apache-2.0 | A | 276 | Claude Code |
| spark-environment-setupwshobson/agents | Skill | 43k | yesterday | MIT | A | 76 | Claude Code |
| spark-memory-thermal-opswshobson/agents | Skill | 43k | yesterday | MIT | A | 59 | Claude Code |
| spark-training-gotchaswshobson/agents | Skill | 43k | yesterday | MIT | A | 63 | Claude Code |
| inference-serving-llama-cppdavila7/claude-code-templates | Skill | 35k | yesterday | MIT | A | 80 | Claude Code, Codex |
| supercomputertrycua/cua | Skill | 33k | today | MIT | A | 0 | Claude Code, Codex |
| amc-run-rtsp-calibrationNVIDIA/skills | Skill | 4.2k | today | Apache-2.0 | A | 59 | Claude Code, Codex |