RDK OE-LLM Quantize (S-series)

SKILLAI 工具
AI 工具 未标注权限 许可证不明确
安装这个技能

PTQ quantize an LLM or VLM with D-Robotics OE-LLM into an `.hbm` and pack a board-ready bundle for RDK S100 / S100P / S600. Use for calibration prep, Vision/Text compile, cosine verification, or packaging.

一句话选型结论

按资料字段整理

RDK OE-LLM Quantize (S-series)是AI 工具类的 Agent Skill,安装方式未标注,权限级别未标注,许可证不明确,有可直接复制的安装命令。技能本质是给模型读的说明书,效果取决于模型与客户端;装完先用一个小任务验证,再放进正式流程。

分类AI 工具 安装方式未标注 权限级别未标注权限 许可证许可证不明确
累计安装 未标注 本周 未标注
GitHub 星标 未标注 仓库 未标注
下载量 未标注 技能市场下载数
权限级别 未标注权限 安装前请确认风险范围
许可证 许可证不明确 未说明

安装

未标注
在支持 Skills 的客户端里执行,装完问一句「你有哪些技能」验证
skillhub install user_171341e7/rdk-oellm-quantize-s-series
  1. 1
    确认客户端支持

    确认你的客户端支持 Skills(Claude、Codex、Cursor 等),并升级到较新的版本。

  2. 2
    拿到技能文件

    执行上面的命令安装;也可以把仓库里的 SKILL.md 手动放进客户端的 skills 目录。

  3. 3
    刷新技能列表

    重新打开客户端,或刷新技能列表,让新放进来的技能被加载。

  4. 4
    验证是否生效

    问一句「你有哪些技能」,确认列表里出现它,再拿一个小任务试跑。

技能档案

AI 工具
字段来自技能仓库与公开索引,中文说明由本站标注
作者 / 维护方user_171341e7仓库 未标注 · 版本 未标注
宿主客户端未标注技能可被这些客户端加载
安装方式未标注安装包 community
权限级别未标注权限安装前请确认风险范围
许可证未说明许可证不明确,商用前请自行确认条款
仓库可用性available技能仓库当前是否可访问
最近核验未标注上游最后核验时间 · 数据更新 1791624462
正文体量14.2 KBSKILL.md 原文大小,越大说明说明书写得越细

典型使用场景

3 类
按分类整理的常见用法,具体以 SKILL.md 为准
组合多个 AI 能力

把写作、检索、总结串成一条流程。

搭工作流

把固定流程做成可重复调用的步骤。

做提示词与评测

整理提示词并对比输出效果。

选择建议

装之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有可直接复制的安装命令,不用自己翻文档找入口。

先想清楚的地方

  • 没有标注权限级别,实际能做什么要装好后确认。
  • 许可证不明确,商用或二次分发前先到仓库确认条款。
  • 没有做站内核验,内容以作者仓库为准。
  • 技能只是说明书,实际效果取决于模型与客户端,装完先用小任务试一遍。

更适合

  • 需要在AI 工具场景里给模型补一套做法的人。
  • 愿意先读一遍 SKILL.md、确认它会让模型做什么的人。

不太适合

  • 对许可证要求很严、必须明确可商用的人。
  • 只想装完就自动变强、不打算看说明书的人。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
技能权限级别安装方式累计安装宿主客户端安装命令
RDK OE-LLM Quantize (S-series)当前 未标注权限 未标注 未标注 未标注 有
执行计划 只读 GitHub 仓库 151.5 万 Codex、Claude、Cursor 有
Playwright MCP 测试 浏览器控制 ClawHub 市场 136.5 万 OpenClaw 有
完成前的验证 未标注权限 GitHub 仓库 131.9 万 Codex、Claude、Cursor 有
子 Agent 驱动开发 只读 GitHub 仓库 131.2 万 Codex、Claude、Cursor 有
前端设计 执行命令 GitHub 仓库 125.6 万 Codex、Claude、Cursor 有

SKILL.md 全文

14.2 KB
模型实际读到的说明书原文,来自技能仓库

OE-LLM Quantize & Deploy on RDK S-Series

<!--
SPDX-License-Identifier: Apache-2.0
Copyright (c) 2026 shockley6668
-->

Purpose

Turn a HuggingFace LLM / VLM checkpoint into an OE-LLM .hbm (Hobot BPU model) that runs on an RDK S-series board. The skill owns the host-side PTQ pipeline: environment sanity check, calibration data preparation, Vision / Text compile, cosine verification, and packaging. It stops at the tarball; the on-board runtime (hbdk4_runtime) is out of scope.

When To Use

Activate when the user's task involves any of:

  • "quantize / compile / PTQ" a model for RDK S100 / S100P / S600
  • "run oellm_build.py" or "leap_llm" against a HuggingFace model
  • prepare calibration data (COCO images for Vision, prompt JSON for Text)
  • verify cosine similarity between float and quantized outputs
  • pack .hbm + tok_embeddings.bin + tokenizer into a board bundle
  • upload the artefacts to HuggingFace Hub

Do NOT use for:

  • on-board C++ / Python inference wiring (that's a board-side skill)
  • ONNX-based tool-chains — OE-LLM ingests PyTorch nn.Module via leap_llm, not ONNX
  • training or LoRA fine-tuning

Prerequisites

  • Host machine. Ubuntu 22.04, x86_64, ≥ 64 GB RAM (128 GB recommended — Text decode compile peaks at ~100 GB RSS), ≥ 300 GB free disk, optional CUDA GPU for faster Vision calibration.
  • OE-LLM SDK 1.0.0. Obtained from D-Robotics — a tarball containing oellm_build/requirements.txt, hbdk4_compiler-*.whl, hbdk4_runtime_aarch64-*.whl, leap_llm-*.whl.
  • HuggingFace checkpoint. config.json + model.safetensors + tokenizer files, downloaded ahead of time (some models are gated — request access first).
  • leap_llm model adapter. SDK-shipped leap_llm covers common backbones; families the SDK does not know (e.g. Gemma4) need a community adapter dropped into leap_llm/models/&lt;family&gt;/ and registered in leap_llm/apis/model/model_factory.py. See references/model-adapter-checklist.md.
  • Board march string. Must match the target — do not guess. nash-e = S100, nash-m = S100P, nash-p = S600. Getting this wrong produces an HBM the board rejects at load.

Instructions

1. Confirm the target board and pick the right march

Ask the user which board they are targeting and select march from references/board-march-map.md. Never proceed past this step until confirmed — this is the single most common misconfiguration and every downstream artefact bakes it in.

2. Set up the environment

# Create the OE-LLM conda env once per host.
conda create -n oellm python=3.10 -y
conda activate oellm

cd /path/to/D-Robotics_LLM_S&lt;version&gt;_SDK/oellm_build
pip install -r requirements.txt
pip install hbdk4_compiler-*.whl
pip install leap_llm-*.whl
# hbdk4_runtime_aarch64-*.whl is board-side, install on the board, not the host.

Install order matters: requirements.txt pins the PyTorch line that hbdk4_compiler and leap_llm are built against.

If the model family is not in stock leap_llm, drop the adapter into $(python -c &quot;import leap_llm, os; print(os.path.dirname(leap_llm.__file__))&quot;) — see references/model-adapter-checklist.md.

3. Prepare calibration data

Calibration decides how well PTQ scales fit the deployment distribution. Get this wrong and you will chase a "board outputs garbage" bug that has nothing to do with the compile.

Vision (VLM only): 50 real, diverse images. Do not use synthetic solid-colour blocks — we hit exactly this failure and the fix was 50 COCO val2017 photos.

python3 scripts/download_coco_calib_images.py \
  --output-dir ./calibration_data/images --count 50

Text: 100–200 varied prompts (multi-language, multi-length, multi-topic) in the OE-LLM JSON format.

python3 scripts/gen_text_calib_json.py \
  --output ./calibration_data/text/calibration.json --count 150

Full layout: references/calibration-data-layout.md.

4. Compile Vision (skip for pure LLM)

bash scripts/run_vision_compile.sh \
  --march &lt;nash-e|nash-m|nash-p&gt; \
  --model-name &lt;e.g. gemma4-e2b-vision&gt; \
  --input-model ./&lt;hf_checkpoint_dir&gt; \
  --output-dir ./output/&lt;name&gt;_vision \
  --calib-image-dir ./calibration_data/images \
  --device cuda:0 --vit-core-num 1

The wrapper sets ulimit -s unlimited (mandatory — compile_hbo can segfault otherwise), disables stdout buffering, and tees to a log. Expect ~110 min for a 16-layer ViT on a single core; compile_hbo is single-threaded CPU work, HBDK_JOBS does not speed it up.

Artefacts (output/&lt;name&gt;_vision/):

File Size Ship to board?
*_vit_ptq.hbm ~300–500 MB ✅
*_vit_ptq.bc / .convert.bc / .hbo ~1 GB total ❌ intermediate

5. Compile Text

bash scripts/run_text_compile.sh \
  --march &lt;nash-e|nash-m|nash-p&gt; \
  --model-name &lt;e.g. gemma4-e2b-text&gt; \
  --input-model ./&lt;hf_checkpoint_dir&gt; \
  --output-dir ./output/&lt;name&gt;_text \
  --calib-text ./calibration_data/text \
  --chunk-size 256 --cache-len 4096 --core-num 1 \
  [--hbdk-jobs 25] [--enable-swap] [--memlimit-gb 110]

Text decode compile peaks at ~100 GB RSS. On a 128 GB machine, the wrapper accepts --enable-swap (creates 64 GB swap via scripts/setup_swap.sh) and --memlimit-gb (uses prlimit --as) to keep OOM from taking down the host. HBDK_JOBS here is host-side compile parallelism, unrelated to on-board BPU core count.

Artefacts (output/&lt;name&gt;_text/):

File Size Ship to board?
*_lm_chunk_&lt;cs&gt;_cache_&lt;cl&gt;_ptq.hbm ~4–5 GB ✅
tok_embeddings.bin ~1.5 GB ✅ (external embedding table)
prefill/decode .bc / .hbo ~60+ GB total ❌ intermediate

tok_embeddings.bin is exported automatically by Gemma4TextApi.__init__ (and equivalent apis for other families) as weight * embed_scale. It stays outside the HBM because a 262k×1536×4B ≈ 1.5 GB embedding table is inefficient to bake into a BPU program — runtime does the lookup and √hidden scaling on CPU.

6. Verify cosine similarity

Run verifier_cli.py against the exported BC to compare quantized vs float output.

# Vision BC vs float
python3 scripts/verify_vision.py \
  --model-name &lt;e.g. gemma4-e2b-vision&gt; \
  --model-dir ./&lt;hf_checkpoint_dir&gt; \
  --quant-bc ./output/&lt;name&gt;_vision/*_vit_ptq.bc \
  --image ./calibration_data/images/&lt;one_image&gt;

# Text BC vs float
python3 scripts/verify_text.py \
  --model-name &lt;e.g. gemma4-e2b-text&gt; \
  --model-dir ./&lt;hf_checkpoint_dir&gt; \
  --quant-bc ./output/&lt;name&gt;_text/*_ptq.prefill.bc \
  --out ./output/&lt;name&gt;_text/verify_text.json

A healthy PTQ run lands in the 0.95–0.99 cosine range per branch. Anything under 0.90 means the calibration set is not representative — go back to step 3 before touching compile flags.

Reference measurement on Gemma4-E2B / S100P (nash-m): Vision 0.9888, Text 0.9540. See references/verification-guide.md for the interpretation table.

7. Pack the board bundle

bash scripts/pack_deploy_bundle.py \
  --vision-hbm ./output/&lt;name&gt;_vision/*_vit_ptq.hbm \
  --text-hbm ./output/&lt;name&gt;_text/*_ptq.hbm \
  --tok-embeddings ./output/&lt;name&gt;_text/tok_embeddings.bin \
  --tokenizer-dir ./&lt;hf_checkpoint_dir&gt; \
  --out ./deploy_bundle

Bundle layout:

deploy_bundle/
├── model/
│   ├── &lt;name&gt;_vit_ptq.hbm
│   ├── &lt;name&gt;_lm_chunk_256_cache_4096_ptq.hbm
│   └── tok_embeddings.bin
└── tokenizer/
    ├── tokenizer.json
    ├── tokenizer_config.json
    ├── chat_template.jinja        # if the model has one
    └── config.json

Then sha256sum deploy_bundle/model/*.hbm deploy_bundle/model/*.bin &gt; deploy_bundle/SHA256SUMS so the board side can verify what it downloaded.

8. (Optional) Publish to HuggingFace Hub

hf auth login                              # once per host
hf upload &lt;user&gt;/&lt;repo&gt; ./deploy_bundle . --repo-type model

If your host is behind a slow link to huggingface.co, exporting HTTPS_PROXY before hf upload gives a 5–10× speedup on typical corporate networks.

Output Contract

After running, produce:

  • one .hbm per compiled branch (Vision, Text) with correct --march
  • tok_embeddings.bin alongside the Text HBM
  • a deploy_bundle/ matching the layout above, with SHA256SUMS
  • a short report listing: model name, board target + march, chunk/cache sizes, per-branch cosine, calibration image count and prompt count, total bundle size

Available Scripts

Script Purpose Key args
scripts/run_vision_compile.sh Wrap oellm_build.py for a VLM Vision branch --march, --model-name, --vit-core-num
scripts/run_text_compile.sh Wrap oellm_build.py for LLM / Text branch, with swap/memlimit guards --march, --chunk-size, --cache-len, --enable-swap, --memlimit-gb
scripts/download_coco_calib_images.py Pull N real COCO val2017 images for Vision calibration --output-dir, --count
scripts/gen_text_calib_json.py Emit an OE-LLM Text calibration JSON with diverse prompts --output, --count, --extra
scripts/verify_vision.py Cosine similarity: Vision BC vs float --model-name, --quant-bc, --image
scripts/verify_text.py Cosine similarity: Text BC vs float --model-name, --quant-bc, --out
scripts/pack_deploy_bundle.py Assemble the board tarball layout + sha256 --vision-hbm, --text-hbm, --tokenizer-dir
scripts/setup_swap.sh One-shot 64 GB swap file (invoked by run_text_compile) —

Examples

Case A — LLM on S600 (nash-p), no Vision.

bash scripts/run_text_compile.sh \
  --march nash-p --model-name qwen2-7b-text \
  --input-model ./qwen2-7b --output-dir ./output/qwen2_7b_text \
  --calib-text ./calibration_data/text --chunk-size 512 --cache-len 8192
bash scripts/pack_deploy_bundle.py \
  --text-hbm ./output/qwen2_7b_text/*_ptq.hbm \
  --tok-embeddings ./output/qwen2_7b_text/tok_embeddings.bin \
  --tokenizer-dir ./qwen2-7b --out ./deploy_bundle

Case B — VLM on S100P (nash-m), Vision + Text (the Gemma4-E2B reference).

bash scripts/download_coco_calib_images.py --output-dir ./calibration_data/images --count 50
bash scripts/run_vision_compile.sh --march nash-m --model-name gemma4-e2b-vision \
  --input-model ./gemma4-e2b --output-dir ./output/gemma4_e2b_vision \
  --calib-image-dir ./calibration_data/images --device cuda:0
bash scripts/run_text_compile.sh --march nash-m --model-name gemma4-e2b-text \
  --input-model ./gemma4-e2b --output-dir ./output/gemma4_e2b_text \
  --calib-text ./calibration_data/text --chunk-size 256 --cache-len 4096
bash scripts/pack_deploy_bundle.py \
  --vision-hbm ./output/gemma4_e2b_vision/*_vit_ptq.hbm \
  --text-hbm ./output/gemma4_e2b_text/*_ptq.hbm \
  --tok-embeddings ./output/gemma4_e2b_text/tok_embeddings.bin \
  --tokenizer-dir ./gemma4-e2b --out ./deploy_bundle

Limitations

  • Compile-only. Does not run inference on the board or validate end-to-end token output.
  • march is user-supplied. There is no runtime check that the string matches the connected board.
  • Vision compile assumes a ViT-shaped encoder. Audio branches (Conformer, e.g. Gemma4 audio) are not covered — treat as out of scope until a matching leap_llm adapter is written.
  • --enable-swap writes a 64 GB file to /swapfile and calls sudo swapon. Only run on hosts you own.
  • Cosine ≥ 0.99 does not guarantee correct end-to-end text; end-to-end verification requires running the bundle on a real board, which lives in the board-side skill.

Troubleshooting

See references/troubleshooting.md for the full pit-log. The top five, distilled:

Symptom Root cause Fix
compile_hbo segfaults early Default stack limit too small ulimit -s unlimited before invoking (wrapper does this)
conda run … log stays empty conda run buffers stdout Use conda activate oellm &amp;&amp; PYTHONUNBUFFERED=1 python -u … \| tee log
Vision compile pins one core, HBDK_JOBS ignored compile_hbo is single-threaded CPU by design for ViT Not a bug — expect ~110 min on a fast core
Text decode OOM, host thrashes Peak ~100 GB RSS run_text_compile.sh --enable-swap --memlimit-gb 110
Board outputs gibberish though cosine is high Calibration set unrepresentative (synthetic images, English-only prompts, etc.) Re-calibrate with real data — this fixed our VLM

References

  • references/board-march-map.md — S100 / S100P / S600 ↔ nash-e / nash-m / nash-p (verified against SDK docs)
  • references/calibration-data-layout.md — directory shape and format for Vision/Text calibration data
  • references/model-adapter-checklist.md — what to add under leap_llm/models/&lt;family&gt;/ when the SDK does not ship your architecture
  • references/gemma4-adapter-walkthrough.md — file-by-file dissection of the reference Gemma4 adapter (2.7k LOC); use this as the concrete template when porting a new family
  • references/vlm-fusion-notes.md — soft-token id substitution, external tok_embeddings.bin, PLE-style per-layer inputs, image-token embedding replacement — for debugging on-board VLM output
  • references/verification-guide.md — how to read cosine numbers and what to change if they are too low
  • references/troubleshooting.md — full failure catalog from the Gemma4-E2B / S100P bring-up

常见问题

5 问
答案由本站依据条目字段整理
RDK OE-LLM Quantize (S-series)怎么安装?

在支持 Skills 的客户端里执行:skillhub install user_171341e7/rdk-oellm-quantize-s-series。安装方式为未标注。装完刷新技能列表或重开客户端。

RDK OE-LLM Quantize (S-series)支持哪些客户端?

资料没有标注宿主客户端,但只要客户端支持 Skills(Claude、Codex、Cursor 等),一般都能加载。

RDK OE-LLM Quantize (S-series)权限高吗,安全吗?

权限级别为未标注权限。安装前先看它会读取或写入哪些内容。

RDK OE-LLM Quantize (S-series)收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于技能本身和所用的模型或客户端,正式使用前按作者说明确认。

RDK OE-LLM Quantize (S-series)用什么许可证?

许可证标注为 未说明(许可证不明确)。商用或二次分发前请到仓库确认条款原文。

热门专题

按场景挑技能
全部专题 →

技能内容以作者仓库为准;分类、权限级别与许可证状态的中文说明为中文整理,最近核验 未标注。