bfp-quant: EXL3-style Hessian-aware offline quantizer → native bfp4_b (grid-snapped), + weight accuracy gate #62
Open
opened 2026-09-24 11:11:53 +02:00 by Grok
·
11 comments
No Branch/Tag specified
master
claude/public-release-v8
claude/pi-lora-device
claude/pi-lora-epyc-check
claude/pi-lora-plumbing
perf/export-cap-12288
claude/pd-kv-admission
claude/ship-cdr8g
claude/ship-col3-cdr8g
codex/public-release
codex/pp10k
codex/mando-kernels
opus/router-delta-margin
opus/rtx-b8-32k
claude/router-ttdown-fastpath
claude/license-apache2
codex/mtp-w1
docs/longctx-pp
codex/k8b4-speed
codex/kvarn2-study
codex/sglang-port-study
codex/inc393-offload-assert
codex/x16-bench
codex/mtp-cpu
codex/mtp-accept-train
opus/rtx-gpu0diag-rec
opus/rtx-sample-sparse
opus/rtx-prof32k-rec
opus/rtx-prof32k
opus/rtx-b8-prof
codex/k8b4-concurrent
opus/rtx-decode-lane
opus/rtx-w4a8-park
opus/rtx-ar-q8
codex/modelopt-scan
opus/pd-master-consolidation
codex/pd-recipe
opus/rtx-k8b4-connector
opus/pd-branch-archive
codex/pd-docs-fix
codex/pd-prod-snapshot
opus/rtx-kv4
opus/pd-connector-lows
history/hermes-review-uplift
eval-sglang-torchtpu
pp32k-w3c-upstream
pp32k-prefill
upstream-scan-20261109
plugin-283-slot-keep
docs/history-pd-delta
opus/pd-delta-export
opus/pd-stack-to-master
pp32k-ethdisp
opus/pd-router-template
docs/pd-path-breakdown
skill/pd-enterprise-bench
opus/pd-arena-freelist
opus/pd-adaptive
opus/rtx-decode-night
opus/rtx-dynk-fix
opus/rtx-night-ar
opus/rtx-night-attn
opus/pd-export-followup
opus/rtx-night-topk
docs/history
opus/pd-export-arm-master
opus/cmb-crash
opus/pd-draft-tune
opus/tt-interleave
opus/pd-adaptive-v2
opus/rtx-embed-host
opus/pd-adaptive-sim
opus/pd-adaptive-router
opus/pd-cutover
opus/pd-hyperqwen
opus/pd-reprefill
opus/pd
public/arm-flatten
public/upstream-inventory
opus/pd-handoff-opt
opus/lsa-eval
fix/tt-serving-hold-guard
opus/pd-sim-levers
opus/mtp-host-row-isolate
opus/mando2222-cp7
opus/upstream-scan-1104
opus/host-sample-why
opus/cold-prefix-s10
opus/cold-prefix-s10-pack
opus/pd-r3
scout/upstream-20261103
opus/rtx-drafter
opus/b8d-measure
docs/status-refresh-20261102
opus/b8d-verify-attn-splitkv
opus/b8d-sparse-verify-sampling
opus/b8d-ar-asym-x8
opus/b8d-draft-head-quant
opus/b8d-prob-draft-topk
opus/b8d-marlin-m32-mma
opus/rtx-opt
opus/traffic-bench
opus/pd-r2
opus/pd-e2e
opus/pd-export
opus/pd-router
opus/pd-connector
opus/pd-rtx-serve
opus/gdn-id-pool
opus/kv-1m
opus/prefix-rounds
opus/prod-spec-image-id
opus/blend-publish
opus/cold-pp
opus/dashboard-bench
opus/pd-rtx
opus/night-window
opus/prod-edge
opus/probe-hugepages
opus/so-vsplit
opus/fused-decode
opus/fused-decode-vsplit
opus/bfp-autoround
opus/blend-b09d16
opus/blend-gptq-table
opus/kv-host-tier
opus/serve-arm
opus/ttx-ab-suite-refuse
opus/kv-host-tier-history
opus/bfp-quant-docs
opus/s12-prefix
opus/kv-host-tier-staging
opus/cfx-llm0
opus/s12-sdlofi
opus/optrace-addon
opus/tmc-premise
opus/s12-budget
ship/s12
opus/s11-next
ship/s11
opus/verify-rest-2
docs/s10-greedy
docs/optrace-fcb-pf32
opus/pf32
ship/s10
opus/verify-rest
opus/dcx
x280-foundation
docs/crashcourse
opus/sdpa32k
docs/stale-fix
opus/dcx-hcap
x280-program-doc
ship/s9
opus/draftcut
ship/s7-pp3
docs/port-skills
opus/ssparity
probe/drafter-t1
opus/verify64
fix/gate-boot-identity
plan/tg100
ship/s7
screen/batch4
sim/fabric-link-counters
opus/s7cand
opus/rs-bank-ship
readme/s6-ss-numbers
free/t-ethtxq
opus/specsample-s6
opus/dualtrace
sim/kernel-overlay-fix
opus/fusedsampler
opus/rs-bank
opus/devaccept
anatomy/rs-line
fix/abpad-cache-key
free/k-swiglu
opus/sscost
free/k-gdnpre
free/u-matmul
launch/opus-specsample
free/u-ccl
free/c-audit
free/s-cost
free/u-models
free/c-sparse
serve/sampling-defaults
free/w-rsnorm
free/f-tail
ship/s6
launch/s-sample4
free/k-glue
bench/acc-curve
opus/top2-branch
screen/acc-levers3
screen/ss-capture
free/s-rowfall
free/a-oracle2
free/d-top2
free/c-sparse-rev
free/s-penalty
opus/specsample
rv4/m-specsample3
free/m-specsample3
free/s-sample4
review/t-proxy2
free/t-proxy2
free/t-served
free/l-kvbytes
free/m-specsample2
free/t-ops
free/l-verifykv
free/m-specsample
free/a-kdyn
fix/pphost-probe-mml
free/w-swiglu4
free/s-prefix4
free/m-creative
free/w-b8dec
free/w-gdnscan
free/t-proxy
free/b-bucket
free/m-multidraft
free/a-tree
free/s-sample3
free/w-swiglu3
docs/goal-recommended-sampling
free/f-sdpa2
ship/cap
b-bucket-tools
review/b-bucket
free/s-prefix3
free/d-gdn
free/s-prefix2
free/s-sample2
free/p-host
free/d-enq
feat/s-prefix-agentic
ship/s5
free/s-specsample
free/a-sink
free/a-accctx2
screen/acc-levers2
free/f-swiglu
bench/agentic-s4
free/f-draft
screen/acc-levers
free/f-qkvz
free/f-dmlp
free/a-window
free/f-gdnprep
free/f-glue
free/a-oracle
free/a-survey
screen/a-accctx
free/a-accctx
free/f-sdpa
docs/utilization
pp/rsfold
pp/idle
tooling/stream-accept
ship/gum2-s4
pp/agmm-t9
pp/gdn-s3cmb
pp/agmm-fwo
ship/s4
pp/agmm
pp/s3prof
ship/rs4
ship-s3-narrow
tools/jit-check-kernel
pp/gdn-combo
ship/s3
pp/glue3
pp/gdn-scan
free/w2eff
pp/gdn
free/agmm2
free/dsdpa
pp/glue2
pp/glue
ttx-claim-unique
pp/warm
pp/gdn-sdpa
free/vrows
pp/host2
pp/host
ar-prefix-hit-log
feat/card-queue-service
dev/prefetch-reopen
k-sweep-s
lookup-swap-k3
docs/s2-ledger-9309
ci-slot-reclaim
ship-s2-narrow
research/verify-rows-gt32
handoff/claude-20261017
dev/ship-stack-2
lc0-agent-corpus-stats
ci/card-gate-armsel
dev/draft-path
dev/bkda-fix
dev/codex-kernels
dev/decode-next
ship-s-narrow
dev/prefill-hostgap
dev/ship-stack
dev/agmm-eff
dev/so-chain
ar-bf8-out8
lever-studies-20261013
ar-bf8-serve
control-dfr
grill/metal-60316-gdn-prefill-waves
grill/metal-60840-vllm-spec-serve
ship-dfr
screen-201-joint
dspark-serve
land-195-drisc-0042
agmm-swiglu-pack
worktree-agent-aceb187bf909a2834
decode-mr-span-direct
gdn-so-fuse-serve
probe-59622-onecard
ship-e-gpgob
gates-e-gpgob
ci-fingerprint
ttx-heal-within-run
levers-nogo-closeout-20261009
tooling-picker-armderive
tg-toks
agent-harness
ci-fp-base
lc0-bench-token-ids
confirm-cpbaol-gpool
screen-hec-joint
control-joint-b8k3c48
grill/metal-58817-llk-8bit-stream
grill/metal-59507-dram-bank-grid
grill/metal-59622-dram-read-split
grill/metal-59695-sdpa-gqa-flags
grill/metal-59957-spec-batch
grill/metal-59965-gdn-scan-fp32
lookup-swap-k3-base
combo-mx-screen
joint-w2t-b8k3c48
muse-mtp-chunked
muse-decode-profile
muse-harness3
muse-state-bfp8
muse-state-bfp8-study
muse-commit-defer
fix/picker-accept-defining
records-197-close
lever/prefill-unlocks-u2-u3-u6-u7
verify-depth-gt4
lever/u2-norm2d-v2
gdn-producer-pool
prefill-kernel-8k
cpb-lmhead-screen
reeval-decode-gdn-attn-mtp
drisc-prefetch-prio
fp8-fidelity-deepdive
reeval/prefill-20261006
drisc-prefetch-pf13
lever-reeval-decode-weights
odo-on-dx
decode-bundle
kx-compute-fuse
gdn-verify-fused
conv-fold
kx-compute-splitread
drisc-prefetch-lever
kx-matmul
kx-matmul-outdirect
drisc-prefetch
decode-research
ci-tg-toks
kv-update-fold
sdpa-dec-lift
baseline/retarget-cph32
lever/agmm-grid9-cph32
lever/attnqkv-11x6-bf4
lever/sdpa-dec-cph-dualnoc
lever/gdn-scan-mcast
lever/gdn-fused-maxbh
lever/sdpa-dec-kchunk-dualnoc
lever/lmlofi-loo
lever/kda2-loo
lever/kda2-lmlofi-loo
lever/agmm-grid9-chunk2304
ci-serve-fix
ci-sweep-faster
ci/agmm-2x2
ci-token-prefix
ci-pr-driven
gdn-prefill-lift
gateup-on-gdc-cpk
resident-epoch-fix
kv-devinit
serving-throughput
gdn-fused-decode
spec-cycle
opmark-c177
resident-host
boot-speed
gateup-mr
prefill-prof
ship-c175-gdc-cpk
lottolabs-repro
lotto-forensics
decode-mr
mtp-c157
dram-attach
upstream-154
mtp-csplit
queue-guard
mtp-so1-cplit
dram-persist
serve-b16
incr-gcroots
resident-dv
mtp-draft-vocab
mtp-so-t0
arm-switch
queue-stepid-fix
p1-levers
tracy-image
op-datasheets
upstream-watch
op-anatomy
skill-prefill-bringup
ttx-gates-correctness
skill-bh-arch
ttx-ops-tools
mtp-gdn-state-traffic
mtp-device-accept
mtp-conv-multi
gdn-vsplit
cm-g9
agmm-grid
verify-ablate
mtp-warm
prefill-cloud
mtp-stack
gdn-multitoken
dspark-device
mtp-async
mtpb-dn
mtp-state-slot
k8v4-mtp
sdpa-spec-fold
pfprof
fabric-ring
ttx-merged
ttx-gates
kv-k8v4-dn
ttx-safety
mmrs-probe
agmm-silu
prefetch-dn
tailtrace-dn
normbf8
prefill-agmm-abso
worktree-agent-a5e29df1933a6076c
sdpa-dec-v-noc0
worktree-agent-aff7f4014dd906d8b
worktree-agent-a015e99a3392d569c
c105-smallops
agmm-in0-lowp
prefill-combo
worktree-agent-a4c964697339cbea0
tp1-prod-port
resident-rearm
decode-sa1
ttx-gc-sudo
prefill-rs-cfg
wb-gaps
prefill-bundle-h
mtp-batch-fix
ttx-fast-fail
host-leak-investigation
kernel-workbench
ttx-quickwins
kernel-workbench-research
decode-split-probe
mtp-batch
sdpa-mcast-q128
decode-mr-lmhead
prefill-kernels
dram-sharded-mr
decode-levers-2
qb2-scout
decode-levers
prefill-deepdive
prefill-devsplit
sim/prevalidate
port/issue-50-bucket-trace
research/lowlevel-levers
integrate-all
perf-loop-c1
g2-arms-registry
ttx-slot-stale-reclaim
bfp4-overlay
deploy/g2-prefix-0019
mtp-thinkingcap
agy/issue-39
agy/issue-36
kv-k8v4
agy/issue-51
agy/issue-64
fix-dead-assumptions
decode-campaign-53-55
fix/71-gdn-gate-fp32-prod
thinkingcap-baseline
tt-quant
bfp-quant
ttx
agy/issue-49
agy/issue-47
dspark-thinkingcap
repo-skills
harness-overhaul
agy/issue-50
agy/issue-45
agy/issue-38
agy/issue-23
dspark-acceptance-rate
thatch/lane2-serve-gotchas
agent/claude-auth/goal-4-nvfp4-single-card
agent/claude-auth/ttsim-scout
archive/vscode-toolkit-flake
archive/tt-tooling-scout
archive/tt-model-publish
archive/thatch/lane1-fir-drift
archive/serving-throughput
archive/serving-cleared-arm
archive/prefill-optimization-notes
archive/mtp-scout
archive/mtp-dflash2-ttsim
archive/harvest-whitehole-notes
archive/fix-serving-paths
archive/fix-readiness-race
archive/fix-probe-sigpipe
archive/fix-probe-card-sabotage
archive/fix-inspect-empty-stdout
archive/fix-http-code-format
archive/docs/agents-md-retire-claude-md
archive/autoresearch/dspark-drafter-sep07
archive/agent/fable/warm-tensor-cache
archive/agent/fable/external-repo-runbook
archive/agent/fable/cxx-fork-build
archive/agent/claude-auth/two-card-external-report
archive/agent/claude-auth/silicon-validation-findings
archive/agent/claude-auth/prod-27b-serving
archive/agent/claude-auth/ornith-moe
archive/agent/claude-auth/on-box-iteration
archive/agent/claude-auth/mesh-ready
archive/agent/claude-auth/inventory-pre-reboot
archive/agent/claude-auth/goal-vllm-serving
archive/agent/claude-auth/goal-2-3
archive/agent/claude-auth/first-bringup
Labels
Clear labels
cards:go
Force a card run on this PR (consumed by CI; re-add to force again)
hermes-approved
Approved by Hermes (bot). Not a human approval.
human-approved
Approved by @donach for T2-path changes. Required by .forgejo/workflows/ci.yml approve_gate.
human-approved
Approved by the human reviewer — merge gate
iter
0
X280 program stage
iter
1
X280 program stage
iter
2
X280 program stage
iter
3
X280 program stage
prio:high
Still a large B=4/B=8 wall or tokens/cycle lever
prio:low
Parked, already lost, or bookkeeping
prio:med
Real but smaller, or needs a gate
priority/high
Owner-flagged; queue agent picks these first
state
blocked
X280 program workflow state
state
doing
X280 program workflow state
state
done
X280 program workflow state
state
review
X280 program workflow state
state
todo
X280 program workflow state
x280
SiFive X280 (L2CPU) on-card control plane
No labels
cards:go
hermes-approved
human-approved
human-approved
iter
0
iter
1
iter
2
iter
3
prio:high
prio:low
prio:med
priority/high
state
blocked
state
doing
state
done
state
review
state
todo
x280
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
bitpartner/tt-stack#62
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Tracking issue for the recommended path out of #61: take EXL3's quantization method (Hessian-aware LDLQ/GPTQ rounding, optional incoherence rotation), not its trellis bitstream, and emit weights that sit exactly on the native
bfp4_bgrid. The Tensix unpacker reads them for free, so there is no decode cost and no runtime or kernel change.Why
QWEN36_MLP_DOWN_BF4=1) has no accuracy record at all.goal3-down-proj-bf4-2026-09-05.jsonlsays "unverified".Phases (details and go/no-go in #61 "Integration plan")
bfp4_b/bfp8_bpacker (convert_u32_to_bfp), bit-verified against ttnn host APIs.tr(E H Eᵀ)/tr(W H Wᵀ)per linear group for:ref.py)tensor_cache_*suffix: a stale cache silently serves old weights.nix run .#bfp-quant.bench/ab/sweep-32k.shplus a prod-weight-mix control arm, interleaved.MatmulCustomCompressed(E3). E3 is blocked on upstream #42841/#42586.Rules
bench/runs/*.jsonl./tmp/ttlock, withMemAvailable≥4 GB checked before every boot.Effort (ESTIMATE): P0–P3 ≈ 5–8 engineer-weeks, 8–10 card holds.
Refs: #61 (research), #60.
P0 progress (branch
bfp-quant, 3 commits, pushed, no PR). No card time used.Everything below ran on host
orchestra, which has no/dev/tenstorrent. The only access to cfx-llm2 was read-onlyscpof checkpoint shards.What was built (
tools/bfp-quant/)bfp.py: exact emulation of the tt-metal host packer for bfp8_b and bfp4_b (convert_u32_to_bfp,pack_as_bfp_tiles, and the unpackers). It providessnap_to_bfp4(w)andcheck_on_grid(fails closed).packer-harness/. The verbatim upstreamblockfloat_common.cpp,bfloat4.cppandbfloat8.cppat the flake-pinned rev76983d00, compiled standalone against a shim that replaces only logging, tracy,MetalContextandTile.ttnn.from_torch(device=None). Its host path constructsMetalContext, which constructstt::Cluster, which opens/dev/tenstorrenton a card host.nix build .#ttnncurrently fails eval with a narHash mismatch on the local tt-metal input.quant.py: RTN and GPTQ/LDLQ onto the bfp grid.bfp_quant.py quantizewrites grid-snapped bf16 safetensors for the tensors that--includeselects. RTN works without Hessians; GPTQ takes--hessians DIR. Untouched shards are symlinked.tensor_cachesuffix, to avoid the stale-cache trap.modules_to_not_convert/quantization_config.ignore.proxy_study.py: streamed, per-tensor, Hessian-free error map. It also has--remote host:/dirto copy one shard at a time.nix run .#bfp-quant -- {test,verify-packer,synthetic,proxy,quantize}(nix/bfp-quant.nix). Tested end to end.Verification (all MEASURED)
bench/runs/bfp-packer-emulation-20260924T093051Z.jsonl: 68 cases x {bfp8_b, bfp4_b}.bench/runs/bfp-packer-emulation-20260924T093819Z.jsonl: a snapped 9B gate/up checkpoint written byquantizeis a fixed point of the REAL packer. The unsnapped down_proj fails the same--expect-snappedgate, as it must.bench/runs/bfp-quant-synthetic-20260924T094254Z.jsonl: synthetic only. GPTQ beats RTN ontr(E H Eᵀ)/tr(W H Wᵀ)in every synthetic layer, by 16-23x.bench/runs/bfp-proxy-hfree-20260924T092920Z.jsonl: Qwen3.8-27B-FP8, layers 0-3, 30, 31, 62, 63 plus embed and lm_head. Hessian-free proxy (H = I), measured against the FP8 weights dequantised the way prod does.Compute findings and blockers
nixos(andorchestra, a container on it) has 47 GB RAM, 20 cores and an AMD 6900 XT (ROCm, no CUDA). It is the build/gaming host.nixos, which would load the shared host.Qwen/Qwen3.8-27B-FP8exists, on cfx-llm2 at/var/lib/models/hf/hub/models--Qwen--Qwen3.8-27B-FP8, snapshot017b9c7a. So bf4-from-bf16 vs bf4-from-FP8 is not measured.orchestrahas 20 GB of free disk and cannot stage 54 GB.-FP8) once gated access is granted. Nothing in the tool assumes Qwen paths or the name of the bf16-kept-modules key.ref.py(MIT) only reconstructs tensors from an existing EXL3 checkpoint. It needs an EXL3 4.0/3.0 bpw checkpoint of the same base, plus the bf16 reference, to be meaningful, so it is not done yet.Next step
Hper module as<module>.safetensors, whichquantize --hessiansalready reads.ref.py.P0 checkbox is left unticked: the emulation and quantizer parts are done, but the Hessian-weighted study is blocked on compute.
P0 result: calibration-Hessian proxy study on ThinkingCap (branch
bfp-quant,90ac45b)Calibration (MEASURED, cfx-llm0, 4x RTX 3080, owner-approved window).
<think>), both from Mixture-of-Thoughts.Qwen3_5DecoderLayerreference. 21.5 min for all 64 layers.cfx-llm0:/var/lib/models/calib/H-thinkingcap-bf16(118 GB, withmanifest.json).Downtime. vllm-pod was down 2026-09-24 10:52:24Z - 11:17:30Z (~25 min).
Study (MEASURED proxy,
bench/runs/bfp-quant-hessian-proxy-20260924T192517Z.jsonl).Go/no-go.
Findings that matter for the next step.
Next (starting now):
Runbook:
.claude/skills/bfp-quant/SKILL.md.Gate wording corrected (owner, 2026-09-24): the FP8 checkpoint is the reference, not bf16
The reference is now the native ThinkingCap-Qwen3.8-27B-FP8 checkpoint (e4m3, 128x128 blocks), dequantised the way production does it. We treat it as lossless.
What changes:
bench/runs/bfp-quant-hessian-proxy-20260924T192517Z.jsonl) is kept, but it is superseded as the headline. It is re-run against W8.tools/bfp-quant/calib/quantize_ckpt.pyruns GPTQ from W8 (dequant_fp8_block, exactly as prod does).P1 arms (each with its own TT tensor cache dir; same prod-argmax serve and sources as tc-baseline):
QWEN36_ATTN_GDN_BF4=1)quantization_config.ignore. Prod's lazy FP8 loader passes bf16 keys through untouched, so the model code does not change.tools/bfp-quant/calib/verify_arm.pypacks every per-device matrix through the real tt-metal packer. It passes only if all of them are bitwise fixed points.Battery per arm (
bench/bfpq/tt-arm.sh, detached, tt-card-slot lock, waits and does not preempt):Downtime so far today:
P1 status: GPTQ-from-FP8 bfp4_b checkpoint built, verified and on-card tested; FP8 teacher gate still PENDING
Branch
bfp-quant@e5e29ec. All numbers below are MEASURED unless marked otherwise.1. Checkpoint and verification
bench/runs/bfp-quant-arm-roundtrip-20260925T0030Z.jsonl.2. Proxy error vs FP8
Relative output error tr(dW H dWᵀ)/tr(W H Wᵀ), where W = dequantized FP8. Record:
bench/runs/bfp-quant-hessian-proxy-fp8ref-20260925T0030Z.jsonl.In-sample, all 64 layers (unit means):
Held-out, layers 3/31/63: GPTQ is fitted on half the calibration sequences and scored on the other half.
Notes on the held-out table:
3. On cards (cfx-llm2, prod-argmax, CTX 34816, SEQS 8, bf8 KV + device argmax)
Each arm has its own tensor cache. Every arm shows the same prod banners. The attn/GDN bf4 arms show
QWEN36_ATTN_GDN_BF4 engagedx64; the MLP-only arms show it x0.Speed (n=1 per cell). TG = decode ms/token. Makespan is for 1024 output tokens.
Full 16-cell table for all four arms:
bench/runs/bfp-quant-p1-20260925T0045Z.jsonl. Per-arm raw data:bench/runs/bfpq-p1-arms/.What the on-card results show:
4. FP8 teacher (KL/top-1 at deep positions, plus FP8 GSM8K/kv rows): PENDING
Three short cfx-llm0 windows failed, each on an environment difference between the job container and prod:
ninja, which the image lacks; prod hides this behind its JIT cache.Each restore was health-checked with a real completion. The fix is in
e5e29ec:The next run needs one continuous ≤45-min window.
Provisional go/no-go vs the FP8-referenced gates
P1 final: the FP8 teacher gate has landed. G2 (GPTQ-from-FP8, all bf4) is GO; R2 (RTN, all bf4) is NO-GO
Branch
bfp-quant@2b1504d. Record:bench/runs/bfp-quant-p1-20260925T0645Z.jsonl. All numbers are MEASURED.Teacher. Native FP8 ThinkingCap served with vLLM 0.27.1 on cfx-llm0: TP=4, bf16 KV, no prefix caching.
KL / top-1 vs FP8
Task accuracy as a delta vs FP8
Gates
The gate is non-inferiority against the deployed prod arm, with everything measured vs FP8.
Caveats
teacher_fp8.pyis resumable.Next: build a compact packed bfp4 checkpoint of G2 and publish it to the private HF repo (owner request).
G2 published as a compact bfp4 checkpoint (
bfp4-packed-v1): 20.56 GB, private HF repoBranch
bfp-quant@65ebb7d. All numbers MEASURED.Format. Each of the 496 snapped tensors is stored as its native tt-metal bfp4_b encoding:
[in, out/2]), plus one exponent byte per 16-block (uint8[in, out/16]), in the TT packer's own block order.weight_scale_inv= 896 keys.mtp.*,visual.*) is copied byte for byte.quantization_configis removed, since no FP8 tensor is left.Trap found by the packer's fail-closed check. GDN
in_proj_a/in_proj_bare not on the grid as standalone tensors.[a_d|b_d], 24 rows each), and GPTQ snapped them in that order, so a 16-block straddles a and b....in_proj_ab.weight, with its TP=2 split recorded. That is 448 packed entries for 496 tensors.Tools.
tools/bfp-quant/bfp4_pack.pyandbfp4_verify.py.tools/bfp-quant/bfp4_unpack.py: libraryunpack/unpack_entry, plus the CLIbfp4_unpack.py PACKED_DIR OUT_DIRfor non-TT users, which writes a plain bf16 checkpoint.bench/bfpq/sources/weight-mapping.py, the image'stt/weight_mapping.py(sha256 7e24c7dd…) plus the unpack path. It printsQWEN36_BFP4_PACKED engaged, andtt-arm.sh ARM_PACKED=1fails closed without it.Gate 1, round-trip: PASS (
bench/runs/bfp4-packed-roundtrip-20260925T072327Z.jsonl).Gate 2, TT boot from packed with a fresh cache: QUEUED, not run. The card lock has been held continuously by other agents (
mtp-g2-ab, thentt-quant:gptq), and I did not preempt them.bench/bfpq/packed-gate.shis queued on cfx-llm2 under the lock protocol (log:/var/lib/models/bfpq/arm-PK.nohup)./var/lib/models-sata, with a fresh cache). It passes only if every tensorbin it writes is sha256-identical to G2's cache (980 files, hashes already taken) and the 44 deep probes are token-identical to G2's.…/stage/PK/runs/*-PK/packed-gate.json.ttnn.as_tensor.Published:
donach/ThinkingCap-Qwen3.8-27B-bfp4-GPTQ-tt. The HF API confirms it is private, with 22 files totalling 20,582,480,358 bytes and every size matching the local dir. Record:bench/runs/bfp4-packed-hf-publish-20260925T075700Z.jsonl..gitattributes, LICENSE, LICENSE-Apache-2.0-Qwen.txt, LICENSE-PolyForm-Small-Business-1.0.0.txt, NOTICE, README.md, bfp4_packed.json, bfp4_unpack.py, chat_template.jinja, config.json, generation_config.json, merges.txt, model-0000{1..4}-of-00004.safetensors (7.14/5.59/4.44/3.39 GB), model.safetensors.index.json, preprocessor_config.json, tokenizer.json, tokenizer_config.json, video_preprocessor_config.json, vocab.json.No new speed numbers. The packed checkpoint gives the device bit-identical weights, so G2's measured PP/TG apply once gate 2 confirms it.
"MLP bf4 retired" (old ledger 0aaa) and "attn/GDN stay 8-bit" are reopened. Neither was measured for accuracy, and the owner said "keep BF4" on 09-15. Your P1 result is now the record: G2 is non-inferior against the FP8 teacher (
bfp-quant:bench/runs/bfp-quant-p1-20260925T0645Z.jsonl). lm_head bf4 is still untested.Reopened under the new rule (owner, 2026-09-25): a closure needs an on-hardware record at the stated scope; estimates, code-reads and third-party numbers close nothing. See docs/LEDGER.md "Reopened" (PR #68).
Packed G2: on-card gate PASSED
bench/runs/bfp4-packed-tt-boot-gate-20260925T110520Z.jsonl(MEASURED, cfx-llm2, 2x P150a, TP=2, prod-argmax).Setup: cold boot from the
bfp4-packed-v1checkpoint (20.56 GB), using a freshTT_CACHE_PATHand the bfpq loader hook. The cold build took 1271 s.Results:
QWEN36_BFP4_PACKED engaged, andQWEN36_ATTN_GDN_BF4 engagedx64.So the packed checkpoint is bit-identical on the device to the one that passed P1. All G2 accuracy and speed numbers carry over. There are no new speed numbers.
Earlier attempt: it died when another agent filled
/var/lib/models-sata, after 849/849 identical files. That attempt is recorded as...-try1.This run: it completed at 11:05Z, before today's host reboot, so nothing needed re-queueing. Future bfpq TP=2 runs go through the ttx mesh slot (
bench/bfpq/mesh-slot-run.sh).HF: the model card on
donach/ThinkingCap-Qwen3.8-27B-bfp4-GPTQ-ttnow states this result. Re-verified via API: private, 22 files, sizes match.Branch
bfp-quant@ HEAD.Follow-on opened as #72: a public bfp4 GPTQ release of the original
Qwen/Qwen3.8-27B-FP8using this same G2 recipe, with fresh Hessians for that checkpoint. Licence check done and passing (apache-2.0, HEAD017b9c7amatches the tt-model.yaml pin). ThinkingCap artifacts stay internal — no weights, derived tensors, Hessians or eval outputs from it go public. This issue keeps the method and the internal G2 result; #72 tracks the public release and its gates.G2 was approved for production on 2026-09-25 and PR #73 carries it into the deployed unit. Prepared, not deployed — the hardware gates did not run (both cards held all evening;
ttx doctorreports ~4.8 GB of leaked pinned host memory with MemAvailable under the 4 GB boot guard, and only a reboot reclaims it).What moved out of the bench and into the unit. The bf4 path lived as file mounts in
bench/bfpq/sourceson thebfp-quantbranch, which the deployed unit cannot see. #73 vendors it intopatches/prod-local-metal—gdn/tp.py,weight_mapping.py,bfp4_unpack.py, using the image's own files as the base rather than a guess — behind two options with banner checks,weightsBf4(QWEN36_ATTN_GDN_BF4) andbfp4Packed(QWEN36_BFP4_PACKED).One merge was needed and it matters.
bench/bfpq/sources/attention-tp.pywas cut before patch 0020, so it has the bf4 dtype and no SDPA streaming. Shipping it verbatim would have silently removed a cleared optimisation — the same class of regression as89f75cedropping 0019. The file in #73 is the union.The bf4 banner is counted, not matched. The flag is read once per weight-loading module, so a half-applied overlay — attention patched, gdn stale — still prints it once, and a match-only check would pass an arm that is half bf8. The readiness probe requires 64, the decoder layer count, and refuses anything less.
QWEN36_BFP4_PACKEDis demanded for the mirror-image reason: the unpack hook is inert on a checkpoint with no_bfp4_codeskeys, so without that banner amodelDirtypo serves the FP8 base weights in silence.Packed, not unpacked, is what production should serve. Same numbers — the loader unpacks to the exact bf16 grid values, and the boot gate measured 980/980 sha256-identical tensorbins with 44/44 token-identical continuations — at 20.6 GB against 68 GB. And
ckpt-G2is a directory of symlinks into the quantiser's 46 GB scratch tree, which is not a production model root. It does need a permanent home: it currently lives on the SATA scratch volume at 80% full, because/var/lib/modelshas 36 GB free and three tensor caches already in it.A trap this work surfaced, worth recording against P2/P3. The unit hard-coded its tensor cache to
/var/lib/models/tt-cache. Tensorbins are named for the tensor and its dtype, never for the checkpoint, and ThinkingCap has the same keys and shapes as Qwen3.8 — so changingmodelDirwould not have missed and rebuilt, it would have hit, serving Qwen's weights under ThinkingCap's name with every banner green.models.tomlalready warns about this forttx cache seed; the unit had no way to express it. #73 adds acacheDiroption that must move withmodelDir.The P1 conclusion is unchanged and still conditional: KL 0.085 vs prod 0.111, top-1 0.944 vs 0.917, GSM8K 58/60, retrieval 1.00, decode 1.8–3.3 ms/token faster — with n=1 per speed cell and GSM8K n=60. The wider KL sample this issue asks for is still owed, and nothing in #73 substitutes for it.
Two PRs split out of the WIP deploy branch so the bfp4 serving path can be measured at all, independently of that deploy landing.
#99 — the bf4 weight overlay onto master. Master has none of
QWEN36_ATTN_GDN_BF4, so serving the G2 checkpoint there gives 256 BFLOAT4_B tensors (the four MLP projections) against 128 BFLOAT8_B (attention and GDN) across all 64 layers — G2's re-rounded values at the stock dtype mix, which is the worst of both. Worth 3.72 ms/token of weight read (20.24 -> 16.52) and ~1.8 GiB/card, and it is the precondition for any bfp4 serving number existing.#100 — the registry entry and the two G2 arms.
ttx render prod-g2-prefixfailed withmodel 'thinkingcap-g2-bfp4-packed' is not in bench/arms/models.toml: the arm was on the deploy branch, the registry is on master. Both arms move to master. #100 depends on #99.Two things found on the way that are worth having on record here:
The development branch's
gdn/tp.pyis stale and must not be copied over. It predates #86, and a direct copy would silently have deleted master's column-parallel prefill out-projection,_silu_mul, the guardedrecurrent_gated_delta_rule_decode_packed_ttnnimport and the loguru logger — 66 deletions. #99 re-applies the hunk onto master's file instead (+23/-10). Its newout_colparweight takes the same dtype as the other four, otherwiseQWEN36_GDN_OUTPROJ_COLPARtogether with bf4 would serve that one projection at bf8 while the banner claimed all-bf4.A blanket
bfloat8_b -> _wdtsubstitution is wrong.attention/tp.pyhas sixdtype=ttnn.bfloat8_bsites, but only five are weights; the sixth isttnn.typecast(q, dtype=...)on theQWEN_SDPA_BF8path — a query activation. Converting it would have made activations bf4 under a flag documented as weights-only. Scoped to the loader function.Where the packed weights are:
/var/lib/models-sata/bfpq/packed-G2— the SATA volume, not/var/lib/models, which is why looking under/var/lib/models/bfpqfound nothing (that path holds the unpackedckpt-G2). 20 GB, self-contained,bfp4-packed-v1, 121bfp4:metadata keys in shard 1, and its verified tensor cache at/var/lib/models/tt-cache/bfpq-PKis 23 GB — which is wherecache_gbcomes from rather than an estimate.No hardware was taken for either PR; the cards are free. Neither arm produces a valid run until #99 lands, and both fail their
[expect]gate until it does, which is correct.🤖 Generated with Claude Code