/loom:loomfrom loom
Entry point for AMD Loom SDK work on AMD GPUs/NPUs (Strix Halo). Installs hrx-loom, serves catalog models, runs the demo web UI, ports LLMs to Loom IR, optimizes correctness/performance, and benchmarks against llama.cpp.
Ships in loom. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Bundled paths: first shell action. Before running commands, set LOOM_SKILL_DIR in the shell to the
absolute directory containing this SKILL.md, using its path from the skill listing or read tool.
In Claude Code, run export LOOM_SKILL_DIR="${CLAUDE_SKILL_DIR}" (the host substitutes the path).
In Codex, Pi or another host, export LOOM_SKILL_DIR to the loaded file's directory. Use a
shell-compatible absolute path (Git Bash on Windows). Rebind before using another skill's commands
and in every new shell; it is not the working directory or SDK root. On Windows, use native C:/...
paths for file tools; /c/... paths belong to Git Bash. Never run an unresolved placeholder. Run bundled commands by quoted absolute path; do not run scripts/... from the working directory
or change into the installed skill tree. Install the complete Loom suite: sibling paths are required.
Loom = AMD's JIT compiler + runtime + model server (hrx-loom, 0.2.0 pinned by these skills, from PyPI; source at
github.com/ROCm/hrx-system, models at github.com/ROCm/hrx-loom-library). Models
ship as Loom IR source (.loom kernels + command/control programs) plus a
package card (model.json) that points at unmodified checkpoints (GGUF or
safetensors). loom-serve compiles the program for the live device at startup
and exposes OpenAI-style HTTP endpoints.
Use the host's normal file and shell tools; no Claude-specific tool API is required. If subagents are available, delegate independent work with isolated files and ports. Otherwise run those steps serially, preserving every correctness gate and the same GPU memory/concurrency limits. For a fresh-agent evaluation, use a separate clean session rather than treating your current session as independent evidence.
| Task | Skill |
|---|---|
Install the SDK + library, fetch a catalog model, start/stop loom-serve, NPU serving | loom-setup |
| Browser playground (chat / ASR / TTS / image / embeddings) over running servers | loom-demo-ui |
| Make an arbitrary GGUF LLM servable by loom-serve (write the program; image input too when the repo ships a supported vision projector) | loom-port-llm |
Make a diffusers text-to-image model (DiT, text encoder, VAE) servable on /v1/images/generations; benchmark it against stable-diffusion.cpp, thenoise and diffusers | loom-port-image ("${LOOM_SKILL_DIR}/../loom-port-image/SKILL.md") |
| What is possible for this model? Pick optimization targets (roofline vs llama.cpp) | loom-roofline ("${LOOM_SKILL_DIR}/../loom-roofline/SKILL.md") |
| Make a ported model faster without breaking correctness | loom-optimize |
| Correctness gate vs llama.cpp, throughput methodology, reporting | loom-benchmark |
| A targeted fix to one model, family, GPU or quant (scoped change, sampled DevLab A/B, promotion) | loom-fleet ("${LOOM_SKILL_DIR}/../loom-fleet/reference/targeted-fix.md") |
| A campaign: new GPU, many models, a refactor (team roles, mailboxes, state files, DevLab rules, velocity) | loom-fleet ("${LOOM_SKILL_DIR}/../loom-fleet/reference/campaign.md") |
| Improve these skills themselves (faster end-to-end runs, fewer failures) without regressing KPIs | loom-fleet ("${LOOM_SKILL_DIR}/../loom-fleet/reference/skill-trials.md") |
| Populate a Hugging Face org with many models (pick the top models, port and publish each, sweep gates on DevLab, fix and regenerate) | loom-fleet ("${LOOM_SKILL_DIR}/../loom-fleet/reference/populate-org.md") |
| A new hrx-loom SDK release: migrate my package, the fleet or the skills (breaking changes per version pair, rewrite and parse/link sweep scripts, DevLab SDK A/B) | loom-migrate ("${LOOM_SKILL_DIR}/../loom-migrate/SKILL.md") |
| What is special about a model family / GPU / quant, which levers apply where (the knowledge base router) | loom-kb ("${LOOM_SKILL_DIR}/../loom-kb/SKILL.md") |
All paths in these skills assume the install root ~/loom (SDK venv ~/loom/.venv,
tools venv ~/loom/.tools). Substitute your own root consistently. The scripts take overrides:
LOOM_ROOT= (install root for port.sh, gates.sh, pick_llamacpp.sh), VENV= (serve.sh,
run_kernel_tests.sh), PY= (pick_llamacpp.sh's python), UI_VENV= or the 2nd argument
(start_ui.sh), LOOM_SERVE_STATE= (serve.sh PID/log dir) and LLAMACPP_STATE=
(llamacpp_server.sh PID/log dir). LOOM_RESERVED_GIB= is memory another resident server already holds
(e.g. a local agent model): pick_gguf.py and build.py subtract it from the 60 %-of-RAM cap.
PY= is the python fetch_llamacpp.sh uses (default python3). On a shared machine set the state dirs inside your work
dir and give pick_llamacpp.sh a SEARCH_ROOT (3rd argument) so it only sees builds the
user approved.
The whole pipeline (install, port, kernel tests, golden gate, perf, serve) works on Windows 11 on Strix Halo. Run the scripts from Git Bash. Differences:
Scripts/, not bin/. Read every ~/loom/.venv/bin/X
and ~/loom/.tools/bin/python in these skills as ~/loom/.venv/Scripts/X and
~/loom/.tools/Scripts/python. The scripts detect this themselves.hrx_loom-0.2.0-py3-none-win_amd64.whl); it needs the
Microsoft Visual C++ v14 x64 redistributable. --device=amdgpu reports driver: amd, backend: libamdf in /v1/status.install_loom.sh uses py -3 (override with PYTHON=). On Python < 3.15,
text files default to cp1252, so open text files with encoding="utf-8".ss, pgrep and /sys don't exist. Use these instead:
netstat -ano -p tcp | grep LISTENING;ps -W | grep -E 'loom-serve|llama-server';llama-server --list-devices shows the HIP-visible VRAM (91.6 GiB
on a 128 GB box with a 32 GiB BIOS carve-out).build.py symlinks the GGUF. Without Developer Mode it hard-links it instead,
which needs the package and the GGUF on the same drive.~/.cache/lemonade/bin/llamacpp/{rocm,rocm-stable,rocm-preview};
one missing its HIP/BLAS DLLs silently runs on CPU (llamacpp_server.sh refuses it, see loom-benchmark).Typical cold-start order: loom-setup → loom-port-llm (port.sh) → loom-benchmark
(qualify.sh: gates, baselines, roofline targets) → loom-optimize → finalize.sh.
Time budget. With no target and no time given, an end-to-end job ("get X working,
optimize it, report") gets this model's roofline budget for the whole job, first command to
published report (loom-roofline/e2e_budget.py: the pipeline's workload at this model's speed plus a
fixed allowance; qualify.sh gives optimization what is left, from the clock port.sh starts). A
stated time or target replaces it (BUDGET_H= / E2E_BUDGET_MIN=, loom-roofline section 0);
"optimize this model" on an existing port gets 30 min. Announce the targets and the budget
without asking, iterate in loom-optimize, and act on the verdict perf.py prints (CONTINUE /
REVIEW / BUDGET / DONE, loom-roofline section 5). Report met or short for each metric, with the
approach curve.
"Get X working, optimize it and report" is a single job. Run it without stopping:
K="${LOOM_SKILL_DIR}/.."; W=~/work/<name>; export LOOM_ROOT=~/loom LOOM_SERVE_STATE=$W/state
bash "$K/loom-setup/scripts/install_loom.sh" $LOOM_ROOT # only if $LOOM_ROOT/.venv/bin/loom-serve is missing
"$K/loom-port-llm/port.sh" <org>/<repo> $W 8160 # 1. port: download, inspect, build, serve, kernel tests, smoke (~1 min)
G=$(ls $W/gguf/*.gguf)
"$K/loom-benchmark/scripts/qualify.sh" $W/pkg http://127.0.0.1:8160 $G $W/bench # 2. llama.cpp pick, gates, baselines, roofline, budget
# # 3. optimize (loom-optimize) for the budget qualify printed
"$K/loom-benchmark/scripts/finalize.sh" $W/pkg http://127.0.0.1:8160 $G $W/bench # 4. final perf, full gates, audit, report.html
port.sh first looks up the closest category A loom-fun package (card made by the current
skill) and starts from it (loom-kb topic reference); REFERENCE=off ports from scratch.
port.sh stops with an exit code naming the stage that needs hand-work
(3: the chat template, or an architecture the starter doesn't cover). Then follow
loom-port-llm for that stage only, and continue with step 2 once the package
serves and its kernel tests pass.qualify.sh first picks the speculative-decoding method and depth by measured decode
speed (stage 0, draft/tune.py: none, the GGUF's MTP block, or a DFlash drafter port.sh found; n-gram is opt-in; it
rebuilds the package with the winner), then picks the fastest llama.cpp ROCm build on the machine, gives it
a speculative-decoding setting for local development (llama_spec_tune.py; card numbers follow
loom-benchmark/reference/methodology.md instead), measures
its baseline with Loom stopped, runs the gates (LEVEL=quick; llama.cpp references are filled
with Loom stopped), measures the Loom baseline, runs the roofline (targets + budget) and prints
QUALIFY_RESULT. A failing gate doesn't stop the measurements, but fix it before finalize.
Exit 4 NO_LLAMACPP: no installed llama.cpp runs this architecture. Ask the user once whether to
download a newer lemonade build (it needs their approval); otherwise continue Loom-only, and state
in the report that correctness is not verified against a reference. The roofline table
(bench/roofline.json) and the approach curve (bench/targets.jsonl) are
required in the report; this step creates both.loom-optimize), under the rate controller, for the budget printed
by qualify. After each kept change: rebuild, restart, perf.py, and
LEVEL=dev gates.sh (a few minutes: the llama.cpp references are cached), plus kernel tests for
changed kernels. The long gates (quick/full) run here only in qualify/finalize, and nightly in CI
on published cards (loom-benchmark, "Which level when").
Stop at BUDGET even if a lever is half done: revert to the last kept build.finalize.sh. It runs the full gates
(with the full-context probe), the final perf, audit.py (must print
AUDIT PASS) and writes bench/report.html + report.md from the logs. Add a
short notes file (what was optimized, what was skipped and why) with
report.py --notes, then publish report.html. A Hugging Face card (README.md, info.json, REPORT.md)
is generated from the same logs and the package's own files with loom-benchmark/scripts/card/
(loom-benchmark "Hugging Face model card"); never write card prose by hand.The budget is real: keep tool calls short, don't re-run a passing step, and don't
re-read files you already read. Long steps (qualify.sh, finalize.sh) print a
timestamp per stage (run them in the background with output to a log, then
loom-benchmark/scripts/wait_log.sh LOG '^QUALIFY_RESULT|^FINALIZE '; never until ! pgrep -f ..., which
matches itself); while one runs, prepare the next step instead of waiting idle: read,
write generator code, build packages. Don't use the GPU while they run (no A/B, perf or second
server until QUALIFY_RESULT): a Glimmer trial that ran A/Bs during qualify's gates slowed the
llama.cpp references (qualify 41 instead of ~30 min) and got A/B numbers too noisy to use.
Stop to ask only for what the hard rules require: a gated-license click, or approval of a binary from a source other than PyPI, the ROCm/hrx-system releases and lemonade-sdk/llamacpp-rocm. Avoid both where possible:
~/loom/.venv/bin/loom-serve (Windows: .venv/Scripts/loom-serve.exe) and the HF cache.pick_gguf.py does both (a cached UD-Q4_K_XL never beats Q4_K_M; the same quant cached under another repo, e.g.
bartowski/, stops the pick so you port that repo instead of downloading); don't override it with a bigger quant or download another copy. A Q8_0 27B decodes at half the
speed and needs ~28 GB; if the Q4 files use formats the starter lacks, add the formats instead.loom-benchmark/reference/methodology.md):
qualify.sh fetches the latest and picks the fastest (loom-benchmark section 0).The loom-roofline skill is at "${LOOM_SKILL_DIR}/../loom-roofline/SKILL.md".
Read it from there if it isn't in your skill list.
du -shL <weights> against cat /sys/class/drm/card*/device/mem_info_gtt_total
before serving anything big. The scripts load one model at a time (Loom is stopped while
llama.cpp runs), but starter/pick_gguf.py still keeps a GGUF that fits twice (a 40B repo's
UD-Q5_K_XL instead of its 39 GiB Q8_0) until quant choice accounts for the KV pool at full context.
A model whose resident set legitimately exceeds that default (a package that reads a big lookup table from the
GGUF on demand instead of keeping it resident: catalog.json memory.over_cap, loom-kb topic catalog-ports)
carries an explicit per-model budget; serve.sh and llamacpp_server.sh then run loom-setup/scripts/memcheck.sh
and refuse unless MemAvailable ≥ the budget + 16 GiB (LOOM_MEMORY_HEADROOM_GIB). Nothing else big may be resident.MemAvailable in /proc/meminfo exceeds that model's weights + KV + 16 GiB: a second flint
llama-server next to a 79 GB Loom server ran the machine out of RAM and the OOM killer took the
desktop session.findmnt -no FSTYPE /tmp prints tmpfs on these boxes, and agent scratchpads
can live there (for example /tmp/claude-*): every file there is held in memory, charged to the session that wrote
it. Keep packages, GGUF copies, kernel-test dumps (make_kernel_tests.py writes ~1.7 GiB of
embedding/head tables per 27B test dir) and anything over ~100 MB in a work dir on disk, not the
scratchpad. Delete a test dir's .npy dumps once its tests pass and an ablation package once its number
is recorded. Before serving, check du -sh of the scratchpad as well as MemAvailable.systemd-run --user --scope -p MemoryMax=<weights+KV+8G> CMD. When RAM runs out, systemd-oomd
kills the biggest cgroup: without a scope that is the editor/terminal holding every agent session.
A Qwen3.8-27B tune.py (52 GB server) on top of a 21 GB scratchpad of kernel-test dumps got the
whole VS Code scope (92 GB, all sessions) killed; rerun in its own scope, it finished.--pool_backing=fixed (no --memory_bytes) on Strix Halo and the R9700 (the preset's
context_capacity KV and the weights are committed up front; hrx-loom 0.2.0's elastic backing costs Strix prefill). To serve with the elastic
backing instead (several models sharing one budget with --parameter_idle_ms=60000), pass --memory_bytes (weights + KV pool + ~2 GiB
workspace); too small → HTTP 503 "retained state leaves insufficient completion capacity".install_loom.sh verifies release wheels and
fetch_llamacpp.sh checks the release archive digest before extracting it.Content-Type: application/json. (Python
requests with an empty Expect: header breaks the connection.)RESOURCE_EXHAUSTED ... user_queue_create(SDMA).
Stop servers you no longer need before kernel tests or a new server.loom-setup/scripts/stop.sh). pkill -f "...port..."
can match and kill your own shell.serve.sh refuses a
busy port and checks that its own PID owns the port before printing READY.
READY after about 1 s is normal, since compiled kernels are cached and weights
load on the first request. A stale server shows up as a READY from a PID that
isn't yours, or as old behavior.ss -ltnp; Windows: netstat -ano).--device='xdna://0?columns=8' --pool_backing=fixed). Only some
catalog models (e.g. Qwen3-Embedding-0.6B) run there, and it needed an older
SDK wheel (see loom-setup).loom-benchmark hardware counters are UNIMPLEMENTED on this GPU. Profile by
ablation (remove or double a kernel, measure end to end) instead.Another GPU: run python3 "${LOOM_SKILL_DIR}/../loom-kb/kb.py" list and route with --device (a key such as
gfx1150, or an alias such as strix-point); never reuse the numbers above. On a Strix Point laptop (gfx1150, Radeon 890M)
read loom-kb/device/rdna3/gfx1150/README.md before serving: with Ubuntu's default 8 MiB ulimit -l, serve with --parameter_mode=preload (the default mode fails
every weight load after registration reports ready; serve.sh does not add it yet), and --memory_bytes must fit the GTT
(mem_info_gtt_total, half of RAM by default), not 60 % of RAM. Pass roofline.py --device gfx1150.
git clone --depth 1 https://github.com/ROCm/hrx-system and open
loom/docs/src/.
guide/ covers the IR: values, buffers/views, kernels, vectors, facts,
and command programs.serving/model-programs.md covers package authoring.serving/workflows/fetch-and-serve.md and live-model-development.md
cover the serving workflows.workflows/test-correctness.md covers check.case tests.loom-test --agents_md,
loom-compile --agents_md, loom-serve --agents_md, loom-opt --agents_md,
loom-run --agents_md, loom-format --agents_md.library/program/text/qwen3_8/chat.loom is a ChatML control program with
<think> parsing, and library/model/*/ holds the cards.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub loom-fun/loom-skills --plugin loom11 skills in this plugin
/loom-benchmarkCorrectness and performance methodology for Loom models vs llama.cpp ROCm — golden token-by-token comparison with log-prob near-tie analysis, a multi-turn tool-calling (agent) gate, a native-context admission check, batching consistency, decode/prefill/long-context/concurrency throughput on real-text workloads, and how to report results honestly (tables, executive artifact). Use for "benchmark", "compare with llama.cpp", "is the port correct", "performance report"./loom-demo-uiStart and use the Loom Playground web UI (chat with streaming reasoning and tok/s, ASR with mic recording, TTS, image generation, embedding similarity) that proxies to one or more running loom-serve instances and discovers their models automatically. Use when the user wants a browser demo/UI for Loom models./loom-fleetRuns loom-skills fleet work - a targeted fix to one model, family, GPU or quant (scoped change, sampled DevLab A/B, promotion), a campaign (new GPU, many models, a refactor, regenerating cards), populating or extending a Hugging Face org with new models (pick the top models, port and publish each, sweep gates on DevLab), publishing, staging and promoting regenerated cards, and improving the loom skills themselves against the KPIs with fresh-agent trials. Use for "improve the loom skill", "make the loom skill faster or more reliable", "targeted fix", "campaign", "populate the org", "polish the HF org", "which models still need cards", "regenerate cards", "publish to staging", "fresh-agent trial", or any change to the skills in this repo./loom-kbRouter for the Loom knowledge base - which facts to read for a given model, GPU and task. Run `kb.py route` with a model slug or config, GGUF or arch name plus device and topic, then read exactly the files it prints (device, quant, arch family, facets, topic). Use before porting, optimizing, benchmarking or rooflining any model, when asking "what is special about gemma4 / qwen35moe / flint", "which tricks apply to this model on the R9700", or when adding a model family, facet, device or scope rule to the knowledge base./loom-migrateMigrates the loom-skills kit, fleet of model cards and skills to a new hrx-loom SDK release - research the release, apply the version entry's mechanical steps (IR renames, program ABI, card schema, install/pin), prove the fleet parses and links under the new SDK, A/B the old cards against the new packages on DevLab, publish qualifying cards directly and stage regressions, and record simplifications and optimization opportunities. Holds one entry per adjacent SDK pair (v0.1.0 to v0.2.0 first) and sweep and rewrite scripts. Use for "new Loom SDK", "migrate to hrx-loom X", "SDK upgrade", "port the fleet to a new SDK", "my package fails to parse or load on the new SDK", or "what changed between hrx-loom versions"./loom-optimizeMake a Loom LLM port faster (decode, prefill, long context, concurrency) while proving it stays correct — targets from the best published numbers and the roofline, real per-kernel profiles (HAL dispatch timestamps), bucket budgets, fuse-by-default designs tried in parallel, perf-only iteration rounds with gates once on the winner, and a lane that ends only when every lever has a measured stop reason. Use for "speed up", "beat llama.cpp / vLLM / leader X", "SOTA", "optimize prefill/decode" on a Loom model, or an optimization lane of a campaign.Other plugins' skills for the same job