j6-plugin-quantization

j6-plugin-quantization is a skill for Claude Code, Codex from HorizonRobotics/OE-Skills. It costs 123 tokens per session (3,678 once invoked), scanned A, original, Apache-2.0.

Um gerador de código para preparar modelos de aprendizagem automática para quantização no hardware Horizon J6. Quantização reduz a precisão numérica do modelo para permitir a execução no dispositivo; QAT significa treino consciente da quantização.

In plain words
What is it for?
Serve para inserir operações de quantização, configurar observadores, preparar o modelo, calibrá-lo e, opcionalmente, treiná-lo com QAT. A saída pode ser usada pelo processo de exportação e compilação HBDK.
Why use it?
Evita montar manualmente as várias fases entre um modelo de ponto flutuante, a calibração e o treino QAT. Também obriga a definir a plataforma J6 antes de gerar o fluxo.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Serve para inserir operações de quantização, configurar observadores, preparar o modelo, calibrá-lo e, opcionalmente, treiná-lo com QAT. A saída pode ser usada pelo processo de exportação e compilação HBDK.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/horizonrobotics/oe-skills/j6-plugin-quantization
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 HorizonRobotics/OE-Skills --skill j6-plugin-quantization
Clone the repo
git clone --depth 1 https://github.com/HorizonRobotics/OE-Skills

Made for: Claude Code, 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 j6-plugin-quantization

README.md
[![agentmods](https://agentmods.dev/badge/skills/horizonrobotics/oe-skills/j6-plugin-quantization.svg)](https://agentmods.dev/skills/horizonrobotics/oe-skills/j6-plugin-quantization)
Your own site
<a href="https://agentmods.dev/skills/horizonrobotics/oe-skills/j6-plugin-quantization"><img src="https://agentmods.dev/badge/skills/horizonrobotics/oe-skills/j6-plugin-quantization.svg" alt="Measured on agentmods" height="20"></a>
Per session 123 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,678 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.00123 $0.03678
Opus 5 $0.00062 $0.01839
Sonnet 5 $0.00025 $0.00736
Haiku 4.5 $0.00012 $0.00368

Measured 7d ago against content hash 3c1d1b9b4610, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

j6-plugin-quantization 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 7d 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.

horizon/skills/plugin/j6-plugin-hbdk-generating/j6-plugin-quantization/SKILL.md · 329 lines

How it starts

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

基础结构量化流程代码生成

目标

根据用户提供的浮点模型结构,生成量化流程代码,从 set_march 到 QAT 训练完成。生成后的代码可直接运行(在正确安装了 horizon_plugin_pytorchhbdk4 的环境中)。

本 Skill 覆盖的流程:

set_march → 定义模型(含 Quant/DeQuant)→ 配置量化参数 → prepare → 校准 → [可选] QAT 训练

量化流程的输出取决于用户选择:

  • 仅校准:输出 calib_net
  • 校准 + QAT:输出 qat_net

j6-hbdk-export-compile skill 消费。

第一步:确认信息

在生成代码前,必须确认以下信息。march 是必选项,必须由用户明确指定,不能擅自假设默认值。如果用户未指定且无法交互(如 eval 场景),则使用 "nash-p" 作为默认值,不得自行选择其他 march。

必须询问:march(目标平台)

向用户询问目标平台,给出以下选项:

march 平台 说明
"nash-p" J6P 推荐,全局激活支持 float16
"nash-h" J6H 全局激活支持 float16
"nash-m" J6M 全局激活为 qint8
"nash-e" J6E 全局激活为 qint8
"nash-b" J6B 全局激活为 qint8

如果用户未指定,暂停代码生成,等待用户确认。不同的 march 会影响全局激活类型的选择:

  • nash-p / nash-h:推荐全局激活 torch.float16
  • nash-m / nash-e / nash-b:推荐全局激活 qint8

必须询问:校准后是否进行 QAT 训练

向用户询问校准后的流程选择:

选项 说明
仅校准(calib-only) 校准后直接导出,速度快,适合精度要求不高的场景
校准 + QAT 训练(calib+qat) 校准后重新 prepare 并进行 QAT 训练,精度更高,推荐用于精度敏感场景

两种选项的代码差异:

仅校准:校准完成后,输出 calib_net,后续由 j6-hbdk-export-compile 直接 export。

校准 + QAT:校准完成后,使用 MinMaxObserver 重新 prepare 浮点模型,执行 QAT 训练,输出 qat_net

可选确认(用户未提供时使用默认值)

信息 默认值 说明
模型结构 Conv+BN+ReLU+Linear 基础网络结构
输入 shape (1, 3, 32, 32) 示例输入大小
是否有自定义量化配置 是否需要指定某些层使用 qint16 等

第二步:生成代码 — 按步骤组织

Step 1: 导入

import torch
import torch.nn as nn
from horizon_plugin_pytorch.quantization import QuantStub
from torch.quantization import DeQuantStub
from horizon_plugin_pytorch import set_march
from horizon_plugin_pytorch.quantization import (
    prepare, set_fake_quantize, FakeQuantState,
    QconfigSetter, get_qconfig, qint8, qint16,
)
from horizon_plugin_pytorch.quantization.observer_v2 import HistogramObserver, MinMaxObserver
from horizon_plugin_pytorch.quantization.qconfig_setter import (
    ModuleNameTemplate, ConvDtypeTemplate, MatmulDtypeTemplate,
)

注意: 当本 sub-skill 作为 j6-plugin-hbdk-generating(编排型 skill)的一部分被调用时,导入语句必须与导出编译子 skill 的导入合并到文件顶部的一个统一导入块中,格式严格遵循 references/full-pipeline-template.md

Read the full file on GitHub · 329 lines

Files

What ships with it

1 file 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. 7d ago First seen · 329 lines · 123 tokens per session scan A 3c1d1b9b4610

Subscribe to this mod's changes

j6-plugin-quantization is a skill published in the GitHub repository HorizonRobotics/OE-Skills (19 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 123 tokens to every session and 3,678 once invoked, about $0.0006 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

spark-environment-setup

Set up a working ML training/inference environment on NVIDIA DGX Spark (GB10, aarch64, CUDA 13). Use when installing PyTorch/Unsloth/TRL/vLLM on DGX Spark, hitting libcudart or wheel-ABI errors on aarch64, or choosing between NGC containers and bare pip installs.

wshobson/agents · 76 tokens

spark-memory-thermal-ops

Manage unified memory and thermals during long-running ML jobs on NVIDIA DGX Spark. Use when planning memory headroom for a training run on GB10, when a job OOMs on unified memory, or when monitoring temperature and power during multi-hour training.

wshobson/agents · 59 tokens

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

llama-cpp

Runs LLM inference on CPU, Apple Silicon, and consumer GPUs without NVIDIA hardware. Use for edge deployment, M1/M2/M3 Macs, AMD/Intel GPUs, or when CUDA is unavailable. Supports GGUF quantization (1.5-8 bit) for reduced memory and 4-10× speedup vs PyTorch on CPU.

davila7/claude-code-templates · 76 tokens

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

amc-run-video-calibration

Calibrates pre-recorded cam.mp4 datasets through the AutoMagicCalib REST API. Use for user-supplied local MP4s; route live RTSP streams to amc-run-rtsp-calibration.

NVIDIA/skills · 57 tokens