neuron-framework-autoport

A workflow for adapting a Hugging Face model from PyTorch on NVIDIA GPUs to PyTorch with Neuron support on AWS Trainium or Inferentia chips. It covers dependency setup, architecture review, implementation, and compilation steps.

In plain words
What is it for?
Use it when porting, auto-porting, or compiling a Hugging Face model for Trainium or Inferentia, including dry-run preparation.
Why use it?
It provides a defined process for moving a model to AWS hardware with the required Neuron libraries and checks. A dry run can inspect the setup without compiling or running inference.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/aws-neuron/neuron-agentic-development/neuron-framework-autoport
Any agent
npx skills add aws-neuron/neuron-agentic-development --skill neuron-framework-autoport
Clone the repo
git clone --depth 1 https://github.com/aws-neuron/neuron-agentic-development

Made for: Claude Code, Codex.

Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,196 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 2 findings. Scan, not verified.
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 $0.00094 $0.02196
Opus 5 $0.00047 $0.01098
Sonnet 5 $0.00019 $0.00439
Haiku 4.5 $0.00009 $0.00220

Measured 2d ago against content hash 34bb0f548ce5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade D, and why

neuron-framework-autoport scanned grade D with 2 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 2d ago.

The scan reads SKILL.md. This mod also ships 14 executable files (assets/example_gptoss_usage.py, assets/example_phi3_usage.py, assets/example_phimoe_usage.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.

Unrestricted tool accessmediumExcessive agency

A wildcard tool grant or "run any command" leaves no least-privilege boundary at all.

- **Do not run any code** — no compilation, inference, or validation (no Trainium hardware available)

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

2. Delete compiled model: `rm -rf agent_artifacts/data/compiled_model && rm -rf /var/tmp/neuron-compile-cache`
skills/neuron-framework-autoport/SKILL.md · 130 lines

How it starts

The opening of the file, as written. The whole thing — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Model Porting

Overview

This document provides the agent direct instructions on how to port a model from pytorch and running on NVIDIA GPU to pytorch/Neuron running on Trainium. The agent will be expected to follow these steps below.

Pay attention to the success criteria, do not stop, or declare that you are done until you meet the complete success criteria

Dry-run

When the user specifies dry-run:

  • Skip the "Resolve Dependencies" step
  • Run these commands to activate the venv and resolve source paths:
    export PATH=<pathToVenv>/bin:$PATH
    NXDI_SRC=$(python3 -c "import neuronx_distributed_inference; print(neuronx_distributed_inference.__path__[0])")
    NXD_SRC=$(python3 -c "import neuronx_distributed; print(neuronx_distributed.__path__[0])")
    TRANSFORMERS_SRC=$(python3 -c "import transformers; print(transformers.__path__[0])")
    
  • Do not run any code — no compilation, inference, or validation (no Trainium hardware available)

Before You Start

Set User Invocation Directory

USER_INVOCATION_DIR="$(pwd)"

Resolve Dependencies

Follow references/setup_flow.md. It handles venv validation, install consent, and exit code recovery. Do not proceed until it completes successfully.

After success, retain the 3 resolved paths from the script output for use throughout the workflow:

Variable Description
${NXDI_SRC} Path to NeuronX Distributed Inference source
${NXD_SRC} Path to NeuronX Distributed source
${TRANSFORMERS_SRC} Path to HuggingFace Transformers source

Read Project Guidelines

READ references/systemPrompts/systemPrompt.md in this skill directory. It contains prerequisites (including version checks), project guidelines, tool documentation, debugging support, codebase navigation, and hardware context. Run all prerequisite checks and follow all guidelines throughout the workflow.

Porting Parameters

Extract these six required parameters from the user's request before starting:

Read the full file on GitHub · 130 lines

Files

What ships with it

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

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. 2d ago First seen · 130 lines · 94 tokens per session scan D 34bb0f548ce5

Subscribe to this mod's changes

neuron-framework-autoport is a skill published in the GitHub repository aws-neuron/neuron-agentic-development (56 stars, last pushed 14d ago), licensed Apache-2.0. It adds 94 tokens to every session and 2,196 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it D with 2 findings (unrestricted tool access, recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

add-macos-statusbar

Add a macOS menu bar status indicator for NanoClaw. Shows a bolt icon with a green/red dot indicating whether NanoClaw is running, with Start, Stop, and Restart controls. macOS only.

nanocoai/nanoclaw · 49 tokens

cli-anything-3mf

3MF mesh geometry editor — detect and resize cylindrical holes, repair meshes, compare 3D printing files. Works with BambuStudio and PrusaSlicer 3MF files.

HKUDS/CLI-Anything · 44 tokens

platform-port

Guide porting FastLED to new MCU platforms, including int.h types, clockless drivers, SPI implementations, and platform detection. Use when adding support for a new microcontroller family or board.

FastLED/FastLED · 42 tokens

doca-compress

Use this skill for hands-on DOCA Compress programming on a BlueField DPU, ConnectX NIC, or host with DOCA — enabling compress-deflate, decompress-deflate, decompress-lz4-stream, or decompress-lz4-block tasks on a docacompress context (the hardware supports DEFLATE both directions plus LZ4 decompress; LZ4 encode is NOT…

NVIDIA/skills · 242 tokens

pcbway

PCBWay PCB fabrication and assembly — turnkey/consigned assembly, design rules, ordering workflow. Alternative to JLCPCB for manufacturing. Use with KiCad. Use this skill when the user mentions PCBWay, needs turnkey assembly (PCBWay sources parts by MPN), has parts not available on LCSC, needs assembled boards with…

aklofas/kicad-happy · 119 tokens

anta-validation

Validate Arista EOS network state with structured pass/fail verdicts using ANTA. Use for "is this switch healthy", "did my change break anything", "verify BGP/interfaces/hardware are correct", "run a health check on this device". Read-only. A test for a feature the device does not run reports notapplicable — never a…

automateyournetwork/netclaw · 84 tokens