imp
CLAUDE.md44 starsChanged 57 days agoMITView on GitHub
C++23/CUDA LLM inference engine for exactly one chip: NVIDIA Blackwell sm_120a (RTX 5090 / GB202, 32 GB GDDR7, 1792 GB/s, native FP4 tensor cores). No portability layer, no FP16 dequant fallback in the hot path. Narrative: docs/internals/ARCHITECTURE.md; what sm_120 lacks against datacenter Blackwell: docs/internals/SM120.md. This file is the router: rules for every task. Playbooks live in skills; a rule a skill also covers is maintained in the skill. Generic build and test commands live only here; directory CLAUDE.md files hold…
- Commits and pushes
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- tests/CLAUDE.mdCLAUDE.md
- add-model-archSkill
- benchmark-cudaSkill
- building-and-testingSkill
- check-degenerationSkill
- codebase-auditSkill
- code-graphSkill
- docs-layersSkill
- docs-syncSkill
- find-stubsSkill
- numerics-bisectSkill
- quant-formatsSkill
- server-apiSkill
- shipping-prsSkill
- sm120-cuda-expertSkill
The file
Files
<!--
layer: L3
audience: agents
verified: 2026-09-23
commit: 6ca7ee18
-->imp - Project Instructions
C++23/CUDA LLM inference engine for exactly one chip: NVIDIA Blackwell sm_120a (RTX 5090 / GB202, 32 GB GDDR7, 1792 GB/s, native FP4 tensor cores). No portability layer, no FP16 dequant fallback in the hot path. Narrative: docs/internals/ARCHITECTURE.md; what sm_120 lacks against datacenter Blackwell: docs/internals/SM120.md.
This file is the router: rules for every task. Playbooks live in skills; a rule a skill also covers is maintained in the skill.
Task -> entry point
| Task | Start here |
| Build, tests, CI red, dep bump | skill building-and-testing |
| Write/optimize a CUDA kernel | skill sm120-cuda-expert |
| Benchmark, profile, perf baseline | skill benchmark-cuda |
| Touched forward pass, MoE routing, KV cache, GDN state, graph capture | skill check-degeneration |
| Quant formats, loaders, dequant (GGUF, NVFP4, FP8) | skill quant-formats |
| imp-server, OpenAI/Anthropic HTTP API | skill server-api |
| New model architecture | skill add-model-arch |
| PR, merge, release | skill shipping-prs |
| Who calls/launches X, blast radius, still used | skill code-graph, before grepping |
Structure audit, dead code, File size gate red | skill codebase-audit; read docs/audit/SETTLED.md before forming hypotheses |
| Stub, ignored request field, dead kernel, test asserting nothing | skill find-stubs |
| Docs after a change | skill docs-sync |
Doc layer, header, PROV; docs/citations gate red | skill docs-layers |
| VRAM, ownership, lifetime | docs/internals/MEMORY.md first |
Generic build and test commands live only here; directory CLAUDE.md files hold area rules.
Doc layers (L0 README.md, L1 docs/*.md, L2 docs/internals/, L3 CLAUDE.md tree) are gated by scripts/docs_lint.py: root <= 2000 tokens, directory files <= 800, an L3 verified: more than 14 days behind the file's last commit is an error. Also canonical: AGENTS.md (subagent roles), docs/internals/BENCHMARKING.md (measurement contract), docs/internals/CPP23.md.
Build & test
- Before each GPU job (tests, benchmarks, profiling, inference) check the card is free. Criterion is load (utilization + used VRAM), not
docker ps: WDDM tenants never show there. Check: user-level skillgpu-stats(gpu-busy-check.sh, exit 0 = free). Busy: report and ask; no wait loop, no start anyway. - The host has no CUDA toolkit: build in Docker.
build/,build-dev/are root-owned:make dev-cleanor a throwaway container, neversudo.
make dev / make dev-test # incremental (seconds) + the CI lane (ctest -L unit): iterate here
make preflight # CPU only, run before every push: all CI static gates, tidy + format on changed lines, actionlint
make build # full image (minutes): anything measured or pushed
make verify-fast # pre-push gate, the only gate that runs a kernel against a check
make verify # full- Commit and push WITHOUT
--no-verify. Both hooks (make install-hooks) runmake preflight(CPU, Docker, ~20 s): all CI static gates, tidy + format on changed lines, actionlint. Exit 0 = every row ok or skip. GPU tests run only withIMP_HOOK_GPU=1; without it the hook prints the skipped GPU command. make test-unitis a different binary from the CI lane: green there is not green in CI. CI has no GPU. Target list and CI job names: skill building-and-testing.- Never bare
make format. CI checks changed lines only: format files you created; in edited files only your added lines.
Conventions
- English in the repo (PRs, commits, comments, docs); chat with the user in German. No em dashes in the repo.
- CHANGELOG: 1-3 lines and <= 360 characters per entry (gated) plus the number that makes it checkable; the investigation goes to
docs/. - Branch off
main,gh pr create --base main, never stack PRs; batch. - Perf is gated:
tests/perf_baseline.json(8 % decode / 8 % prefill). Refresh viascripts/gen_perf_baseline.shonly for an intentional move, and say so in the PR. - Runtime config is
RuntimeConfig(src/runtime/config.h:imp.conf+--config+--set). Env vars seeded into it:IMP_DETERMINISTIC,IMP_FMHA_FA2; intodiagnostics.*:IMP_SPEC_TRACE,IMP_JUMP_TRACE,IMP_PPL_DUMP,IMP_WORKER_TIMING. No ad-hoc env reads. - Dependency pins: only
cmake/imp-deps.cmake. Dockerfile: no--mount=type=cacheon the build dir (ninja reused stale objects, 03a2cc19); the content-addressedccachemount stays. - File size is gated on recompile blast radius: per file, per function body (> 500 code LOC hard), per translation unit (an
#included.cucounts against its includer). Exceptions go to[allow]with a reason:docs/audit/AUDIT_FILESIZE.md. - VRAM misleads rather than fails (WSL2/WDDM): a successful
cudaMallocproves nothing, measured bandwidth tells resident from spilled (#1103), free VRAM only decreases within a process. Capacity is planned, not discovered:docs/internals/MEMORY.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

