neuron-nki-mxfp8-moe-config-tuning

neuron-nki-mxfp8-moe-config-tuning is a skill for Claude Code from aws-neuron/neuron-agentic-development. It costs 276 tokens per session (10,868 once invoked), scanned A, original, Apache-2.0.

A tuning workflow for MXFP8 mixture-of-experts kernels in torchtitan training on AWS Trainium. Mixture-of-experts models route each input through a selected subset of expert networks; the workflow searches their kernel settings and measures the result.

In plain words
What is it for?
Use it to tune expert forward and backward kernels, produce a tuning JSON file, and apply that file to a torchtitan training configuration.
Why use it?
It replaces guesswork about kernel settings with measurements from the same chip, compiler, and training environment. It compares baseline and tuned runs using step time and loss.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: positional $N argument.

Good fit Use it to tune expert forward and backward kernels, produce a tuning JSON file, and apply that file to a torchtitan training configuration.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aws-neuron/neuron-agentic-development/neuron-nki-mxfp8-moe-config-tuning
Install

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.

Any agent
npx skills add aws-neuron/neuron-agentic-development --skill neuron-nki-mxfp8-moe-config-tuning
Clone the repo
git clone --depth 1 https://github.com/aws-neuron/neuron-agentic-development

Made for: Claude Code.

Wrote 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.

agentmods badge for neuron-nki-mxfp8-moe-config-tuning

README.md
[![agentmods](https://agentmods.dev/badge/skills/aws-neuron/neuron-agentic-development/neuron-nki-mxfp8-moe-config-tuning/github.svg)](https://agentmods.dev/skills/aws-neuron/neuron-agentic-development/neuron-nki-mxfp8-moe-config-tuning)
Your own site
<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.

agentmods 80×15 button for neuron-nki-mxfp8-moe-config-tuning

Your own site · 80×15
<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>
Per session 276 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 10,868 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured today against content hash cf22a38f8071, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

The scan reads SKILL.md. This mod also ships 13 executable files (scripts/ingraph_moe.py, scripts/kct_worker.py, scripts/kct.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/neuron-nki-mxfp8-moe-config-tuning/SKILL.md · 543 lines

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:

  1. 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_bwd with tuning=<the JSON text>), so the kernel config is built by the framework's own parse_tuning -> _fwd_config / _bwd_config. Every set knob is checked to reach the kernel config (hits).
  2. Tune in the training environment. Same instance image, same compiler, same nkilib.
  3. 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 fused stage measures combinations of the top entries of the phases that gained most.
  4. 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.
  5. Medians of interleaved repeats, never single samples. Finals: >= 3 reps, rep-major.
  6. 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).
  7. 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.

Read the full file on GitHub · 543 lines

Changes

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.

  1. today First seen · 543 lines · 276 tokens per session scan A cf22a38f8071

Subscribe to this mod's changes

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.

Related

neuron-nki-mxfp8-moe-config-tuning compared with skills from other repositories

neuron-nki-mxfp8-moe-config-tuning next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
neuron-nki-mxfp8-moe-config-tuningaws-neuron/neuron-agentic-developmentSkill72yesterdayApache-2.0A276Claude Code
spark-environment-setupwshobson/agentsSkill43kyesterdayMITA76Claude Code
spark-memory-thermal-opswshobson/agentsSkill43kyesterdayMITA59Claude Code
spark-training-gotchaswshobson/agentsSkill43kyesterdayMITA63Claude Code
inference-serving-llama-cppdavila7/claude-code-templatesSkill35kyesterdayMITA80Claude Code, Codex
supercomputertrycua/cuaSkill33ktodayMITA0Claude Code, Codex
amc-run-rtsp-calibrationNVIDIA/skillsSkill4.2ktodayApache-2.0A59Claude Code, Codex