Magnetar: Skill for Codex

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

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

A validation stage that compares an AI model's reference results with results from AXera hardware or its simulator. ONNX is a portable format for storing machine-learning models.

In plain words
What is it for?
Use it to validate regular models with layer-by-layer similarity checks, or language models with hardware serving and basic response checks.
Why use it?
It checks whether the converted model produces sufficiently similar outputs and records the comparison results.

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/simulate/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 simulate

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/axera-tech/magnetar/simulate"><img src="https://agentmods.dev/badge/skills/axera-tech/magnetar/simulate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 764 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.00023 $0.00764
Opus 5.5 $0.00009 $0.00306
Sonnet 5.5 $0.00005 $0.00153
Haiku 4.5 $0.00002 $0.00076

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

Security

Grade A, and why

simulate 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/simulate/SKILL.md · 45 lines

What it actually says

SIMULATE

执行

metrics = magnetar.stages.simulate.run(task_dir, sample, pulsar_image, board=board, target_hw=TARGET_HARDWARE)

内部逻辑:

  1. 计算 ONNX 参考输出
  2. 有板必上板:BOARD 已配置直接用;未配置时先 magnetar.board_util.select_board(TARGET_HARDWARE, BOARD_PASSWORD) 找空闲板
  3. 上板:先 ensure_remote_infer(board) 确保 ax-remote-infer 已装(18500 通就跳过,未装自动静默安装),再上传模型,/opt/bin/ax_run_model 直接跑(秒级),下载结果与 ONNX 对比
  4. 仅当找不到板或板端失败:回退 pulsar2 run 本地仿真(独立包,分钟级)

输入/输出格式(bin 命名、input_list、reshape)一律用 magnetar/io_format.py,规范见 docs/input-format-cheatsheet.md。

LLM 分支(model_route=llm)

不再对比 ONNX vs AXMODEL 张量,改为:

  1. 有板必上板:magnetar.stages.llm.install_axllm(board)(ax-llm install.sh, 已装则跳过)→ serve_axllm(board, compile/llm_model_dir, port=8000) 启动 OpenAI 兼容服务 → validate_chat("http://127.0.0.1:8000", model_name, prompts≥3, expected_keyword=None) greedy 语义验证,记录响应非空 / completion_tokens / 耗时;写 simulate/simulate_report.md(LLM 版:逐层 cosine + 语义验证指标);
  2. 无板回退:用 llm_build2 --check_level 2 --prompt <prompt> 自带全模型校验, _extract_cosims(log) 提取 decode/prefill 逐层 cosine 写入报告;板端语义验证 留到 RUNONBOARD,报告标注 N/A。

验收(accuracy_gate / llm_route_acceptance):逐层 cosine min ≥ 0.99; 有板时语义验证全非空。

验证

  • cosine_similarity ≥ 0.99
  • MAE、max_abs_diff 记录在 simulate_report.md
  • ≥3 组输入样本,报告均值 ± 标准差
  • LLM 分支:逐层 cosine min ≥ 0.99 + 有板时 ≥3 组 prompt 语义验证全非空

STOP

  • cosine < 0.99:先查 issues/ 目录已知修复;INT8/U16/混合精度全部尝试仍不达标时,STOP 前先向用户提议上 QAT(必须用官方 AXERA-TECH/QAT.axera,走 QAT→QDQ ONNX,需训练数据/时间,用户确认后进入)
  • AXMODEL 输出全零/异常 → 检查校准归一化配置
  • LLM 分支:axllm serve 无法启动 → 检查安装/模型目录/内存;仍失败 STOP
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 Changed 70204579320f
  2. 1mo ago First seen · 45 lines · 23 tokens per session scan A 5e6b9ba6bf49

Subscribe to this mod's changes

simulate is a skill published in the GitHub repository AXERA-TECH/Magnetar (22 stars, last pushed 1mo ago), licensed MIT. It adds 23 tokens to every session and 764 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

jetson-video-pipeline

Use when planning, executing, and independently validating Jetson Video Codec SDK or PyNvVideoCodec encode/decode, transcode, segmentation, container decode, AV1, or concise acceptance workflows.

NVIDIA/skills · 45 tokens

jetson-validate-image

Use after jetson-flash-image to run static BSP checks, on-target smoke/regression tests on a flashed DUT, or both. Not for build or flash steps. Triggers: validate bsp, on-target validation.

NVIDIA/skills · 50 tokens

holohub-app-lifecycle

Use for non-failing HoloHub app work with ./holohub: scaffold, build, run, test, visual evidence, lint, and flow benchmarking.

NVIDIA/skills · 40 tokens

add-scored-audit

Add a new executable scored check (PASS/WARN/FAIL) for a requirement to a hardware-as-code project's audit harness. Use when a requirement, clearance, mass budget, margin, or anchor needs to be verified automatically. Enforces the rules: read the build's exported JSON artifacts, never duplicate a geometry constant…

JMMonte/agentic-digital-twin · 88 tokens

foundry-hosted-agent-validation

Step-by-step process for validating a Python Foundry hosted agent sample (under python/samples/04-hosting/foundry-hosted-agents/) end to end — running it locally (native runtime and azd ai agent run) and after deploying it to an Azure AI Foundry project with azd. Use this when asked to validate a hosted agent sample.

microsoft/agent-framework · 82 tokens

g-assist-mcp-skill

Use this skill to check or change this machine's NVIDIA display and GPU settings, such as resolution, refresh rate, V-Sync, G-SYNC, brightness, color, and GPU performance.

NVIDIA/skills · 47 tokens