Magnetar: Skill for Codex

.codex/skills/magnetar/hidden/compile/SKILL.md

compile is a skill for Codex from AXERA-TECH/Magnetar. It costs 24 tokens per session (707 once invoked), scanned A, original, MIT.

A build step that converts static ONNX machine-learning models into AXMODEL files for Pulsar2 hardware. It can also prepare certain language models and record compilation results.

In plain words
What is it for?
Use it to compile fixed-shape ONNX models, build supported language models, prepare tokenizer and metadata files, and create compilation reports and cosine-similarity checks.
Why use it?
It turns model files into the format needed by the target hardware and records checks that help show whether the conversion worked. It also enforces required input and calibration settings.

Skill for Codex

Written for Codex: installed under .codex/.

This is AXERA-TECH/Magnetar's own configuration. It tells Codex how to work on Magnetar itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Magnetar configures →

Reuse

Borrowing it

Nothing to install: this file belongs to AXERA-TECH/Magnetar. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/AXERA-TECH/Magnetar/main/.codex/skills/magnetar/hidden/compile/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/AXERA-TECH/Magnetar

Made for: Codex.

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 compile

README.md
[![agentmods](https://agentmods.dev/badge/skills/axera-tech/magnetar/compile/github.svg)](https://agentmods.dev/skills/axera-tech/magnetar/compile)
Your own site
<a href="https://agentmods.dev/skills/axera-tech/magnetar/compile"><img src="https://agentmods.dev/badge/skills/axera-tech/magnetar/compile/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 compile

Your own site · 80×15
<a href="https://agentmods.dev/skills/axera-tech/magnetar/compile"><img src="https://agentmods.dev/badge/skills/axera-tech/magnetar/compile.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 707 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00024 $0.00707
Opus 5.5 $0.00010 $0.00283
Sonnet 5.5 $0.00005 $0.00141
Haiku 4.5 $0.00002 $0.00071

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

Security

Grade A, and why

compile 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 1mo ago.

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.

.codex/skills/magnetar/hidden/compile/SKILL.md · 49 lines

What it actually says

COMPILE

执行

magnetar.stages.compile.run(task_dir, target_hw, pulsar_image)

关键约束

  • highest_mix_precision 必须为 false
  • calibration_std 用 255(非 0.004)——Pulsar2 用 /std 公式
  • 编译前确认 ONNX 为静态 shape
  • 校准/输入格式先查 docs/input-format-cheatsheet.md(python magnetar/pulsar2_ref.py --cases),不要试新格式

LLM 分支(model_route=llm)

model_dir = magnetar.stages.llm.llm_build(task_dir, input_path=origin/<model>, chip=TARGET_HARDWARE, pulsar_image=..., max_context=..., prefill_len=..., weight_type=s8|s4, hidden_state_type=bf16)

内部流程:

  1. pulsar2 llm_build2 直接编译 HuggingFace 权重 → compile/llm_out/: 逐层 *_l%d_*.axmodel + *post*.axmodel + model.embed_tokens.weight.bfloat16.bin, 自带逐层 decode/prefill cosine 校验(日志 cos_sim is: X);
  2. ensure_axllm_build_tools 克隆 ax-llm-build,embed_process.sh 处理 embedding;
  3. 组装 compile/llm_model_dir/:config.json(axllm 字段:tokenizer_type、 template_filename_axmodel、axmodel_num、filename_post_axmodel、 filename_tokens_embed、tokens_embed_num/size)+ tokenizer + axmodel + post_config.json + model_meta.json;
  4. 生成 export/model_meta.json(route=llm,compile_cosine 取逐层 cosine 统计: min/mean/all_ge_0_99)与 compile/compile_report.md。

失败处理:llm_build2 报架构/head_dim/算子不支持 → 回退 EXPORT 调整参数或拆分, 仍失败 STOP 由用户决定是否回退通用 ONNX 路径;逐层 cosine < 0.99 → 回退 COMPILE 重试(weight_type s8→s4、bf16→fp16、调 max_context/prefill)。

验证

  • compile/model.axmodel 存在且非空
  • compile/compile_report.md 含 MACs、大小、压缩比、编译耗时
  • LLM 分支:compile/llm_model_dir/ 含 config.json + tokenizer + 逐层/post axmodel + embedding bin;export/model_meta.json compile_cosine.min ≥ 0.99

STOP

  • Pulsar2 编译失败且需改 ONNX → 退回 EXPORT
  • 输入预处理配置与导出验证不一致
  • LLM 分支:llm_build2 不可用(Pulsar2 < 6.0)→ blocked;不支持架构且用户未定回退方向
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. 1mo ago First seen · 49 lines · 24 tokens per session scan A d2718486d77f

Subscribe to this mod's changes

compile is a skill published in the GitHub repository AXERA-TECH/Magnetar (22 stars, last pushed 1mo ago), licensed MIT. It adds 24 tokens to every session and 707 once invoked, about $0.0001 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-08-30.

Related

Other skills, from other repositories

spark-training-gotchas

Preflight and diagnose the ten known failure modes for ML training on NVIDIA DGX Spark. Use when a training run on DGX Spark fails to start, OOMs below the 128GB limit, slows down mid-run, or before any multi-hour training job on GB10.

wshobson/agents · 63 tokens

chief-data-officer-advisor

Chief Data Officer advisory for startups: AI training data rights and consent provenance, data product strategy (warehouse vs lakehouse vs mesh, build-vs-buy), B2B customer-data-as-asset valuation and M&A readiness, data team org evolution. Use when deciding whether to train models on customer data, choosing data…

alirezarezvani/claude-skills · 131 tokens

foundry-config-setup

Resolve missing setup caused by a hardcoded Foundry project endpoint or model in a sample. Use when a sample fails because it uses a placeholder/hardcoded projectendpoint (for example "https://your-project.services.ai.azure.com") or a hardcoded model instead of reading them from the environment.

microsoft/agent-framework · 65 tokens

cdf-anomalygen

Use when running the CDF AnomalyGen pipeline over a defect dataset — mask placement, fine-tuning, synthetic defect-image generation (SDG), evaluation, quality refinement, and pseudo-labeling — even when the user names only one stage.

NVIDIA/skills · 54 tokens

cdf-event-video-generation

Run the CDF Orchestration Event Video Generation DAG on Kubernetes or OSMO - image-to-video anomaly generation, auto-labeling, and anomaly dataset generation. Select for requests about event video generation, anomaly video generation, image-to-video synthesis, Cosmos3 image2video, anomaly dataset creation…

NVIDIA/skills · 167 tokens

deepstream-sop

Use this skill when building, deploying, evaluating, debugging, or measuring latency for the DeepStream SOP Inference Microservice — a GPU-accelerated FastAPI service that detects whether operators perform assembly-line steps in order via event boundary detection (GEBD) plus VLM classification. Trigger even if the…

NVIDIA/skills · 219 tokens