Skip to content

Releases

rooflab v0.6.1

Choose a tag to compare

@scientist42-lab scientist42-lab released this 04 Dec 20:32

Highlights

rooflab v0.6.1 is a patch release focused on making the existing v0.6.0 llama.cpp CUDA, speculative decoding, and 1-warp GPU stochastic sampler patchset (0 register spills across sm_80/86/89/90/120, 1.6713x geometric speedup and -40.80% J/tok across 13 suites on RTX 3090) reproducible and buildable in 4 copy-paste commands on upstream ggml-org/llama.cpp.

Zero new kernel or model features beyond v0.6.0 are introduced in this release.

4-Command llama.cpp CUDA Quickstart

# 1. Clone upstream llama.cpp at the exact tested base commit (tag b12631)
git clone https://github.com/ggml-org/llama.cpp && git -C llama.cpp checkout e300919cc704ddde3a8a8346a8714f57eeeee71b

# 2. Apply the verified v0.6.0 cumulative patchset (strict --whitespace=error check)
bash scripts/apply_patches.sh ./llama.cpp

# 3. Build llama-server, llama-cli, and llama-bench (auto-detects GPU arch via nvidia-smi, or set CUDA_ARCH=86)
bash scripts/build_cuda.sh ./llama.cpp

# 4. Launch llama-server (replace build-sm86 with your detected build-sm<arch> directory)
ORION_DISABLE_R2_SM86=1 ./llama.cpp/build-sm86/bin/llama-server \
  -m /path/to/model.gguf -ngl 99 -fa on -c 16384 -b 1024 -ub 1024 \
  --cache-type-k q8_0 --cache-type-v q8_0 --backend-sampling \
  --host 127.0.0.1 --port 8080

What Changed

  • Verified Single-Pass Cumulative Patch (patches/rooflab_v060_cumulative.patch): Exported against exact upstream ggml-org/llama.cpp commit e300919cc704ddde3a8a8346a8714f57eeeee71b (b12631, 149 files, SHA-256 0df716f93827b1630c14081fc2ba10cd24dcab96881552d10817e6eef71d5d1a), verified clean under git apply --check --whitespace=error and git apply -R --check while preserving all 43 archival slice patches in patches/ for per-slice review and surgical git apply -R bisection.
  • Reproducible Patch Script (scripts/apply_patches.sh): Supports idempotent forward apply, --check dry-run verification, and --reverse (-R) clean rollback back to stock llama.cpp.
  • Multi-Arch CUDA Builder (scripts/build_cuda.sh): Ninja CUDA builder supporting explicit CUDA_ARCH via CLI/env or automatic nvidia-smi compute-capability detection (8.0->80, 8.6->86, 8.9->89, 9.0->90, 12.0->120), -DGGML_CUDA=ON -DGGML_CUDA_FA_ALL_QUANTS=ON -DGGML_CUDA_GRAPHS=ON -DLLAMA_BUILD_TOOLS=ON, and optional sccache/ccache and mold via command -v (keeping configs/rtx-3090/build_rtx3090.sh intact).
  • Documentation & CLI Fixes: Added the top-of-README 4-command Quickstart, pinned the exact 40-char upstream base SHA and archival stack order in patches/MANIFEST.md, fixed --backend-sampling -bs 1 -> --backend-sampling across docs/RTX3090_PRESETS.md, and bumped package metadata (pyproject.toml, rooflab/__init__.py, CITATION.cff, CHANGELOG.md) to 0.6.1.
  • CI Reliability Fix (tests/test_strix_halo_kit.py): Made test_power_sampler_rapl_fallback deterministic via baseline-read polling and atomic os.replace updates, eliminating a timing race on loaded macOS CI runners.

Verification

  • Fresh /tmp clean-apply + idempotent + --reverse roundtrip on e300919cc704ddde3a8a8346a8714f57eeeee71b: PASS
  • From-scratch Ninja CUDA build (scripts/build_cuda.sh, sm_86): [413/413] PASS, 0 spill stores/loads across 1,071/1,071 audited custom/patched kernels, RTX 3090 smoke check (gemma-4-E2B Q8_0 -bs 1: tg128 = 386.44 +/- 3.14 t/s, pp128 = 10,351.67 t/s, VmSwap = 0 kB)
  • All 4 repository gates PASS: 431/431 unit tests OK, scripts/repo_integrity_check.py 0 findings, scripts/privacy_audit.py 0 findings, ledger verify 92 entries ok: true
  • GitHub Actions 3-OS CI (ubuntu-latest, macos-latest, windows-latest x Python 3.10/3.12 + Full Forensics): 8/8 green

rooflab v0.6.0

Choose a tag to compare

@scientist42-lab scientist42-lab released this 03 Dec 23:08

rooflab v0.6.0

Zero-dependency hardware roofline toolkit, GGUF weight-space inspector, paired AB/BA statistical certification gate, and 0-spill CUDA/speculative/GPU-sampler llama.cpp patchset (43 total landed patches, verified across 5 NVIDIA architectures sm_80/86/89/90/120 and 3-OS CI on Linux, macOS, and Windows).

Highlights

1. 8 New 0-Spill CUDA, Speculative Decoding & 1-Warp GPU Sampler Patches (patches/ 22..26)

All 8 kept v0.6.0 patches stack cleanly atop 00..20 with 0 register spills across sm_80/86/89/90/120, 0 NaNs, VmSwap = 0 kB, and 15/15 counterbalanced N=6 AB/BA RTX 3090 wins (p_perm <= 0.0312):

  • Patch 22 (22_qwen_gdn_sublayer_f16state.patch): Qwen3.x GDN sublayer fusion (F32 lossless default, 80/80 5-arch 0 spills) plus opt-in -cts f16 state compression (-72 MiB VRAM on Qwen/Qwen3.8-27B, -30 MiB on 35B).
  • Patch 22b (22b_soa32_qwen_triple_and_grouped_verify.patch): IQ4_XS register-only PRMT LUT, carry-free half-IDP4A Q6_K, and CUDA-Graph-safe grouped MUL_MAT_ID verify (empero-ai/Qwen3.8-35B-A3B-Distill MTP K=6 +11.39%, MTP K=3 warm 400.05 t/s).
  • Patch 23 (23_inkling_loop_megakernel.patch): Inkling-2-Mini 48L coalesced SoA and loop super-fusion (905/905 5-arch 0 spills, 133.56 t/s, 2.223x vs stock).
  • Patch 24 (24_gemma4_e2b_e4b_persistent_mega.patch): Gemma-4-E2B/E4B persistent PLE megakernel and direct Q8_1 short FlashAttention (1,010/1,010 5-arch 0 spills, 18/18 bit-exact: E2B 398.07 t/s, E4B 231.54 t/s, G4-26B 279.26 t/s).
  • Patch 25a (25a_spec_labd_lookup_fusion.patch): Lossless LABD lookup+draft fusion and DFlash2 tree verification (Gemma-4-26B MTP K=6 395.08 t/s +7.85%, -9.61% J/tok, 6/6 exact).
  • Patch 25b (25b_mtp_draft_vocab_d2t.patch + patches/build_d2t_sidecar.py): 100% opt-in lossless runtime d2t draft-vocabulary lm_head sidecar (6.06x smaller draft head; Qwen/Qwen3.8-27B MTP K=6 +14.72% cold / +21.27% code edit, empero-ai/Qwen3.8-35B-A3B-Distill MTP K=3 +7.48% cold, 6/6 exact).
  • Patch 25c (25c_direct_q8_mq_fattn_verify.patch): Direct Q8_0 KV multi-query FlashAttention verify for B=4..16 (40/40 5-arch 0 spills, 6/6 bit-exact).
  • Patch 26 (26_gpu_stochastic_sampler_1warp.patch): 1-warp GPU-resident stochastic sampler (temp, top_k, top_p, min_p) eliminating full-vocab logit PCIe D2H on stochastic chat (40/40 5-arch 0 spills; OpenAI -bs T=0.7 top_p=0.9: Gemma-4-26B +59.01% vs stock, empero-ai/Qwen3.8-35B-A3B-Distill +65.65% vs stock, 6/6 greedy exact).
  • Honest Negative Proof (Reverted Patch 21): 21_lfm25_400plus_megakernel passed 5-arch 0-spill and 6/6 exact parity checks yet regressed -1.23% end-to-end on LFM2.5-24B Q8_0 KV inside the 38-layer CUDA Graph; cleanly reverted via git apply -R and not shipped.

2. Full 15-Suite RTX 3090 Cumulative Matrix & 4-GPU Cross-Arch Calibration

  • RTX 3090 v0.6.0 Cumulative (15/15 p_perm <= 0.0312, VmSwap = 0 kB, 0 NaNs):
    • 9 Plain B=1 models: 1.5974x geometric mean speedup, -38.24% mean J/tok.
    • 4 Speculative suites: 1.8504x geometric mean speedup, -46.54% mean J/tok.
    • All 13 schema benchmarks: 1.6713x geometric mean speedup, -40.80% mean J/tok, plus +59.01% / +65.65% OpenAI T=0.7 stochastic chat wins.
  • 4-GPU Cross-Arch rooflab fit Calibration (RTX 5090 sm_120, RTX 4090 sm_89, RTX 3090 sm_86, NVIDIA L4 sm_89): 22/22 live counterbalanced AB/BA wins (1.536x geo, -36.38% mean J/tok), reducing rooflab fit MAPE from 21.10% raw to 7.47% per-arch calibrated MAPE (8.4% pooled, 10.5% LOGO-CV).

3. Cross-OS CI, Packaging & Release Hygiene

  • Full 8/8 green GitHub Actions matrix across ubuntu-latest, macos-latest, and windows-latest (Python 3.10 and 3.12), verifying zero-numpy stdlib execution and native CPU probe compilation on all three operating systems.
  • Aligned package metadata (pyproject.toml, rooflab/__init__.py, CITATION.cff, SECURITY.md, rooflab --version) to 0.6.0.
  • Restored standard GitHub-recognized MIT text in LICENSE, updated docs/ROLLBACK_AND_RELEASE_RUNBOOK.md to cover all patches 00..26 and all v0.6.0 runtime kill-switches, and verified 38/38 patches/MANIFEST.md SHA-256 digests and the 92-entry SHA-256 hash-chained experiment ledger.
  • Note on NVML Energy Measurements: Reported J/tok values measure NVIDIA board power via NVML only (excluding +40-80 W host CPU/RAM/PSU draw; RTX 3090 runs at 300 W cap). See README.md for full methodology caveats and upstream vs. community-distill model provenance disclosures.

rooflab v0.4.1

Choose a tag to compare

@scientist42-lab scientist42-lab released this 29 Nov 21:13

rooflab v0.4.1

All 8/8 cross-OS CI jobs (ubuntu-latest, macos-latest, windows-latest x Python 3.10/3.12 + Full Forensics Gate) are green on main (d7c4391).

Highlights in v0.4.1

  • Universal Lossless Multimodal / OCR Pipeline Benchmark (rooflab ocr-bench & docs/OCR_PIPELINE.md):
    • Zero-dependency stdlib core (generate_synthetic_ocr_png, Myers bit-parallel Levenshtein CER/WER, HTML/Markdown table structure & LaTeX formula parity gate -> hard PARITY_FAIL / VOID veto).
    • Async producer-consumer PDF/image prefetch queue (render_ms, preprocess_ms, gpu_idle_gap_ms exposing CPU_PREFETCH_STARVED), conservative margin trim + 28px vision patch alignment, speculative-burst-aware step_cycle_ms ITL, and live repeat-loop abort guard across Chandra-OCR-2, Qwen-VL, olmOCR, Gemma-4 Vision, and DeepSeek-OCR.
  • Nov-2026 Frontier Chandra-OCR-2 Drafter Training Kits (kits/training/):
    • train_chandra2_mmflash_v2.py (warm-start from Scientist42/chandra-ocr-2-mmflash-dpace, KL(p_vis || p_blind) visual-dependence token weighting, dual B in {8, 16} block-size curriculum, frozen v1 KL-anchor, O(1)-VRAM _TiledWeightedKLAnchorFn, 4-dataset public OCR streaming mix with strict OmniDocBench eval-only guard).
    • train_chandra2_mtp_dpace_v2.py (Zero-Init Residual LoRA r=16, lr=3e-5, EAGLE-3 K=2..5 focus, hidden-state feature alignment, and KL(p_vis || p_blind) visual-dependence weighting for 100% drop-in llama.cpp GGUF / vLLM / SGLang Stock-MTP compatibility).
  • 3-OS CI Hardening (All 8/8 Jobs Green):
    • Windows cp1252 auto-ASCII TUI fallback in live_monitor.py.
    • macOS sysfs test isolation, headless GPU-less --allow-no-vram gate fix, deterministic mock timing on api_bench and ocr_pipeline.
  • Open-Source Repository Polish:
    • Live CI & Release badges, refreshed Stage 1..6 hero in README.md, PyPI metadata & [project.urls] in pyproject.toml, plus CHANGELOG.md, CONTRIBUTING.md, SECURITY.md, and .github/ISSUE_TEMPLATE/ forms.
  • Published Lossless Drafters on Hugging Face:

rooflab v0.4.0

Choose a tag to compare

@scientist42-lab scientist42-lab released this 29 Nov 17:12

rooflab v0.4.0

rooflab (formerly orion-opt-lab) is a zero-dependency, physics-grounded local LLM optimization, hardware roofline calibration, and statistical benchmarking lab across llama.cpp, vLLM, SGLang, Ollama, MLX, and openai-http.

Highlights in v0.4.0

  • Collision-Free 6-Stage Physical System Stack (rooflab explain / rooflab xray & docs/LAYER_MODEL.md):
    • Strictly separates hardware caches (L1/L2/L3 Cache), neural blocks (Block 0..N-1), and physical bottleneck stages (Stage 1/6: Hardware Roofs through Stage 6/6: Measured Reality).
    • Models 2D-Roofline Prefill (TTFT + Compute Ridge + O(L^2) non-SSM Attention), L2/L3 cache hierarchy, critical-path DAG overlap vs. hard sync barriers, multi-slot concurrency (N > 1), MoE batch union E_unique(B), quantization ALU dequant tax (quant_alu_eta), context-length KV crossover sweep (512..64K), MB/tok & Ideal-vs-Real kernel tax, and Measured-vs-Modeled residual attribution with offline dark-mode HTML/SVG export.
  • Realtime Physical Limits Visualizer (rooflab live & rooflab live --web):
    • Zero-dependency 72-column ANSI TUI plus offline single-file HTML5/Canvas/SSE dashboard (127.0.0.1:8765, zero external CDNs).
    • Zero-sudo, zero-perf-binary Linux hardware telemetry via pure-Python ctypes perf_event_open(2) (uncore_imc real DDR4 GB/s + Intel RAPL CPU/DRAM Watts & Joule/Token) + libnvidia-ml.so.1 (real PCIe TX/RX & thermal throttle) + /proc/<pid>/schedstat & VmSwap alarm.
  • Measurement Integrity & Security Hardening (v0.3 + v0.4):
    • Host Quiescence Gate (VOID_NOISE), native perf_event_open(2) backend, and Observer-Overhead A/A budget check in perf_gate.py.
    • Cold/warm --cache-mode with prefix-cache leak detection (PREFIX_CACHE_CONTAMINATED), HTTP Keep-Alive, and speculative-burst-aware step_cycle_ms ITL in api_bench.py.
    • Full SSRF, header/shell/config injection, GGUF binary bounds DoS, symlink-safe atomic writes, VOID exit-code 2, pure-stdlib zero-numpy stats_gate.py, and 3-OS GitHub Actions CI (ubuntu / macos / windows).
  • New Audited Bare-Metal llama.cpp Slices (patches/01..06, Ledger #0..#91):
    • Slice M6 (KEPT): sm_61 weight-reusing Q4_0 multi-column MMVQ (B=2..4, 0 B SMEM, 0 barriers) -> gemma4-e2b-mtp +7.26% (70.12 t/s, code_refactor +13.34%, 6/6 BIT_EXACT), lfm24b +3.50%, gemma4-26b +2.63%.
    • Slice M7 v2 (KEPT): Redundant OpenMP barrier removal + merged-gate_up CPU-MoE fusion + Inkling-2 TopK norm-eps fusion (-192 kernels/eval) -> gemma4-26b-mtp +4.18% (6/6 BIT_EXACT), inkling2 +0.98% (-8 MiB VRAM), 0 regressions.
    • Slice M6b (KEPT): sm_61 weight-reusing Q8_0 multi-column MMVQ (B=2..6) -> lfm3-dflash 55.49 -> 59.30 t/s (+6.87%, 6/6 STAT_WIN, stem_science +10.43% BIT_EXACT, -2 MiB VRAM).
    • Slice M8 (KEPT): Opt-in ORION_LAYER_PROFILE=1 dual-cadence async CUDA-Event, PCIe copy, and live llama_moe_cache telemetry exported on /metrics (0% overhead OFF, 100% BIT_EXACT, +0 MiB VRAM) feeding rooflab live directly.
  • Reproducible Training Kits & Lossless Drafters:
    • Privacy-sanitized Wave-5 Colab training scripts in kits/training/, Figure 9 6-model gap analysis (assets/figures/fig9_orion_6model_gap_analysis.png), and lossless drafter catalog (docs/DRAFTERS.md).

Verification

  • 324/324 unit tests PASS (109/109 zero-numpy 3-OS CI suite PASS)
  • privacy_audit.py: 0 findings | repo_integrity_check.py: 0 findings
  • Cryptographic Ledger: 92 entries (#0..#91, 60 KEPT / 20 REVERTED / 12 DISPROVEN), verified head ab38987970d9186f12e41f51c59663b6378078cdd893857d7fde4d4a3ee8fde9