simulate

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 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/axera-tech/magnetar/simulate
Any agent
npx skills add AXERA-TECH/Magnetar --skill simulate
Clone the repo
git clone --depth 1 https://github.com/AXERA-TECH/Magnetar

Made for: Claude Code, Codex.

Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 759 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00023 $0.00759
Opus 5 $0.00012 $0.00380
Sonnet 5 $0.00005 $0.00152
Haiku 4.5 $0.00002 $0.00076

Measured 2d ago against content hash 5e6b9ba6bf49, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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 Docker 仿真(分钟级)

输入/输出格式(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. 2d 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 19d ago), licensed MIT. It adds 23 tokens to every session and 759 once invoked, about $0.0001 per session on Opus 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

amc-run-rtsp-calibration

Calibrate a new dataset from live RTSP camera streams via the AutoMagicCalib REST API. Use when the user provides RTSP URLs or asks to calibrate live cameras; VIOS records clips, AMC ingests them, then runs calibration.

NVIDIA/skills · 59 tokens

deepstream-run-mv3dt

Run and operate the DeepStream Multi-View 3D Tracking reference app, also known as MV3DT. Use when the user asks to set up prerequisites, run shipped MV3DT samples, run Multi-View 3D Tracking on custom synchronized MP4 datasets, import camera calibration, delegate missing calibration to AutoMagicCalib, inspect OSD or…

NVIDIA/skills · 109 tokens

nvidia-skill-finder

Use for NVIDIA-related requests where an NVIDIA skill might help, even if the user did not ask for a skill. Trigger on NVIDIA products, hardware, software, SDKs, GPUs, Jetson/JetPack/L4T/BSP/SDK Manager/driver/flashing/setup, CUDA, NIM, NeMo, Omniverse/OpenUSD/SimReady, RAPIDS/cuDF, cuPyNumeric, cuOpt, Dynamo…

NVIDIA/skills · 140 tokens

doca-aes-gcm

Use this skill when the user is doing hands-on DOCA AES-GCM work on a BlueField DPU or ConnectX NIC — configuring docaaesgcmtaskencrypt / taskdecrypt, querying docaaesgcmcap for per-key-type (only DOCAAESGCMKEY128 / 256 — AES-192 not supported) and per-task support, sizing plaintext against the max-buf cap, setting…

NVIDIA/skills · 264 tokens

doca-common

Use this skill whenever the user is doing hands-on DOCA programming on a BlueField DPU or ConnectX NIC and needs the foundation primitives every per-library context rests on — walking the docactx lifecycle, discovering docadev / docadevinfo and gating on docacap before trusting a feature, wiring docammap /…

NVIDIA/skills · 242 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