diff --git a/.github/workflows/no-gpu.yml b/.github/workflows/no-gpu.yml index 1fb6d8c2d36..409a034dc66 100644 --- a/.github/workflows/no-gpu.yml +++ b/.github/workflows/no-gpu.yml @@ -186,6 +186,8 @@ jobs: # Cortheon's readers of untrusted web bytes under the fuzz harness: seeds, 100,000 edits, linear time. - name: zig build fuzz-cortheon run: zig build -Dfixed-cpu fuzz-cortheon + - name: Public Qwen reference diagnostic controls + run: python3 -m unittest discover -s tools/zig -p "test_qwen35*.py" -v - name: Served Flash Next gate regressions run: python3 -m unittest discover -s tools/zig -p flashnext_batch_serve_test.py # The generated Engram tables: committing a table that its generator no longer reproduces is a silent drift. diff --git a/docs/receipts/qwen35-bf16-scoring/README.md b/docs/receipts/qwen35-bf16-scoring/README.md new file mode 100644 index 00000000000..80d6d10f43e --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/README.md @@ -0,0 +1,272 @@ +# Dense BF16 Qwen3.5 prompt-score qualification + +The [20261105 layer diagnostic](layer-diagnostic.md) records the requested 32-ID follow-up after rebasing onto current main. The first excess is at layer 0; the stricter score failures remain. Its native/reference producers are separate from the historical serving and full-CUDA producer below. [layers.json](layers.json) and [asset.json](asset.json) bind the new evidence. + +This receipt records qualification of the experimental dense BF16 text format and native nonstreamed +`/v1/completions` prompt scores for the tested single-GPU configuration. +It records functional, numerical and regression checks separately from timing. +BF16 prefill and concurrency remain slow; performance remains unqualified. + +The scope follows [issue #1136's agreed gate](https://github.com/ashhart/TensorFold/issues/1136#issuecomment-6553918935): +served scores, same-weight FP64 prompt/decode head and reduction evidence, red +planted controls, and unchanged existing formats. That agreement explicitly +allows the independent-engine distance comparison to fail. The requested direct +HTTP-versus-Transformers comparison is reported in both directions, with its +counterexamples. A broader hidden-state bound never replaces that comparison. +Maintainer acceptance and merge authority remain separate from this receipt. + +## Measured results + +| Check | Result | +| --- | --- | +| Served API matrix | 32/32 passed | +| Same-weight FP64 | 6 prompt rows, 12 decode rows, 24 projection captures passed; no argmax differences | +| Actual HTTP versus Transformers | 4511 scored positions collected; strict distances fail in both directions | +| Existing formats | MLX4/ModelOpt: 20 full reply-hash matches each; scoring refusal unchanged in four alternating processes each | +| Cache and cancellation | Fresh/retained/edited/restarted full reply hashes match; all observed-cancellation checks pass | +| Complete CUDA backend | Exit 0; 559 kernels pass, 367 controls red, zero gate/limit failures, six unchanged known findings | +| Five-SM compiled-resource audit | Exit 0; 1493 records, zero stale records, zero applicable launch failures | + +Worst prompt/decode FP64 head errors are 2.455665e-6/2.588786e-6; +logprob errors are 5.418979e-6/6.144033e-6. The HTTP comparison has +1719 positions outside the FP32-reference distance and 1911 outside the +BF16-reference distance. Worst native-to-FP32/BF16 absolute logprob distances +are 5.546444/5.767185. These failures remain visible under the agreed gate. + +| Public BF16 workload | Native | SGLang 0.5.19 | +| --- | ---: | ---: | +| Code greedy decode, median tokens/s | 23.68 | 27.70 | +| Chat greedy decode, median tokens/s | 29.32 | 27.58 | +| Code warm TTFT, median seconds | 0.352 | 0.076 | +| Chat warm TTFT, median seconds | 0.767 | 0.079 | +| Code C4 greedy aggregate decode, tokens/s | 8.9 | 109.6 | +| Chat C4 greedy aggregate decode, tokens/s | 9.0 | 109.5 | +| Code C4 whole-request throughput, tokens/s | 8.910 | 108.572 | +| Chat C4 whole-request throughput, tokens/s | 8.973 | 108.313 | + +Three measured repetitions per short cell are descriptive evidence; they do +not establish a production percentile SLO. Native full reply hashes match solo +and plain execution in all 60 measured concurrency requests. Six greedy +cross-engine content/reasoning fingerprints match; cross-engine full-token-ID +equality is unverified. Sampled cells, SSE chunk statistics and all observations +remain in the linked asset and summary. No performance improvement is claimed. + +| Fresh prompt IDs | Native TTFT, seconds | SGLang TTFT, seconds | +| ---: | ---: | ---: | +| 2048 | 49.515 | 0.447 | +| 8192 | 199.777 | 1.901 | +| 32768 | 801.786 | 9.211 | +| 65536 | 1601.814 | 24.608 | + +Each cold row is one admitted first request with eight reply tokens after a +fresh server becomes ready. Startup and OS-cache scope are stated below. +SGLang's generic cache qualifier remains false because its HTTP cache counter +is absent; independent scheduler chunks total exactly N new tokens and zero +cached tokens in each row. No missing field is replaced with zero. + +MLX4 baseline/candidate median-of-process-median decode changes are ++0.112% code/+0.137% chat; ModelOpt changes are -0.040%/-0.065%. +These small differences do not establish statistical noninferiority. The +selected EXL3 export is refused with `UnexpectedTensor` in all four processes +(F16 embeddings where BF16 is expected); no EXL3 inference is qualified. + +## Exact source and configuration + +[summary.json](summary.json) binds every result to its actual source and binary. +[source-provenance.json](source-provenance.json) retains historical identities; +subsequent documentation commits do not relabel earlier executions. +The GPU evidence binds parent #2008 at `789846adb` and pinned main `0d19cc19`. +The submitted stack also includes the parent's `30e9b872` receipt/test follow-up: +its four resource tables match the qualified cubins and its two added host +checks pass. Numerical gates and inference behavior are unchanged. Parent +history stays in the stack until the parent lands. + +One NVIDIA RTX PRO 6000 Blackwell Max-Q workstation GPU, sm_120, rank 1, +96 GB class, 300 W power limit, Linux x86_64 and driver 615.78.08. +The host has an AMD Ryzen 9 9950X3D (16 cores/32 logical CPUs) and 128 GB-class +physical RAM. Serving uses four CPU cores and a 32 GiB +container cap, which does not establish fit on a physical 32 GiB machine. +Build/contract/reference jobs have separate budgets. The complete CUDA runner +uses available host CPU/RAM; it is not capped to the serving quota. +ReleaseFast, Zig 0.17.0, CUDA compiler 13.0.88; native version 1.2.2. +The clients run on the test host over HTTP loopback, without authentication. +Only a loopback host port is exposed. One model process owns the GPU lock at a time. + +[models.json](models.json) pins the public checkpoints. The new format uses +`Qwen/Qwen3.5-27B` at `fc05daec18b0a78c049392ed2e771dde82bdf654`. +All 11 measured shard SHA-256s and byte counts match the pinned public +Hugging Face LFS manifest; the verification record is included in the asset. +Weights, tokenizer and drafter assets are unchanged. BF16 projections and +activations retain FP32 sums and the stored FP32 GDN scales. +All qualification inputs use the public checkpoint and synthetic public fixtures. +The baseline uses pinned-main source and the same prebuilt CUDA assets. + +## Numerical and API evidence + +The API matrix covers [public ID arrays](fixtures.json) of lengths +1, 32, 129, 257 and 4097, including the 4096-row prompt seam. It checks +first-row null, score/rank/top-k shape, full drafted/plain reply tokens, +concurrent/solo score bits, repeatability, refusals and recovery. +This exactness matrix is not a service-latency percentile benchmark. + +The independent FP64 check computes head dots and full-vocabulary logsumexp +on identical native normalized BF16 rows and unchanged checkpoint weights. +It separates prompt and decode, worst absolute error and worst bound ratio, +selected/top tokens, ranks and argmax margins. Synthetic same-weight captures +cover the named projection classes. This is not a whole-model FP64 forward +or layer-by-layer activation equality with another engine. + +The FP32 GDN-scale norm is registered in the complete CUDA runner at real +128-wide served dimensions, with non-BF16 scale values, nonfinite scales, +repeat/guard checks, FP64 bounds and a wrong-weight-dtype control. +Its integer stress inputs overflow FP16 sums while remaining exactly summable +in FP32. BF16 output rounding can hide BF16 sum error; that stated limitation +is not an unreported skip or evidence of FP32 accumulation by itself. +The scoring reduction's separate stress fixture distinguishes both reduced +accumulators; its omitted-tail and FP16-head controls remain red. + +## Actual served comparison with Transformers + +The CPU reference uses the same pinned checkpoint and IDs, eager attention, +BF16 and promoted-FP32 decoder arms, and a full-vocabulary FP32 scoring head. +Both arms cover every scored position, including all 4096 scored positions +of the 4097-ID fixture. Native scores come from actual HTTP responses with +cache reuse disabled, `draft: false`, top 20 entries and one reply token. +Position 0 is null; selected IDs, positions and zero cached tokens are checked. + +The loader explicitly restores and byte-verifies all 96 stored FP32 +`A_log`/GDN-norm parameters after Transformers auto-dtype loading; BF16 +projections stay BF16. The earlier auto-dtype reference silently downcast +those parameters and is superseded for same-stored-value fidelity. +Its original failed counterexamples and checksums remain in the historical asset. +The reference uses CPU, Python 3.12.3, torch 2.15.0+cu132, +Transformers 5.22.1, accelerate 1.15.0, safetensors 0.8.0, numpy 2.5.4, +16 threads and approximately 53.9 GB peak RSS. Both arms took approximately +445 seconds. This larger CPU reference budget is not the serving RAM quota. +Teacher-forced continuation IDs position the auxiliary historical native +captures; those captures do not qualify the new served binary. Prompt rows are +the causal prefix of each forward, which includes five continuation IDs. A +separate prompt-only and library-equivalence repeat is verified for fixtures +through 257 IDs; the 4097-ID forward is not repeated for those auxiliary +checks because of CPU cost. Both BF16 and FP32 scored arms still cover every +prompt position at 4097 IDs. + +The current summary reports every fixture's worst and mean distances, rank +agreement, and counts outside each measured BF16/FP32 direction. No tolerance +is widened. Collection success means complete, well-formed evidence, not +numeric equivalence or a passing cross-engine envelope. + +## Served measurements and regressions + +Both engines use the same physical GPU, public BF16 checkpoint, quotas and +rendered prompt IDs: code and no-thinking chat. Ordinary decode requests +128 tokens, one warmup per prompt excluded and three measured repetitions. +Concurrency measures C1/C4, greedy and sampled temperature 0.7/top-k20/top-p0.95, +three repetitions per cell and four 16-token warmups excluded. +Concurrency uses seed 1234; sampled stream i uses 1234+i. Decode repetitions +use seeds 1234/1235/1236, which are inert at temperature 0. `ignore_eos` fixes +output length. +Native drafting remains enabled; solo and `draft:false` checks verify full +reply hashes before speed is interpreted. No external drafter is loaded. +Decode rate excludes the first output token; end-to-end throughput includes +the full client makespan and prefill. ITL and round gaps describe observed SSE +chunks, which may contain several tokens, rather than individual GPU kernels. + +The standard server is SGLang 0.5.19 (torch 2.13.0+cu130, Transformers 5.12.1) +in the pinned image listed in the summary, +BF16 weights/KV, FP32 SSM, Triton attention, radix disabled, `no_buffer`, +chunked prefill 4096 and static-memory fraction 0.85. The attached startup policy +disables TF32 and BF16/FP16 reduced-precision partials. Its toolchain differs +from native; these are whole-server measurements. SGLang does not return the +native full-token hash, so cross-engine token-ID equality is unverified; +streamed content/reasoning fingerprints are compared separately. + +MLX4 and ModelOpt use four alternating baseline/candidate processes, +three decode repetitions per prompt and eight concurrency cells for each +first baseline/candidate pair. Greedy and sampled full reply hashes and +scoring-admission behavior are compared. Small rate differences are descriptive, +with all observations retained; no statistical noninferiority claim is made. +The selected EXL3 export's actual admission outcome is recorded, without +claiming inference support after a refusal. + +Retained, edited, fresh and post-restart chat checks use the same complete +4122-ID prompts and verify full reply hashes. Observed cancellation checks +require an actually active request and verify the following request's state. +Cold 2k/8k/32k/64k measurements use exact archived arrays, fresh server processes, +cache0, C1, context N+32 and eight reply tokens. The 64k read timeout is 3600s; +others 1800s. All admitted attempts are retained. +Eight-token cold replies may have too few SSE chunks for a decode rate; +the observed TTFT remains measured and missing rates remain null. +TTFT begins after server readiness. Weight-load time is separate and the OS +file cache is not flushed. Compiler/kernel disk caches are also preserved, +including the mounted SGLang cache. Startup warmups/graph setup precede +readiness; “cold” here describes prompt/KV state. +SGLang's missing HTTP cache counter stays null and its generic cold qualifier +stays false/exit1; independent scheduler cached/new-token counts are separate +evidence, never a rewritten HTTP zero. + +Memory runs are untimed. Sampled device/pinned/RSS counters, process high-water +marks and cgroup peaks have distinct scopes. Large-context admission with a +4097-ID request is not full 64k peak memory. Separate post-timing counters and +Linux high-water marks through the actual cold requests have their own scope. Sampling is not an allocator peak +when the runtime exposes no peak counter. Quotas and admission are not proof +of fit on a smaller physical machine. + +| Memory scope, GiB | Process peak RSS | Native device allocator peak | Pinned sampled maximum | +| --- | ---: | ---: | ---: | +| Cache0/context8192/C4, 4097-ID requests | 5.984 | 54.025 | 0.060 | +| Cache2/context8192/C4, retained exactness | 6.000 | 54.025 | 0.453 | +| Cache0/context65568/C1, actual 65536-ID request | 5.992 | 55.302 | 0.060 at post-request read | + +Native post-cold lifetime counters include model load and that request. The +last row's pinned value is one post-request observation, not a sampled maximum +through the timed workload. Physical process VmHWM and cgroup charge peaks +are also retained for every process where available. SGLang's largest single +process VmHWM is 6.815 GiB in the short run and 6.821 GiB through the 64k run; +these are not sums of its workers. Its short-run cgroup charge peak reached +about 32 GiB, and its 64k charge peak was 6.068 GiB. Cgroup charge includes +different mappings/accounting and peaks at different times from process RSS; +it is not interchangeable with summed physical RSS. SGLang device/pinned +allocator peaks were not collected and remain unmeasured. + +## Checks, evidence and unrun coverage + +Full API/FP64 per-capture reports live in the linked asset; the source tree +keeps aggregate summaries, worst row/token identities and bound formulas. +The summary records plain/native build commands, complete unprivileged host +checks, fuzz/golden coverage, executed versus cached/skipped counts, zero-new +lean comparison. Exact published-head CI is reported in the +[PR checks](https://github.com/ashhart/TensorFold/pull/2020/checks) and its final +description; those runs do not relabel the archived device producer. CUDA evidence includes the +complete backend SUMMARY, exit status, existing known findings, every planted +control, five-SM compiled-resource audit and actual sm_120 live checks. +A five-SM cubin instruction-byte proof covers the canonical-load cleanup. +Diagnostic norm-only checks supplement the complete runner. + +The complete device command exits **0** with: + +```text +SUMMARY 559 kernels: 559 pass gates 1-4, 0 fail, 6 known findings; 367 controls: 367 red as planted, 0 missed; 0 limit problems; gates 4023784 ms, limits 760889 ms +``` + +All six known findings match the previous declarations: the BF16/FP8 Qwen +paged and contiguous decode merges skip a NaN chunk, and the two GLM index +score paths suppress a NaN through their existing ReLU rule. No new known +entry is added. Complete per-case output, side suites and actual live checks +are retained in the linked log. This proves the tested sm_120 backend scope. +The initial missing-auxiliary-image setup failure and corrected runner hash +remain separate; the served native binary is unchanged. + +[asset.json](asset.json) links immutable, checksum-pinned public assets and +archive member hashes. Full per-request outputs and complete logs stay outside +the source tree. Private infrastructure identifiers, personal contacts, user +paths, credentials and generated prose are excluded. Generic container paths, +public model/software/hardware identities, numeric evidence and token hashes +remain. Failed/superseded attempts retain their real source identities. +See [commands.md](commands.md) and the [recipe](../../recipes/qwen35-bf16-scoring.md) +for reproduction. + +Other physical GPUs/backends, multiple ranks, FP8 KV, optional grammar/tool +paths, vision, int8 prompts and learning are not qualified for the new format. +GB10 execution remains with the maintainer as offered. Compiling another SM +proves its resource record, not device execution. diff --git a/docs/receipts/qwen35-bf16-scoring/asset.json b/docs/receipts/qwen35-bf16-scoring/asset.json new file mode 100644 index 00000000000..7db39b20ae2 --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/asset.json @@ -0,0 +1,136 @@ +{ + "schema": 3, + "kind": "qwen35-bf16-scoring-linked-public-evidence", + "publication": "Published public-checkpoint evidence; private identifying metadata excluded.", + "files": { + "qwen35-bf16-scoring-dumps-20261103.tar.gz": { + "sha256": "d8f5763c8130ac5326ab5eb166999b3265152a897c731f4ed70768b5f64a29b7", + "bytes": 376782, + "unpacked_bytes": 3258590, + "members": { + "cuda-contract.txt": "fd70970c160f73992c979219e90dd42478a9d7abea9c7809f4bd74b2791e36a6", + "cold/ids-2048.json": "00e1f403f0c1102333f5f4bc02d6e5e03a4781353a9905b2e1381fd2501e0684", + "cold/ids-8192.json": "746913a9ba26f75fa811c06776cbdf8bc415c9d1feeb72ed5bdb9612ec89b28c", + "cold/ids-32768.json": "a5d62d1968ea34c03621ad159a204d364f42103e30498592cce0d40ef8500129", + "cold/ids-65536.json": "3339fa43a011590325987d40c3bc4fc3c1058844fdd82e8953474b1afa3c72e5", + "cold/request-2048.json": "44d20304a0ac01b0dad68ea3b01df316758bc86c68bfb4b187500975b3716843", + "cold/request-8192.json": "de803f108023c84440ebf406fa043e0b76ff96d63b093f067d4b2fbfd2b5e17c", + "cold/request-32768.json": "4c260b5e55d2487a95d9c9d85b49b15230dd1043c4a76a2bb341218742b31959", + "cold/request-65536.json": "213ee082218d9f7a8cb1e1c580af0eca1d2c3a93bae2afbe926321bda02077c5", + "native-concurrent.json": "67f4b6d7386009ab9eb5b734521fc60ced5cbbcbe79d9f4926394ab8dad6ccad", + "standard/sglang-concurrent.json": "54b5a7923ab41b5c269fc62ceec3f92eda1e3ce14ae106e61446967228d7a125", + "existing-formats/mlx4-integrated-concurrent.json": "c1a6f9ee05b20d42202c0cc335fc4f7ae8feee2c18839edddb6c7b950364fbd7", + "existing-formats/mlx4-parent-concurrent.json": "f9801c2b78807ac6181c8e4ee134d645a2778009ef03819e4cda70074b8544ef", + "existing-formats/modelopt-integrated-concurrent.json": "bd72694c770fd79abc4f38b6dd3747f9b0d34dfa9ad660ab7442400b41f5ecd1", + "existing-formats/modelopt-parent-concurrent.json": "a532b1de83a81d8a177b6506477911e3713d074cd66dcbe717e7f383ec7a6e12", + "attempts/README.json": "7ae9db769f9bc3b87c123bf1acdaf3f487a6c2da2cfa5e7776f4a79ee529382d", + "attempts/disconnect-client-before-route-fix.py.txt": "e7186f50a3e3e9645a18fc33f68d7a86eb0b5be4355e1a24b30c21ed3e120714", + "attempts/disconnect-diagnostics-route.json": "4534b43661d7a102249586a1c89e22b0ed3e4d4f2101b2b53abc1c13d21cf5ee", + "attempts/raw-edited-ids.json": "79504fb54462168e9d7b3d69548b02d299e822268ae940853d6e085f85cd8ada", + "attempts/raw-no-history-edited.json": "3e7c6764d24070d3c569d719efce264341e2518ab2c1342772d436ea0ca1af2b", + "attempts/raw-no-history-original.json": "d37135a6b3bc9036d7a5f2600306180933419ffba5b8b8de554534439c437932" + }, + "url": "https://raw.githubusercontent.com/akol1/TensorFold/9d07324dc7920fcff03152ff48c8fcc0e408a425/qwen35-bf16-scoring-dumps-20261103.tar.gz" + }, + "qwen35-transformers-prompt-scores-20261103.json": { + "sha256": "423d2d653a5e0c900ceca2e4f4d6fcbfe982f6c7a2e8a22f9a9ccb290f48a194", + "bytes": 5367360, + "url": "https://raw.githubusercontent.com/akol1/TensorFold/9d07324dc7920fcff03152ff48c8fcc0e408a425/qwen35-transformers-prompt-scores-20261103.json" + }, + "qwen35-transformers-run-20261103.log": { + "sha256": "6c826b51cc1725422d83cfb9a501a5264739eae1d3da5092490d50d61c67ea73", + "bytes": 4128, + "url": "https://raw.githubusercontent.com/akol1/TensorFold/9d07324dc7920fcff03152ff48c8fcc0e408a425/qwen35-transformers-run-20261103.log" + }, + "qwen35-bf16-readiness-20261104.tar.gz": { + "sha256": "30ed8623f861f32bc8ba0d134e245b34d9faaa1c5173092c135975defd06ac51", + "bytes": 37610554, + "members": 387, + "member_manifest": { + "file": "qwen35-bf16-readiness-20261104.manifest.json", + "section": "current", + "url": "https://raw.githubusercontent.com/akol1/TensorFold/164be6e57dae9124893e27d8d1ac8a1be7d03f1c/qwen35-bf16-readiness-20261104.manifest.json", + "sha256": "a54bbe46eec749f21f8842491fe208cbf9aeb3af3a0a3038c641b92b37e35ae6" + }, + "url": "https://raw.githubusercontent.com/akol1/TensorFold/164be6e57dae9124893e27d8d1ac8a1be7d03f1c/qwen35-bf16-readiness-20261104.tar.gz" + }, + "qwen35-historical-receipts-20261104.tar.gz": { + "sha256": "ccda986558edd769735f6d4d7a9e48cc54b104fe87c70a47f8fd275dd7b485f4", + "bytes": 65491, + "members": 53, + "member_manifest": { + "file": "qwen35-bf16-readiness-20261104.manifest.json", + "section": "historical_receipts", + "url": "https://raw.githubusercontent.com/akol1/TensorFold/164be6e57dae9124893e27d8d1ac8a1be7d03f1c/qwen35-bf16-readiness-20261104.manifest.json", + "sha256": "a54bbe46eec749f21f8842491fe208cbf9aeb3af3a0a3038c641b92b37e35ae6" + }, + "url": "https://raw.githubusercontent.com/akol1/TensorFold/164be6e57dae9124893e27d8d1ac8a1be7d03f1c/qwen35-historical-receipts-20261104.tar.gz" + }, + "qwen35-bf16-readiness-20261104.manifest.json": { + "sha256": "a54bbe46eec749f21f8842491fe208cbf9aeb3af3a0a3038c641b92b37e35ae6", + "bytes": 80585, + "url": "https://raw.githubusercontent.com/akol1/TensorFold/164be6e57dae9124893e27d8d1ac8a1be7d03f1c/qwen35-bf16-readiness-20261104.manifest.json" + }, + "qwen35-bf16-layers-native-20261105.tar.gz": { + "sha256": "bd27869f3413e2c93281ad7601e47bd504fd046ffcea804155828cb6d313de75", + "bytes": 17339176, + "members": 85, + "url": "https://raw.githubusercontent.com/akol1/TensorFold/7f54a5445ef4defa879b2b1fa76d01a64afdb5f4/qwen35-bf16-layers-native-20261105.tar.gz", + "member_manifest": { + "file": "qwen35-bf16-layers-20261105.manifest.json", + "url": "https://raw.githubusercontent.com/akol1/TensorFold/7f54a5445ef4defa879b2b1fa76d01a64afdb5f4/qwen35-bf16-layers-20261105.manifest.json" + } + }, + "qwen35-bf16-layers-reference-bf16-20261105.tar.gz": { + "sha256": "2ecf3e829f85002a1d1839a1642d61cc05af579a64d6444fe8b938cad70766de", + "bytes": 20277706, + "members": 66, + "url": "https://raw.githubusercontent.com/akol1/TensorFold/7f54a5445ef4defa879b2b1fa76d01a64afdb5f4/qwen35-bf16-layers-reference-bf16-20261105.tar.gz", + "member_manifest": { + "file": "qwen35-bf16-layers-20261105.manifest.json", + "url": "https://raw.githubusercontent.com/akol1/TensorFold/7f54a5445ef4defa879b2b1fa76d01a64afdb5f4/qwen35-bf16-layers-20261105.manifest.json" + } + }, + "qwen35-bf16-layers-reference-fp32-20261105.tar.gz": { + "sha256": "e039545948564c91585660761860e9d161032aa03c803f936dabb31532d58204", + "bytes": 39883616, + "members": 66, + "url": "https://raw.githubusercontent.com/akol1/TensorFold/7f54a5445ef4defa879b2b1fa76d01a64afdb5f4/qwen35-bf16-layers-reference-fp32-20261105.tar.gz", + "member_manifest": { + "file": "qwen35-bf16-layers-20261105.manifest.json", + "url": "https://raw.githubusercontent.com/akol1/TensorFold/7f54a5445ef4defa879b2b1fa76d01a64afdb5f4/qwen35-bf16-layers-20261105.manifest.json" + } + }, + "qwen35-bf16-layers-20261105.manifest.json": { + "sha256": "d4cd5795074f7e4eb3512fc2af43d21e4e54b25b25d3104d81708d62dfbfa923", + "bytes": 41258, + "url": "https://raw.githubusercontent.com/akol1/TensorFold/7f54a5445ef4defa879b2b1fa76d01a64afdb5f4/qwen35-bf16-layers-20261105.manifest.json" + } + }, + "publication_transforms": [ + "Reference identifying fields use generic placeholders.", + "Generated benchmark prose samples omitted; client interval origins normalized per repetition. Durations, rates, token/output hashes and failed numerical diagnostics are retained.", + "Tar/gzip owner names, IDs, timestamps and source filenames removed from archive headers." + ], + "notes": [ + "Every linked asset is pinned to an immutable fork commit. Source PR retains summaries and reproduction inputs; full per-request/capture results and logs are external.", + "Current same-weight FP64 and complete CUDA receipts retain the actual source and distinct initial/retry runner hashes.", + "The direct served comparison is complete and strict measured-distance diagnostics fail in both directions; no broader bound substitutes for them.", + "No model-equivalence, production or performance qualification claim. Historical failed/superseded evidence remains unchanged." + ], + "repository": "akol1/TensorFold", + "checksum_url": "https://raw.githubusercontent.com/akol1/TensorFold/164be6e57dae9124893e27d8d1ac8a1be7d03f1c/SHA256SUMS", + "privacy_review": { + "payload_files_reviewed": 23, + "scope": "All 21 archive members plus full Transformers payload and run log; JSON identifying fields and complete logs inspected. No personal emails, private user paths, internal hosts, IP/MAC addresses, credentials or client identifiers found. Generic container mount paths and public checkpoint metadata retained.", + "hashes": "published bytes match the recorded pre-publication hashes" + }, + "latest_commit": "164be6e57dae9124893e27d8d1ac8a1be7d03f1c", + "historical_commit": "9d07324dc7920fcff03152ff48c8fcc0e408a425", + "current_privacy_review": { + "text_and_metadata_sensitive_pattern_findings": 0, + "numeric_tensor_files": 186, + "scope": "Complete current publication payload and archive headers; approved public GitHub aliases retained. Original tensor bytes derive from checksum-verified public Qwen weights and public fixtures. Historical copies outside this publication are outside this review.", + "transformations": "Generated prose samples omitted; client interval origins normalized; no metric, token hash or failing numerical diagnostic is replaced." + } +} diff --git a/docs/receipts/qwen35-bf16-scoring/commands.md b/docs/receipts/qwen35-bf16-scoring/commands.md new file mode 100644 index 00000000000..bf6802067bd --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/commands.md @@ -0,0 +1,112 @@ +# Reproduction commands + +Use the source commits and file hashes recorded in `summary.json`, the pinned +public snapshots in `models.json`, Zig 0.17.0 and NVCC 13.0.88. Use Python +3.11 or newer for the clients; the full CPU reference uses the pinned dependency +versions in the summary. Commands below +use generic local paths. Run one model process under the existing GPU lock on +an authorized test machine. Preserve unrelated deployments and local work. + +## Build and contracts + +```sh +zig build fatbins kernel-contract-fatbins -Dnvcc=/usr/local/cuda/bin/nvcc -Dsm=80,86,89,120,121 +zig build -Dnvcc=/usr/local/cuda/bin/nvcc -Dsm=80,86,89,120,121 -Doptimize=ReleaseFast -Dfatbins=zig-out/fatbin -Dcontract-controls=zig-out/fatbin/contract_controls.fatbin +zig build native qwen35-score-reference -Dnvcc=/usr/local/cuda/bin/nvcc -Dsm=80,86,89,120,121 -Doptimize=ReleaseFast -Dfatbins=zig-out/fatbin -Dcontract-controls=zig-out/fatbin/contract_controls.fatbin +zig build test test-kernel-contract test-golden fuzz-cortheon -j8 --summary all +zig-out/bin/tf-cuda-test kernel-contract-limits zig-out/fatbin +flock -n /tmp/tensorfold-gpu.lock zig-out/bin/tf-cuda-test kernel-contract +python3 tools/zig/lean_check.py +python3 tools/zig/lean_new.py BASE.txt HEAD.txt +python3 -m unittest discover -s tools/zig -p 'test_qwen35_reference*.py' +python3 -m unittest discover -s tools/zig -p test_qwen35_served_reference.py +``` + +`kernel-contract-limits` is a file-only audit; the complete `kernel-contract` +command additionally runs numerical gates, controls and live device checks. +The `qwen-f32-norm-contract` diagnostic runs the two new norm entries alone; +it is not the complete backend receipt. Lean uses the same checker on both +trees and requires zero new findings; inherited findings are counted. + +The original plain/native builds omitted `-Dsm` for its independently compiled H3 +image. Exact original container argv are archived in `host/build-commands.json`. +The first full CUDA attempt therefore failed with `CUDA_ERROR_NO_BINARY_FOR_GPU` +before numerical gates. The explicit five-SM rebuild above corrects that build +setup. Its runner has a separate hash; all 141 common file images were compared +and only the H3 embedding changes. The served native binary stays byte-identical. +The failed attempt, corrected build log and byte-level proof are in the asset. + +## Independent FP64 and Transformers + +```sh +flock -n /tmp/tensorfold-gpu.lock zig-out/bin/tf-qwen35-score-reference MODEL docs/receipts/qwen35-bf16-scoring/reference-fixtures.json captures +python3 tools/zig/qwen35_scores_fp64.py MODEL captures --revision fc05daec18b0a78c049392ed2e771dde82bdf654 --output fp64.json +CUDA_VISIBLE_DEVICES= OMP_NUM_THREADS=16 MKL_NUM_THREADS=16 python3 tools/zig/qwen35_transformers_reference.py --stage all --model MODEL --fixtures docs/receipts/qwen35-bf16-scoring/fixtures.json --api API.json --fp64 FP64.json --captures CAPTURES --revision-record REVISION.json --fp32-4097 --output transformers.json +python3 tools/zig/check_qwen35_served_reference.py http://127.0.0.1:8091 qwen35-bf16 docs/receipts/qwen35-bf16-scoring/fixtures.json transformers.json --output served-reference.json +``` + +For byte-for-byte input provenance, the corrected CPU experiment uses the +historical API continuations/capture tree whose hashes are in its `input_files`. +The actual HTTP comparison uses the current server. Its independent BF16/FP32 +prompt rows are causal and do not use the native auxiliary capture results as +an oracle. Preserve `complete`, strict diagnostic status and exit1 separately; +a diagnostic failure does not mean the forward was omitted or truncated. +Do not remove original FP32 parameter restoration or skip the 4097 FP32 arm. + +## Native server and served clients + +Serving was containerized with four CPUs, 32 GiB RAM, one GPU and a loopback host +port. Adjust paths inside an otherwise equivalent container; the listener may +bind its private bridge interface while only 127.0.0.1 is published to the host. + +```sh +flock -n /tmp/tensorfold-gpu.lock zig-out/native/bin/tensorfold-native serve MODEL --name qwen35-bf16 --host 127.0.0.1 --port 8091 --context 8192 --parallel 4 --prompt-cache-gib 0 --no-thinking --no-update-check --dashboard +python3 tools/zig/check_qwen35_prompt_scores.py http://127.0.0.1:8091 qwen35-bf16 docs/receipts/qwen35-bf16-scoring/fixtures.json --output api.json +python3 tools/bench_openai.py http://127.0.0.1:8091 qwen35-bf16 --tokens 128 --reps 3 --temperatures 0 --output decode.json +python3 tools/bench_concurrent.py http://127.0.0.1:8091 qwen35-bf16 --tokens 128 --reps 3 --temperatures 0,0.7 --levels 1,4 --alone --serial --output concurrent.json +python3 docs/receipts/qwen35-bf16-scoring/reproduce-cache.py http://127.0.0.1:8091 qwen35-bf16 CHAT-FIXTURES.json fresh --output fresh.json +``` + +Restart with `--prompt-cache-gib 2`, then run retained mode with +`--reference fresh.json`. Restart again with cache0, repeat fresh mode and +compare every reply hash against the first fresh run. Cancellation uses: + +```sh +python3 docs/receipts/qwen35-bf16-scoring/reproduce-disconnect.py http://127.0.0.1:8091 qwen35-bf16 docs/receipts/qwen35-bf16-scoring/fixtures.json --output cancellation.json +``` + +For each cold length 2048/8192/32768/65536, start a fresh cache0/C1 server at +context N+32 and run `reproduce-cold.py SOURCE COLD-FIXTURE.json OUTPUT.json`. +The archived fixture includes exact IDs and the rendered request item. +Memory sampling is a separate untimed run: cache0/context8192/C4, +cache2 during retained exactness, and cache0/context65568/C1 admission. +The memory admission run sends 4097 IDs unscored/scored with eight reply tokens. +Record runtime device/pinned/RSS counters, `/proc` VmHWM and cgroup memory.peak +without equating their scopes or publishing process identifiers. + +## Existing formats and SGLang + +Use pinned-main and candidate native binaries against the same prebuilt +assets, checkpoint and quotas, in baseline/candidate/baseline/candidate order. +For each MLX4 and ModelOpt process, run the decode command above; run concurrency +with one repetition in the first two processes. Request `prompt_logprobs:2` +with `[1,2,3]` and one reply token from every process and retain its actual +HTTP 400 refusal. Compare every baseline/candidate full reply hash. Retain the +selected EXL3 export's actual startup outcome and do not claim inference after +`UnexpectedTensor`. + +SGLang image: +`lmsysorg/sglang@sha256:d6e7288627be8b02be88e4bba38e73f6d50e2826869f753c13a4c4385ab3eda9`. +Mount the attached `sglang-precision` folder at `/policy` and set +`PYTHONPATH=/policy`, `HF_HUB_OFFLINE=1`, `TRANSFORMERS_OFFLINE=1`. +Launch `python3 -m sglang.launch_server` under the same GPU lock and quotas: + +```sh +--model-path MODEL --served-model-name qwen35-bf16 --host 0.0.0.0 --port 8091 --dtype bfloat16 --kv-cache-dtype bfloat16 --mamba-ssm-dtype float32 --context-length 8192 --max-running-requests 4 --max-total-tokens 32768 --chunked-prefill-size 4096 --tp-size 1 --mem-fraction-static 0.85 --attention-backend triton --disable-radix-cache --mamba-radix-cache-strategy no_buffer --enable-cache-report --cuda-graph-max-bs-decode 4 +``` + +Use the same decode/concurrency clients, omitting native `--alone --serial` +checks because SGLang has no native token hash. For each cold length use a fresh +process, context N+32, C1, total tokens N+32 and graph batch 1. Keep the generic +cold client's null cache counters and failed qualifier; separately retain the +scheduler's observed cached/new-token accounting. No missing counter is zero. diff --git a/docs/receipts/qwen35-bf16-scoring/fixtures.json b/docs/receipts/qwen35-bf16-scoring/fixtures.json new file mode 100644 index 00000000000..3d9ff25ae06 --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/fixtures.json @@ -0,0 +1 @@ +[[814], [814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890], [727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15], [814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139], [727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111]] \ No newline at end of file diff --git a/docs/receipts/qwen35-bf16-scoring/historical-summary.json b/docs/receipts/qwen35-bf16-scoring/historical-summary.json new file mode 100644 index 00000000000..7753c68d8ff --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/historical-summary.json @@ -0,0 +1,397 @@ +{ + "scope": "historical results; original source identities are retained, not current-binary qualification", + "native_build": "327ef639fb7dbc355f44b4a5efc53209a3e06543", + "contract_source": "5332d97eb387af7e1a10433d77ee032a86bc631a", + "native_sha256": "271398a1c9dab32785759182ae78e2921907d68f86b0053b64e2613cc9038886", + "cuda_contract": { + "schema": 1, + "source_commit": "5332d97eb387af7e1a10433d77ee032a86bc631a", + "native_version": "1.2.1", + "runner_sha256": "31ee399fc7df52c8dd719f1d3a1cb5494d6817700507b32a804458724f3fb729", + "command": "zig-out/bin/tf-cuda-test kernel-contract", + "exit": 1, + "status": "failed: launch limits", + "summary": "SUMMARY 550 kernels: 550 pass gates 1-4, 0 fail, 6 known findings; 365 controls: 365 red as planted, 0 missed; 342 limit problems; gates 4013421 ms, limits 726300 ms", + "numerical_kernels": 550, + "numerical_pass": 550, + "numerical_fail": 0, + "registered_known_findings": 6, + "controls": 365, + "controls_red": 365, + "controls_missed": 0, + "limit_problems": 342, + "registry_limit_problems": 188, + "live_device_limit_problems": 154, + "known_findings": [ + "KNOWN nonfinite cuda qwen35 decode attention, bf16 cache (tf_q35_attn_partial, tf_q35_attn_merge): a NaN key in one of a row's several chunks leaves the row finite: tf_q35_attn_merge skips that chunk", + "KNOWN nonfinite cuda qwen35 decode attention, fp8 cache (tf_q35_attn_partial8, tf_q35_attn_merge): a NaN key in one of a row's several chunks leaves the row finite: tf_q35_attn_merge skips that chunk", + "KNOWN nonfinite cuda glm tf_glm_scores on pages out of order: relu is fmaxf(x, 0), as Triton's tl.maximum: a NaN dot scores 0 where float64 keeps the NaN", + "KNOWN nonfinite cuda glm tf_glm_index_scores on pages out of order: relu is fmaxf(x, 0), as Triton's tl.maximum: a NaN dot scores 0 where float64 keeps the NaN", + "KNOWN nonfinite cuda qwen35 contiguous attention, bf16 cache (tf_q35_attn_partial_legacy, tf_q35_attn_merge): a NaN key in one of a row's several chunks leaves the row finite: tf_q35_attn_merge skips that chunk", + "KNOWN nonfinite cuda qwen35 contiguous attention, fp8 cache (tf_q35_attn_partial8_legacy, tf_q35_attn_merge): a NaN key in one of a row's several chunks leaves the row finite: tf_q35_attn_merge skips that chunk" + ], + "new_live_records": [ + "PASS limits live qwen35_bf16_rows tf_q35_dense_f32: 256 threads launched, the driver allows 256; 42 registers, 32 + 0 shared bytes (recorded 42, 32)", + "PASS limits live qwen35_bf16_rows tf_q35_score_stats: 256 threads launched, the driver allows 256; 40 registers, 5128 + 0 shared bytes (recorded 40, 5128)", + "PASS limits live contract_controls tf_ctl_q35_score_tail: 256 threads launched, the driver allows 256; 40 registers, 5136 + 0 shared bytes (recorded 40, 5136)", + "PASS limits live contract_controls tf_ctl_q35_dense_f32_half: 256 threads launched, the driver allows 256; 37 registers, 0 + 0 shared bytes (recorded 37, 0)" + ], + "parent_full_or_live_only_run": "not-run; the unchanged parent has a separate matched five-SM asset audit, not a full live SUMMARY" + }, + "host_and_ci": { + "zig": "0.17.0", + "source_commit": "5332d97eb387af7e1a10433d77ee032a86bc631a", + "full_unprivileged_linux_host": { + "steps_pass": 551, + "steps_total": 551, + "tests_pass": 6870, + "tests_total": 6916, + "tests_skipped": 46, + "scope": "before later harness-only changes" + }, + "strict_host_rerun": { + "steps_pass": 551, + "steps_total": 551, + "executed_pass": 467, + "executed_total": 469, + "skipped": 2, + "other_results": "cached" + }, + "plain_build": { + "steps_pass": 30, + "steps_total": 30 + }, + "lean": { + "base": 424, + "candidate": 424, + "new": 0 + }, + "hosted_ci": { + "head": "284339b080b3af960822458158ab69a7bbaf6bd7", + "no_gpu_run": 41630994602, + "no_gpu_jobs_pass": 6, + "format_run": 41630994734, + "status": "passed; final receipt head requires its own CI status" + }, + "repro_cache_client_tests": { + "count": 6, + "mac_python_versions": [ + "3.11", + "3.14" + ], + "linux_python": "3.14", + "status": "passed" + }, + "scope": "production inference and kernel trees unchanged by receipt-only additions", + "publication_review": { + "head": "54f9459411254a7b04ca8efb8f90166b53bd9738", + "format_run": 41764090357, + "no_gpu_run": 41764090345, + "status": "both cancelled; not a hosted pass", + "scope": "Original successful runs above retain their original tested commit IDs." + } + }, + "existing_formats": [ + { + "format": "mlx4", + "checkpoint": { + "label": "mlx4", + "repo": "mlx-community/Qwen3.5-27B-4bit", + "revision": "45797d2985a12c55e6473686e9ea91b95e959553" + }, + "process_order": [ + "parent", + "candidate", + "parent", + "candidate" + ], + "reply_tokens": 128, + "decode_repetitions_per_process": 3, + "decode": [ + { + "prompt": "fibonacci-raw", + "parent_tps": 83.5559698516554, + "candidate_tps": 83.59971984798531, + "change_percent": 0.052360108329274624, + "all_process_medians": [ + 83.50909120252324, + 83.49400143200344, + 83.60287481657802, + 83.70557212248738 + ], + "all_process_ttft_medians_s": [ + 0.015475979998882394, + 0.015516241001023445, + 0.01543800299987197, + 0.015471892002096865 + ] + }, + { + "prompt": "gpu-chat-no-think", + "parent_tps": 80.30091528978619, + "candidate_tps": 80.24917238596198, + "change_percent": -0.06443625659493524, + "all_process_medians": [ + 80.25778005222816, + 80.22391705558798, + 80.34407371075048, + 80.27443566697885 + ], + "all_process_ttft_medians_s": [ + 0.07912822800062713, + 0.07910096300111036, + 0.07914762700238498, + 0.07911434700145037 + ] + } + ], + "concurrent_matched_full_token_hashes": 20, + "concurrent_cells": 8, + "concurrent_repetitions": 1, + "scope": "descriptive measurements; no statistical significance or noninferiority claim; all observations retained" + }, + { + "format": "modelopt", + "checkpoint": { + "label": "modelopt", + "repo": "nvidia/Qwen3.8-27B-NVFP4", + "revision": "482ca0f3832238542f8f5295dde86b5f22711d80" + }, + "process_order": [ + "parent", + "candidate", + "parent", + "candidate" + ], + "reply_tokens": 128, + "decode_repetitions_per_process": 3, + "decode": [ + { + "prompt": "fibonacci-raw", + "parent_tps": 63.33355811331779, + "candidate_tps": 63.358063349350616, + "change_percent": 0.038692340621349075, + "all_process_medians": [ + 63.35949423899684, + 63.34044933515465, + 63.3076326045577, + 63.37568226173563 + ], + "all_process_ttft_medians_s": [ + 0.01856982900062576, + 0.018574689998786198, + 0.01859317999696941, + 0.018466502999217482 + ] + }, + { + "prompt": "gpu-chat-no-think", + "parent_tps": 63.34511381231144, + "candidate_tps": 63.39848246173967, + "change_percent": 0.08425061731889283, + "all_process_medians": [ + 63.419731928457956, + 63.388599797130574, + 63.27058349002793, + 63.408366667115715 + ], + "all_process_ttft_medians_s": [ + 0.08873100400160183, + 0.08872744899781537, + 0.08880955100175925, + 0.08870272299827775 + ] + } + ], + "concurrent_matched_full_token_hashes": 20, + "concurrent_cells": 8, + "concurrent_repetitions": 1, + "scope": "descriptive measurements; no statistical significance or noninferiority claim; all observations retained" + } + ], + "cold": [ + { + "prompt_tokens": 2048, + "native_ttft_s": 49.5693300540006, + "sglang_ttft_s": 0.4426989009989484, + "native_http_cached_tokens": 0, + "sglang_http_cached_tokens": null, + "sglang_scheduler_cached_tokens": 0, + "reply_tokens": 8, + "context": 2080, + "parallel": 1, + "native_read_timeout_s": 1800, + "sglang_read_timeout_s": 1800 + }, + { + "prompt_tokens": 8192, + "native_ttft_s": 199.2718902859997, + "sglang_ttft_s": 1.9073836259995005, + "native_http_cached_tokens": 0, + "sglang_http_cached_tokens": null, + "sglang_scheduler_cached_tokens": 0, + "reply_tokens": 8, + "context": 8224, + "parallel": 1, + "native_read_timeout_s": 1800, + "sglang_read_timeout_s": 1800 + }, + { + "prompt_tokens": 32768, + "native_ttft_s": 799.2212812930011, + "sglang_ttft_s": 9.260067242998048, + "native_http_cached_tokens": 0, + "sglang_http_cached_tokens": null, + "sglang_scheduler_cached_tokens": 0, + "reply_tokens": 8, + "context": 32800, + "parallel": 1, + "native_read_timeout_s": 1800, + "sglang_read_timeout_s": 1800 + }, + { + "prompt_tokens": 65536, + "native_ttft_s": 1601.2906949770004, + "sglang_ttft_s": 24.579153923998092, + "native_http_cached_tokens": 0, + "sglang_http_cached_tokens": null, + "sglang_scheduler_cached_tokens": 0, + "reply_tokens": 8, + "context": 65568, + "parallel": 1, + "native_read_timeout_s": 3600, + "sglang_read_timeout_s": 3600 + } + ], + "reference_verdict": { + "status": "failed", + "scope": "captured native rows, not a direct HTTP prompt-score comparison", + "policy": "both reference directions reported; maintainer acceptance remains outstanding", + "allowance": "existing native FP64 head box plus recorded subtraction slack; no hidden-state term", + "rows": 18, + "numerical_bound_passed": true, + "fp32_envelope_failures": 3, + "bf16_envelope_failures": 1, + "outside_rows": [ + { + "capture": 10, + "phase": "prompt", + "fixture": 3, + "position": 255, + "native_to_fp32": 2.3814449310302734, + "bf16_to_fp32": 1.5509891510009766, + "existing_head_rounding_allowance": 0.0005161204072910023, + "fp32_envelope_passed": false, + "bf16_envelope_passed": true + }, + { + "capture": 10, + "phase": "prompt", + "fixture": 3, + "position": 256, + "native_to_fp32": 0.00258636474609375, + "bf16_to_fp32": 0.00043487548828125, + "existing_head_rounding_allowance": 0.0005714825015808292, + "fp32_envelope_passed": false, + "bf16_envelope_passed": false + }, + { + "capture": 13, + "phase": "decode", + "fixture": 3, + "position": 260, + "native_to_fp32": 0.0077800750732421875, + "bf16_to_fp32": 0.005237579345703125, + "existing_head_rounding_allowance": 0.000552657729442496, + "fp32_envelope_passed": false, + "bf16_envelope_passed": true + } + ] + }, + "superseded_reference": "Earlier auto-dtype forward downcast96 storedFP32 parameters; corrected full reference restores their exact stored values. Its historical native captures are auxiliary, not new HTTP evidence.", + "native_decode": [ + { + "label": "", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 23.826203304282874, + "decode_tps_all": [ + 23.86, + 23.83, + 23.8 + ], + "ttft_s_median": 0.34664049099956173, + "prefill_tps_median": 40.388, + "itl_mean_ms_median": 41.971, + "itl_p50_ms_median": 33.946, + "itl_p95_ms_median": 34.115, + "round_gap_p50_ms_median": 33.948, + "round_gap_p95_ms_median": 34.115, + "tokens_per_chunk_median": 1.032 + }, + { + "label": "", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 29.380902734832876, + "decode_tps_all": [ + 29.4, + 29.38, + 29.36 + ], + "ttft_s_median": 0.7605028060024779, + "prefill_tps_median": 40.763, + "itl_mean_ms_median": 34.036, + "itl_p50_ms_median": 34.034, + "itl_p95_ms_median": 34.085, + "round_gap_p50_ms_median": 34.034, + "round_gap_p95_ms_median": 34.085, + "tokens_per_chunk_median": 1.0 + } + ], + "standard_decode": [ + { + "label": "", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 27.623239738269106, + "decode_tps_all": [ + 27.69, + 27.62, + 27.56 + ], + "ttft_s_median": 0.075827003998711, + "prefill_tps_median": null, + "itl_mean_ms_median": 36.201, + "itl_p50_ms_median": 36.207, + "itl_p95_ms_median": 36.324, + "round_gap_p50_ms_median": 36.207, + "round_gap_p95_ms_median": 36.324, + "tokens_per_chunk_median": 1.0 + }, + { + "label": "", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 27.50692738791149, + "decode_tps_all": [ + 27.53, + 27.51, + 27.47 + ], + "ttft_s_median": 0.07972962099665892, + "prefill_tps_median": null, + "itl_mean_ms_median": 36.354, + "itl_p50_ms_median": 36.353, + "itl_p95_ms_median": 36.538, + "round_gap_p50_ms_median": 36.353, + "round_gap_p95_ms_median": 36.538, + "tokens_per_chunk_median": 1.0 + } + ], + "archive_sha256": "ccda986558edd769735f6d4d7a9e48cc54b104fe87c70a47f8fd275dd7b485f4" +} diff --git a/docs/receipts/qwen35-bf16-scoring/layer-diagnostic.md b/docs/receipts/qwen35-bf16-scoring/layer-diagnostic.md new file mode 100644 index 00000000000..290dd1dcb7e --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/layer-diagnostic.md @@ -0,0 +1,53 @@ +# Public BF16 layer diagnostic + +This supplement addresses the maintainer's request on PR #2020: locate the first residual boundary where the native CUDA body exceeds Transformers BF16's own distance from promoted FP32 on the 32-token fixture. It adds observation to the production forward; it changes no kernel, sum, tolerance or weight value. + +The checkpoint is public `Qwen/Qwen3.5-27B` at `fc05daec18b0a78c049392ed2e771dde82bdf654`. The exact 32 IDs are fixture index 1 in `fixtures.json`. Both reference arms preserve and byte-check the checkpoint's 96 stored FP32 parameters. The FP32 arm promotes the checkpoint's stored BF16 parameters; it is not a separate FP32 training checkpoint. + +The native capture reads the residual buffer after the production input norm has materialized the preceding residual addition. Boundary 0 is embedding, boundaries 1–64 are the outputs of zero-based layers 0–63, and boundary 65 is final normalization. Synchronization and host copies occur only with the developer trace enabled. A second fresh-cache, untraced production forward must produce identical final BF16 logits or the capture exits nonzero. + +The primary comparison covers hidden rows 0–30, which predict the 31 actually served prompt IDs at positions 1–31. The unscored last input row is retained in a separate all-32-row view. At each boundary the rule is `max(abs(native - FP32)) <= max(abs(Transformers BF16 - FP32))`, with no added tolerance. The report retains maxima, medians, RMS, worst coordinates and elementwise violations; none substitutes for the stated maximum rule. Final normalization is reported separately from residual layers. + +The BF16 reference's captured final hidden rows must equal the public Transformers library entry point. The promoted-FP32 arm checks layers 0, 3 and 63 against independently cloned FP32 layers. Missing, inconsistent or nonfinite tensors are errors. Planted drift must make the comparison CLI exit 1; a large difference confined to the unscored final row must not alter the primary served-row verdict. + +## Result + +The first exceeding residual is **zero-based layer 0**, the first linear-attention block. Embeddings match exactly. Over the 31 served hidden rows, layer 0 has native-to-FP32 maximum **0.07647705078125**, versus the BF16 arm's own maximum **0.056326866149902344**. Its worst native coordinate is input row 21, hidden column 3994: native 15.5625, promoted FP32 15.63897705078125, BF16 reference 15.625. The all-32-row view finds the same first layer. + +| Boundary | Native–FP32 worst | BF16–FP32 worst | Within own maximum | +| --- | ---: | ---: | --- | +| Embedding | 0 | 0 | passed | +| Layer 0 residual | 0.07647705078125 | 0.056326866149902344 | failed | +| Layer 1 residual | 0.09848594665527344 | 0.09848594665527344 | passed | +| Layer 2 residual | 0.19491863250732422 | 0.1948375701904297 | failed | +| Layer 3 residual | 0.199066162109375 | 0.188201904296875 | failed | +| Layer 63 residual | 4.7076416015625 | 7.054046630859375 | passed | +| Final normalization | 0.31170082092285156 | 0.4594573974609375 | passed | + +The rule fails at **18/64 residual layers**. The complete 66-boundary table, both row scopes, worst coordinates, medians, RMS and all 198 unchanged arrays are in the linked packet. Some later boundaries return inside the maximum; final normalization passing this hidden-state rule does not overturn the separately failing served-logprob rule. No hidden-distance allowance or new tolerance is used. + +Native producer: `9416f0cf94bddbea49becb4c14047d0c16d08faf`; Transformers producer: `b54d8ff7691385fe420399e72272c932a881e29e`; comparison: `c6930073d5192663bd5726ff74a8fa426f7a06aa`; main base: `002c9e03eecf9b10b83a73b9149dc7f49d50368a`. Later comparison/docs changes do not relabel those executions. Native traced/untraced logits match; both reference cross-checks pass, and all 11 public shard hashes match pinned LFS after capture. + +The GPU is one RTX PRO 6000 Blackwell Max-Q workstation card, sm_120. The host has a Ryzen 9 9950X3D and 128 GB RAM class. Reference limits are 16 CPUs/96 GiB; the native capture has no CPU/RAM cgroup limit. This is a synchronized diagnostic, not a four-CPU/32-GiB serving or latency benchmark. Original running deployments and active-service health were restored. + +[Compact summary](layers.json), [archive hashes](asset.json), and [immutable archive/member manifest](https://raw.githubusercontent.com/akol1/TensorFold/7f54a5445ef4defa879b2b1fa76d01a64afdb5f4/qwen35-bf16-layers-20261105.manifest.json). Extract all three layer archives into one directory to reproduce the comparison. The 217-file packet retains complete build/capture logs and a superseded partial-export test-setup failure; the complete current-source reference suite passes 20/20. + +The subsequent integration uses main `9200a3064153b8041930f61f5ba92102d4bea692` and the refreshed parent `d19ff3f075eb144870af1af159de1eccafd0b69b`. The complete Qwen CUDA family and CUDA kernel source trees are byte-identical to the native diagnostic producer `9416f0cf`; the new upstream changes and parent test-registration placement are checked separately. This source comparison does not relabel the device execution. + +## Reproduce + +Use Zig 0.17.0 and a CUDA toolchain supported by the repository. The recorded run uses NVCC 13.0.88 and one sm_120 GPU. The CPU reference uses Python 3.12.3, Torch 2.15.0+cu132, Transformers 5.22.1, accelerate 1.15.0, safetensors 0.8.0 and NumPy 2.5.4, with eager attention and CUDA disabled. CPU fallback implementations are disclosed in the reference log. + +```sh +python3 -c 'import json; print(json.dumps(json.load(open("docs/receipts/qwen35-bf16-scoring/fixtures.json"))[1],separators=(",",":")))' > ids.json +zig build fatbins kernel-contract-fatbins -Dnvcc=/usr/local/cuda/bin/nvcc -Dsm=80,86,89,120,121 +zig build qwen35-hidden-reference -Dnvcc=/usr/local/cuda/bin/nvcc -Doptimize=ReleaseFast -Dfatbins=zig-out/fatbin +zig-out/bin/tf-qwen35-hidden-reference MODEL_DIR ids.json native +CUDA_VISIBLE_DEVICES= OMP_NUM_THREADS=16 MKL_NUM_THREADS=16 python3 tools/zig/qwen35_layer_reference.py --model MODEL_DIR --ids ids.json --output reference +python3 tools/zig/qwen35_layer_compare.py --native native --reference reference --output comparison.json +python3 -m unittest discover -s tools/zig -p 'test_qwen35*.py' -v +``` + +Use the existing GPU lock and admission guard, with one model process per test machine. Each reference output directory must be empty. Preserve the comparison's actual nonzero exit when the rule fails. + +This is one public fixture on one CUDA GPU, with a CPU reference. It does not qualify other prompts, lengths, devices, multiple ranks, performance or whole-model equivalence. The existing four per-length failures and historical FP64 head receipt remain unchanged. A first exceeding boundary locates observed drift; it does not alone establish a single faulty accumulation or an unavoidable format floor. diff --git a/docs/receipts/qwen35-bf16-scoring/layers.json b/docs/receipts/qwen35-bf16-scoring/layers.json new file mode 100644 index 00000000000..dda370e72cb --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/layers.json @@ -0,0 +1,91 @@ +{ + "kind": "public-Qwen-BF16-layer-diagnostic", + "status": "failed", + "rule": "per boundary, max |native-FP32| <= max |Transformers BF16-FP32|; no added tolerance", + "shape": { + "rows": 32, + "hidden": 5120, + "layers": 64, + "boundaries": 66 + }, + "compared_rows": 31, + "row_scope": "hidden rows 0..N-2 predict the served prompt IDs 1..N-1", + "first_exceeding_layer_zero_based": 0, + "residual_layers_exceeding": 18, + "embedding_exact": true, + "first_exceeding_boundary": { + "native_fp32_max_abs": 0.07647705078125, + "bf16_fp32_max_abs": 0.056326866149902344, + "native_fp32_median_abs": 7.019576150923967e-05, + "bf16_fp32_median_abs": 6.481166929006577e-05, + "native_fp32_rms": 0.0005021040918941921, + "bf16_fp32_rms": 0.0004253591354658401, + "native_bf16_max_abs": 0.0625, + "elements_exceeding_own_distance": 59355, + "worst_native_row": 21, + "worst_native_column": 3994, + "native_at_worst": 15.5625, + "fp32_at_worst": 15.63897705078125, + "bf16_at_worst": 15.625, + "within_bf16_max_distance": false, + "boundary": 1, + "layer": 0, + "kind": "residual" + }, + "final_normalization": { + "native_fp32_max_abs": 0.31170082092285156, + "bf16_fp32_max_abs": 0.4594573974609375, + "native_fp32_median_abs": 0.011119425296783447, + "bf16_fp32_median_abs": 0.011873185634613037, + "native_fp32_rms": 0.021408769515065724, + "bf16_fp32_rms": 0.021956164994282882, + "native_bf16_max_abs": 0.5, + "elements_exceeding_own_distance": 66838, + "worst_native_row": 30, + "worst_native_column": 671, + "native_at_worst": -9.8125, + "fp32_at_worst": -10.124200820922852, + "bf16_at_worst": -10.0, + "within_bf16_max_distance": true, + "boundary": 65, + "layer": null, + "kind": "final_norm" + }, + "native_source": "9416f0cf94bddbea49becb4c14047d0c16d08faf", + "reference_source": "b54d8ff7691385fe420399e72272c932a881e29e", + "comparison_source": "c6930073d5192663bd5726ff74a8fa426f7a06aa", + "main_base": "002c9e03eecf9b10b83a73b9149dc7f49d50368a", + "capture_binary": { + "sha256": "ed07aa525035f50686b54e18fc2e54d68da8324445d33cea40147f56917bb513", + "bytes": 99093608 + }, + "trace_plain_logits_equal": true, + "reference_checks": { + "BF16_public_library_final_hidden_equal": true, + "FP32_independent_cloned_layers": [ + 0, + 3, + 63 + ], + "stored_FP32_parameters_preserved": 96, + "public_checkpoint_shard_hashes_verified": 11 + }, + "comparison_member": { + "archive": "qwen35-bf16-layers-native-20261105.tar.gz", + "file": "comparison.json", + "sha256": "e009014319c580246514c01bf54027368b23e254287f9b4d065cb6bd2c8ddfe9" + }, + "external_member_manifest": "https://raw.githubusercontent.com/akol1/TensorFold/7f54a5445ef4defa879b2b1fa76d01a64afdb5f4/qwen35-bf16-layers-20261105.manifest.json", + "limitations": [ + "This locates the first observed excess; it does not prove an isolated accumulation bug or an unavoidable format floor.", + "Global hidden-state maxima do not waive the separately failed served-logprob rule.", + "One public 32-ID fixture, one sm_120 GPU/rank, CPU references. No new performance or whole-model-equivalence qualification.", + "The full CUDA run at b168b36d remains historical; a complete device suite was not rerun on the rebased head." + ], + "subsequent_integration": { + "main": "9200a3064153b8041930f61f5ba92102d4bea692", + "parent": "d19ff3f075eb144870af1af159de1eccafd0b69b", + "qwen_cuda_family_and_kernel_sources_byte_equal_to_native_producer": true, + "coverage": "source identity plus new host/CI checks; no relabeling of the actual device producer" + } +} diff --git a/docs/receipts/qwen35-bf16-scoring/manifest.json b/docs/receipts/qwen35-bf16-scoring/manifest.json new file mode 100644 index 00000000000..9dd88655c54 --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/manifest.json @@ -0,0 +1,80 @@ +{ + "schema": 3, + "qualified_source": "b168b36d0cc3503ae69e8bffcad494574019caf5", + "qualified_source_tree": "652aec7a5953ddc204005696b8f5281c72d23111", + "public_alias_equivalent": "55dbec4758f42ca08a7e7dede4ebd5da7877119f", + "pinned_main_baseline": "0d19cc19b5b49a0b4a0188a56b6705bbedae91e4", + "executed_dependency": "789846adbf0b6bde4a9734fdc7c7e36e65702c64", + "submitted_parent": "30e9b87284d4cad99ef6b826d95f5578d6341f63", + "last_code_followup": "c6f3e221ac5a2914fcd3a6b950eb620d1eaaa23b", + "native_sha256": "fa2f415a1b7a6f47a62ee078e7f6de86f3f677d2bf74ffa5c2d273e1ce713a64", + "complete_cuda_runner_sha256": "1cec1417c7d6d47ff86cf278dbba47f60267e9f9e4b99ca4d2a7964863555c39", + "evidence_commit": "164be6e57dae9124893e27d8d1ac8a1be7d03f1c", + "scope": "Every execution retains its real producer. Final receipt-only commit identity and hosted CI are reported on the PR. This manifest covers all receipt files except itself.", + "files": { + "README.md": { + "bytes": 16419, + "sha256": "872bbc67cea934ed0e72ea584c7563b23d60a101e44ec346eb99f0d4e8c8289a" + }, + "asset.json": { + "bytes": 7534, + "sha256": "f823546290e20e1d05d35138cb1752a70b4faa29334c2731009606f276748626" + }, + "commands.md": { + "bytes": 7538, + "sha256": "4bcbbdca93fe2b710b8a12c7a9e262f7a5f67fa8033d97ea622fae2796cc9021" + }, + "fixtures.json": { + "bytes": 22875, + "sha256": "c83f0cb7e56f447de3b6131b921ac06b0743cbfcdfbe856970f0f5e7e9c61fe4" + }, + "historical-summary.json": { + "bytes": 13893, + "sha256": "a7e91de61a5a3ab72b86e4e5bceacf09323544c5d558c45f5143ee2b815a021a" + }, + "models.json": { + "bytes": 535, + "sha256": "acb06444d0baa3e49bad1b89111c7673e5f8d2c6d93b4c024779e66c3ab87b1e" + }, + "reference-fixtures.json": { + "bytes": 2274, + "sha256": "c2b05afefcdbea4504deb799e68b581e0635b9c316927549418674a480efb289" + }, + "reference-verdict.json": { + "bytes": 1414, + "sha256": "7b53f1df4abaa1e0cddb6442442533858936abde13aed868bc632120cdbe3714" + }, + "reproduce-cache.py": { + "bytes": 3613, + "sha256": "6334a19acfa43de98ebe614dfbb61db047de435eb661fcff228d5c39f229eecd" + }, + "reproduce-cold.py": { + "bytes": 1444, + "sha256": "de1d8d6d9f778a34041fbc9cac7ea5ad3e728080da5f735dbabb952669d91ee1" + }, + "reproduce-disconnect.py": { + "bytes": 6455, + "sha256": "b786fdb8eebc8f9cb82a0edea70055dcc1ddcfe587d19c9077febefaf161e2a9" + }, + "sglang-precision/sitecustomize.py": { + "bytes": 300, + "sha256": "2129ecd851b0d174fb578c4bb9c3d502093373d6866e620391cf398f60b44608" + }, + "source-provenance.json": { + "bytes": 2234, + "sha256": "40dad69a1ff230145aad11df87bf7da3a9c12bd45ccb1f67c4b34698b9c80aa1" + }, + "summary.json": { + "bytes": 107387, + "sha256": "34b511ad911553b486fb01518b1e32432b42a48820a3bfab6c2e19b34b120c7c" + }, + "test_reproduce_cache.py": { + "bytes": 2182, + "sha256": "3c9abb1f25499a0937859cff5ad0ecc8f37b8f303c61234d144b1dada6b133cf" + }, + "transformers-comparison.json": { + "bytes": 10677, + "sha256": "0bd9232cf5eb3fc7151c899ff7aaa4a1a5a4d4656bdfc5024a3a1b4d72609731" + } + } +} diff --git a/docs/receipts/qwen35-bf16-scoring/models.json b/docs/receipts/qwen35-bf16-scoring/models.json new file mode 100644 index 00000000000..5a3f7bb8212 --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/models.json @@ -0,0 +1,22 @@ +[ + { + "label": "bf16", + "repo": "Qwen/Qwen3.5-27B", + "revision": "fc05daec18b0a78c049392ed2e771dde82bdf654" + }, + { + "label": "mlx4", + "repo": "mlx-community/Qwen3.5-27B-4bit", + "revision": "45797d2985a12c55e6473686e9ea91b95e959553" + }, + { + "label": "modelopt", + "repo": "nvidia/Qwen3.8-27B-NVFP4", + "revision": "482ca0f3832238542f8f5295dde86b5f22711d80" + }, + { + "label": "exl3", + "repo": "UnstableLlama/Qwen3.5-27B-exl3-4.00bpw", + "revision": "dc0df71be8810b51ed04eb43b51341f609a75fa2" + } +] diff --git a/docs/receipts/qwen35-bf16-scoring/reference-fixtures.json b/docs/receipts/qwen35-bf16-scoring/reference-fixtures.json new file mode 100644 index 00000000000..afa8105b965 --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/reference-fixtures.json @@ -0,0 +1 @@ +[[814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890], [727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15, 11, 220, 16, 198, 262, 364, 696, 303, 2020, 1393, 1590, 198, 285, 264, 11, 292, 283, 292, 11, 264, 478, 292, 198, 262, 460, 264, 198, 727, 73111, 1393, 1590, 198, 262, 264, 11, 292, 283, 220, 15], [814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139, 1204, 5979, 44896, 5533, 264, 21966, 13, 357, 5979, 682, 6761, 321, 7890, 13, 220, 814, 20139]] \ No newline at end of file diff --git a/docs/receipts/qwen35-bf16-scoring/reference-verdict.json b/docs/receipts/qwen35-bf16-scoring/reference-verdict.json new file mode 100644 index 00000000000..ced12587a2e --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/reference-verdict.json @@ -0,0 +1,45 @@ +{ + "status": "failed", + "scope": "captured native rows, not a direct HTTP prompt-score comparison", + "policy": "both reference directions reported; maintainer acceptance remains outstanding", + "allowance": "existing native FP64 head box plus recorded subtraction slack; no hidden-state term", + "rows": 18, + "numerical_bound_passed": true, + "fp32_envelope_failures": 3, + "bf16_envelope_failures": 1, + "outside_rows": [ + { + "capture": 10, + "phase": "prompt", + "fixture": 3, + "position": 255, + "native_to_fp32": 2.3814449310302734, + "bf16_to_fp32": 1.5509891510009766, + "existing_head_rounding_allowance": 0.0005161204072910023, + "fp32_envelope_passed": false, + "bf16_envelope_passed": true + }, + { + "capture": 10, + "phase": "prompt", + "fixture": 3, + "position": 256, + "native_to_fp32": 0.00258636474609375, + "bf16_to_fp32": 0.00043487548828125, + "existing_head_rounding_allowance": 0.0005714825015808292, + "fp32_envelope_passed": false, + "bf16_envelope_passed": false + }, + { + "capture": 13, + "phase": "decode", + "fixture": 3, + "position": 260, + "native_to_fp32": 0.0077800750732421875, + "bf16_to_fp32": 0.005237579345703125, + "existing_head_rounding_allowance": 0.000552657729442496, + "fp32_envelope_passed": false, + "bf16_envelope_passed": true + } + ] +} diff --git a/docs/receipts/qwen35-bf16-scoring/reproduce-cache.py b/docs/receipts/qwen35-bf16-scoring/reproduce-cache.py new file mode 100644 index 00000000000..d6d9b30749b --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/reproduce-cache.py @@ -0,0 +1,68 @@ +"""Check native chat retention against a cache-off reference using the existing HTTP benchmark clients.""" +import argparse +import hashlib +import json +from pathlib import Path +import re +import sys + +sys.path.insert(0, str(Path(__file__).resolve().parents[3] / 'tools')) +import bench_cache + + +def qualified(rows, count, retained, edited): + if any(row.get('tokens') != 8 or type(row.get('cached_tokens')) is not int for row in rows): + return False + if not bench_cache.qualify(rows, count, not retained or not edited, retained): + return False + hashes = [row.get('token_sha256') for row in rows] + if not all(isinstance(value, str) and re.fullmatch('[0-9a-f]{64}', value) for value in hashes): + return False + if len(set(hashes)) != 1: + return False + return not retained or not edited or rows[0].get('cached_tokens', 0) > 0 + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('base') + parser.add_argument('model') + parser.add_argument('fixtures') + parser.add_argument('mode', choices=('fresh', 'retained')) + parser.add_argument('--reference', help='A fresh-mode output; compare every retained reply by full token hash') + parser.add_argument('--output', required=True) + args = parser.parse_args() + fixtures = json.loads(Path(args.fixtures).read_text()) + reference = json.loads(Path(args.reference).read_text()) if args.reference else None + report = {'schema_version': 1, 'mode': args.mode, 'reply_tokens': 8, 'temperature': 0, 'seed': 1234, + 'client': 'bench_concurrent.stream/together and bench_cache.receipt/qualify', + 'client_source_sha256': hashlib.sha256(Path(__file__).read_bytes()).hexdigest(), 'records': []} + retained = args.mode == 'retained' + for index, fixture in enumerate(fixtures): + item = fixture['item'] + first = bench_cache.bench.stream(args.base, args.model, item, 8, 0, 1234) + rows = [bench_cache.receipt(first, 'first')] + if retained: + repeated = bench_cache.bench.stream(args.base, args.model, item, 8, 0, 1234) + rows.append(bench_cache.receipt(repeated, 'repeated', first)) + concurrent = bench_cache.bench.together(args.base, args.model, [(item, 1234)], 8, 0)[0] + rows.append(bench_cache.receipt(concurrent, 'concurrent', first)) + digest = hashlib.sha256(json.dumps(fixture['token_ids']).encode()).hexdigest() + passed = (len(fixture['token_ids']) == fixture['count'] and digest == fixture['token_ids_sha256']) and qualified(rows, fixture['count'], retained, index > 0) + record = {'fixture': fixture['name'], 'fixture_sha256': digest, 'rows': rows, 'qualified': passed} + if reference is not None: + candidates = [row for row in reference['records'] if row['fixture'] == fixture['name']] + record['equals_fresh'] = (reference['mode'] == 'fresh' and reference['qualified'] and len(candidates) == 1 + and candidates[0]['fixture_sha256'] == digest + and all(row['token_sha256'] == candidates[0]['rows'][0]['token_sha256'] for row in rows)) + record['qualified'] &= record['equals_fresh'] + report['records'].append(record) + report['qualified'] = bool(report['records']) and all(row['qualified'] for row in report['records']) + encoded = json.dumps(report, indent=2) + '\n' + Path(args.output).write_text(encoded) + print(encoded, end='') + return 0 if report['qualified'] else 1 + + +if __name__ == '__main__': + raise SystemExit(main()) diff --git a/docs/receipts/qwen35-bf16-scoring/reproduce-cold.py b/docs/receipts/qwen35-bf16-scoring/reproduce-cold.py new file mode 100644 index 00000000000..717322445f3 --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/reproduce-cold.py @@ -0,0 +1,22 @@ +import argparse, hashlib, json, pathlib, sys +p=argparse.ArgumentParser();p.add_argument('source');p.add_argument('fixture');p.add_argument('output');a=p.parse_args() +sys.path.insert(0,a.source+'/tools') +import bench_cache +fixture=json.loads(pathlib.Path(a.fixture).read_text()) +ids=fixture['token_ids'] if isinstance(fixture,dict) else fixture +item=fixture['item'] if isinstance(fixture,dict) else {'name':'public-fixture','kind':'completion','prompt':ids} +timeout=3600 if len(ids)>=65536 else 1800 +original_urlopen=bench_cache.bench.urllib.request.urlopen +def open_with_timeout(*args,**kwargs): + kwargs['timeout']=timeout + return original_urlopen(*args,**kwargs) +bench_cache.bench.urllib.request.urlopen=open_with_timeout +try: + run=bench_cache.bench.stream('http://127.0.0.1:8091','qwen35-bf16',item,8,0,1234) +finally:bench_cache.bench.urllib.request.urlopen=original_urlopen +row=bench_cache.receipt(run,'first') +report={'schema_version':1,'client':'bench_cache.bench.stream and bench_cache.receipt/qualify; first request only', + 'fixture_sha256':hashlib.sha256(json.dumps(ids).encode()).hexdigest(),'request_kind':item['kind'],'http_read_timeout_s':timeout,'requested_reply_tokens':8, + 'temperature':0,'seed':1234,'rows':[row],'qualified':bench_cache.qualify([row],len(ids),True,False)} +pathlib.Path(a.output).write_text(json.dumps(report,indent=2)+'\n');print(json.dumps(report),flush=True) +raise SystemExit(0 if report['qualified'] else 1) diff --git a/docs/receipts/qwen35-bf16-scoring/reproduce-disconnect.py b/docs/receipts/qwen35-bf16-scoring/reproduce-disconnect.py new file mode 100644 index 00000000000..f2f4b82df38 --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/reproduce-disconnect.py @@ -0,0 +1,137 @@ +"""Observe native cancellation and score recovery against a loopback server started with --dashboard.""" +import argparse +import hashlib +import json +from pathlib import Path +import re +import socket +import struct +import sys +import time +import urllib.parse +import urllib.request + +root = Path(__file__).resolve().parents[3] +sys.path.insert(0, str(root / 'tools/zig')) +from check_qwen35_prompt_scores import digest_rows + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('base') + parser.add_argument('model') + parser.add_argument('fixtures') + parser.add_argument('--output', required=True) + args = parser.parse_args() + base = args.base.rstrip('/') + origin = urllib.parse.urlsplit(base) + if origin.scheme != 'http' or origin.hostname not in ('localhost', '127.0.0.1', '::1'): + parser.error('use a loopback HTTP endpoint') + fixtures = json.loads(Path(args.fixtures).read_text()) + report = {'schema': 1, 'client_source_sha256': hashlib.sha256(Path(__file__).read_bytes()).hexdigest(), + 'checks': [], 'passed': True} + + def record(name, passed, **fields): + report['checks'].append({'check': name, 'passed': bool(passed), **fields}) + report['passed'] &= bool(passed) + + def get(path): + with urllib.request.urlopen(base + path, timeout=10) as response: + return json.load(response) + + def counter(): + with urllib.request.urlopen(base + '/metrics', timeout=10) as response: + text = response.read().decode() + match = re.search(r'^tensorfold:client_disconnections_total (\d+)$', text, re.M) + if match is None: + raise RuntimeError('missing_cancellation_counter') + return int(match.group(1)) + + def wait(predicate, seconds): + deadline = time.monotonic() + seconds + while time.monotonic() < deadline: + result = predicate() + if result is not None: + return result + time.sleep(.1) + raise TimeoutError('observation_deadline') + + def score(): + body = {'model': args.model, 'prompt': fixtures[1], 'max_tokens': 8, 'temperature': 0, + 'seed': 1234, 'draft': True, 'ignore_eos': True, 'return_token_ids': True, 'prompt_logprobs': 2} + request = urllib.request.Request(base + '/v1/completions', json.dumps(body).encode(), + {'Content-Type': 'application/json'}) + with urllib.request.urlopen(request, timeout=180) as response: + data = json.load(response) + return {'token_ids': data['tensorfold']['token_ids'], + 'score_sha256': digest_rows(data['choices'][0]['prompt_logprobs']), + 'cached_tokens': data['usage']['prompt_tokens_details']['cached_tokens']} + + def acknowledged(before): + value = counter() + return value if value > before else None + + try: + reference = score() + record('reference_cache_off', reference['cached_tokens'] == 0, reference=reference) + before = counter() + body = {'model': args.model, 'prompt': fixtures[-1], 'max_tokens': 128, 'temperature': 0, + 'seed': 1234, 'ignore_eos': True, 'prompt_logprobs': 2} + encoded = json.dumps(body).encode() + target = origin.path.rstrip('/') + '/v1/completions' + connection = socket.create_connection((origin.hostname, origin.port or 80), timeout=10) + try: + header = ('POST ' + target + ' HTTP/1.1\r\nHost: localhost\r\nContent-Type: application/json\r\n' + 'Content-Length: ' + str(len(encoded)) + '\r\n\r\n').encode() + connection.sendall(header + encoded) + + def prefilling(): + status = get('/stats') + return status if status.get('fill_prompt_tokens') == len(fixtures[-1]) and status.get('fill_tokens_left', 0) > 0 else None + + observed = wait(prefilling, 30) + record('prefill_observed_before_reset', True, + status={k: observed.get(k) for k in ('running', 'fill_prompt_tokens', 'fill_tokens_left', 'generation_tokens_running')}) + connection.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, struct.pack('ii', 1, 0)) + finally: + connection.close() + after = wait(lambda: acknowledged(before), 180) + record('prefill_cancellation_acknowledged', after == before + 1, counter_before=before, counter_after=after) + recovered = score() + record('score_after_prefill_cancel', recovered == reference, observed=recovered) + + before = counter() + body = {'model': args.model, 'prompt': fixtures[1], 'max_tokens': 128, 'temperature': 0, + 'seed': 1234, 'stream': True, 'ignore_eos': True} + request = urllib.request.Request(base + '/v1/completions', json.dumps(body).encode(), + {'Content-Type': 'application/json'}) + with urllib.request.urlopen(request, timeout=180) as response: + for raw in response: + if raw.startswith(b'data: ') and raw.strip() != b'data: [DONE]': + data = json.loads(raw[6:]) + if any(choice.get('text') for choice in data.get('choices', [])): + def decoding(): + status = get('/stats') + generated = status.get('generation_tokens_running', 0) + return status if 0 < generated < 128 else None + + observed = wait(decoding, 10) + record('decode_observed_before_close', True, + status={k: observed.get(k) for k in ('running', 'generation_tokens_running')}) + break + else: + raise RuntimeError('no_streamed_token') + after = wait(lambda: acknowledged(before), 30) + record('decode_cancellation_acknowledged', after == before + 1, counter_before=before, counter_after=after) + recovered = score() + record('score_after_decode_cancel', recovered == reference, observed=recovered) + except Exception as error: + record('execution_error', False, error_class=type(error).__name__) + encoded = json.dumps(report, indent=2) + '\n' + Path(args.output).write_text(encoded) + print(encoded, end='') + return 0 if report['passed'] else 1 + + +if __name__ == '__main__': + raise SystemExit(main()) diff --git a/docs/receipts/qwen35-bf16-scoring/sglang-precision/sitecustomize.py b/docs/receipts/qwen35-bf16-scoring/sglang-precision/sitecustomize.py new file mode 100644 index 00000000000..0d860394649 --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/sglang-precision/sitecustomize.py @@ -0,0 +1,6 @@ +"""Disable optional reduced-precision matrix reductions in the external BF16 comparison.""" +import torch + +torch.backends.cuda.matmul.allow_bf16_reduced_precision_reduction = False +torch.backends.cuda.matmul.allow_fp16_reduced_precision_reduction = False +torch.backends.cuda.matmul.allow_tf32 = False diff --git a/docs/receipts/qwen35-bf16-scoring/source-provenance.json b/docs/receipts/qwen35-bf16-scoring/source-provenance.json new file mode 100644 index 00000000000..8e7c557b5be --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/source-provenance.json @@ -0,0 +1,24 @@ +{ + "qualified_native_build": "327ef639fb7dbc355f44b4a5efc53209a3e06543", + "qualified_contract_source": "5332d97eb387af7e1a10433d77ee032a86bc631a", + "original_receipt_publication": "b651e8b411d62ece1d25fd33d4bbbc6edcbb6075", + "reviewed_rebased_head": "54f9459411254a7b04ca8efb8f90166b53bd9738", + "rebased_id_to_original_evidence_id": { + "612bca872b70461787e6d74480454391cb1dc4a2": "5332d97eb387af7e1a10433d77ee032a86bc631a", + "c5a3feefaa24315dd55600ff1490c10c5fb27036": "b0b5beb8db0856091798123cf62dcdfaec1e0445", + "ddb1f831724940801b7766a170c266a958141b18": "327ef639fb7dbc355f44b4a5efc53209a3e06543", + "43776dc9bee25be15187aef84a8205871dbcef5b": "284339b080b3af960822458158ab69a7bbaf6bd7" + }, + "historical_scope": "Earlier rebases and reference-only follow-ups did not establish another device execution. Historical results retain their measured identities and failures; the current qualification below is separate.", + "current_qualification_source": "b168b36d0cc3503ae69e8bffcad494574019caf5", + "current_main_baseline": "0d19cc19b5b49a0b4a0188a56b6705bbedae91e4", + "declared_parent": "789846adbf0b6bde4a9734fdc7c7e36e65702c64", + "scope": "Every execution retains its actual source and binary identity. Later receipt-only commits do not claim another device execution.", + "public_alias_equivalent_source": "55dbec4758f42ca08a7e7dede4ebd5da7877119f", + "public_alias_source_tree": "652aec7a5953ddc204005696b8f5281c72d23111", + "submitted_parent_followup": "30e9b87284d4cad99ef6b826d95f5578d6341f63", + "qualified_parent_scope": "GPU execution includes parent 789846adb. Submitted parent 30e9b872 adds four matching resource receipts and two host-only regression cases; two resource tables remain token-equivalent apart from formatting/comments.", + "last_code_followup": "c6f3e221ac5a2914fcd3a6b950eb620d1eaaa23b", + "last_code_followup_scope": "Optional CPU-reference dependency guard only; all three real tests remain active when dependencies are installed. Inference and numerical gates unchanged.", + "complete_cuda_retry_scope": "Same b168b36d source; explicit five-SM auxiliary H3 rebuild. Initial and retry runner hashes are distinct; served native bytes are unchanged. See summary and linked proof." +} diff --git a/docs/receipts/qwen35-bf16-scoring/summary.json b/docs/receipts/qwen35-bf16-scoring/summary.json new file mode 100644 index 00000000000..2ec6b226a70 --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/summary.json @@ -0,0 +1,3125 @@ +{ + "schema": 3, + "scope": "experimental dense BF16 Qwen3.5 text/scoring format; one sm_120 GPU and rank 1; no model-equivalence or performance qualification", + "agreed_gate": "https://github.com/ashhart/TensorFold/issues/1136#issuecomment-6553918935", + "source_commit": "b168b36d0cc3503ae69e8bffcad494574019caf5", + "public_alias_equivalent_commit": "55dbec4758f42ca08a7e7dede4ebd5da7877119f", + "submission_host_followup": { + "source": "7ae6246c67fe37694bbd10ac0b78ef9abdf16c71", + "parent": "30e9b87284d4cad99ef6b826d95f5578d6341f63", + "actual_gpu_execution_source": "b168b36d0cc3503ae69e8bffcad494574019caf5", + "inference_and_contract_values_unchanged": true, + "resource_files": "Code tokens equal after removing comments, whitespace and optional trailing commas; independently matched to qualified cubins", + "host_contract_command": "zig build test-kernel-contract --summary all", + "steps_passed": 22, + "steps_total": 22, + "executed_passed": 168, + "executed_total": 168, + "other_targets": "cached", + "first_host_run_before_import_owner_move": { + "passed": 177, + "total": 177 + }, + "new_host_cases": 2, + "lean": { + "base": 425, + "candidate": 425, + "new": 0 + }, + "import_ownership": "compiler-set host test module, retaining registry600-line limit", + "changed_paths": [ + "zig/src/core/contract/gdn_chain_records.zig", + "zig/src/core/contract/moe_router_records.zig", + "zig/src/core/contract/qwen_glue_receipts_test.zig", + "zig/src/core/contract/registry_sets_test.zig" + ], + "production_scope": "Two equivalent resource tables; new host tests and their host-only import. No inference or numerical gate definition changes." + }, + "public_model_source_verification": { + "source": "https://huggingface.co/api/models/Qwen/Qwen3.5-27B/revision/fc05daec18b0a78c049392ed2e771dde82bdf654?blobs=true", + "repo": "Qwen/Qwen3.5-27B", + "revision": "fc05daec18b0a78c049392ed2e771dde82bdf654", + "api_response_sha256": "8af5703693586d8725889a477e79fa19ab580e64df67db3a544a7ad759e26126", + "all_11_local_shard_hashes_and_sizes_match_public_lfs": true, + "shards": [ + { + "name": "model.safetensors-00001-of-00011.safetensors", + "sha256": "9019228d172c87d5603266c2d56672d119e838facffa164de803a1ebf0d716d2", + "bytes": 5263851872 + }, + { + "name": "model.safetensors-00002-of-00011.safetensors", + "sha256": "890ef00c920b01c1c02755088c8d8ca5cdd6a1faa2a9a729eecd00857648b411", + "bytes": 5347741440 + }, + { + "name": "model.safetensors-00003-of-00011.safetensors", + "sha256": "8aca03689ad0717fb91455809a6670eecca818bea8c0b6bd3a591a8807cc3223", + "bytes": 5347741504 + }, + { + "name": "model.safetensors-00004-of-00011.safetensors", + "sha256": "20f539430c60fa611b3522b8408749a080b63f1fe034e551a6539ef864ca079a", + "bytes": 5347741504 + }, + { + "name": "model.safetensors-00005-of-00011.safetensors", + "sha256": "57a0c074c654f05fc2d6b5112eeec387ac04986e928e42f502993e69aa03a49d", + "bytes": 5347741504 + }, + { + "name": "model.safetensors-00006-of-00011.safetensors", + "sha256": "cfa4e6fbfc600854ef6c8e5465d0a1e43832a64b5e539f1e880333e3b1086703", + "bytes": 5347741504 + }, + { + "name": "model.safetensors-00007-of-00011.safetensors", + "sha256": "d426963325b2319cb9e1442bc8b89b9a7748a8f7a907aa4041c11531cda6b014", + "bytes": 5347741496 + }, + { + "name": "model.safetensors-00008-of-00011.safetensors", + "sha256": "fe60dbb9d25354c4eb2a9a59d9b1afd07741c8bebab5870f5eea6eadb4cf9a06", + "bytes": 5368714128 + }, + { + "name": "model.safetensors-00009-of-00011.safetensors", + "sha256": "71a153d882242734a1fc7e000734727f00f6ec8ca70b044f5e44fcf97736ef8f", + "bytes": 5347745520 + }, + { + "name": "model.safetensors-00010-of-00011.safetensors", + "sha256": "146745698b9f21940e2982beb1816a0eef3b80d77ab9cd884695b9a08c2697eb", + "bytes": 5347749200 + }, + { + "name": "model.safetensors-00011-of-00011.safetensors", + "sha256": "d947ce7483c4109b55039f1359f4494d22390cf123568100abd89816802f097d", + "bytes": 2148512760 + } + ], + "reference_report_sha256": "c1ba911925f8eec398b50174f7508f4a7041994374bd228a047519dc9fa0d730" + }, + "main_baseline": "0d19cc19b5b49a0b4a0188a56b6705bbedae91e4", + "dependency": "789846adbf0b6bde4a9734fdc7c7e36e65702c64", + "native_version": "tensorfold-native 1.2.2", + "binaries": { + "candidate-native": { + "bytes": 236095776, + "sha256": "fa2f415a1b7a6f47a62ee078e7f6de86f3f677d2bf74ffa5c2d273e1ce713a64" + }, + "baseline-native": { + "bytes": 235993608, + "sha256": "35a2c36586cc8e677a4a75d1f60b8f5a9743e3d8831e8be718beb0f769f07c5c" + }, + "cuda-contract": { + "bytes": 433177448, + "sha256": "bd9574f60955b11718d74b65d81cba4f22b30e2306a9eee7df03e12dd152d27e" + }, + "native-capture": { + "bytes": 96736272, + "sha256": "e3054c1c57287d7d55d8a8aa2a82455bcd4f3d6879ed6c80d53f0fa29490e6a2" + } + }, + "gpu": "NVIDIA RTX PRO 6000 Blackwell Max-Q Workstation Edition, 12.0, 97887 MiB, 300.00 W, 615.78.08", + "physical_memory_bytes": 132011114496, + "native_compiler": "NVCC 13.0.88", + "zig": "0.17.0", + "serving_quota": { + "cpu": 4, + "ram_gib": 32, + "context": 8192, + "parallel": 4, + "cache_gib": 0, + "host_port": "loopback" + }, + "host": { + "command": "zig build test test-kernel-contract test-golden fuzz-cortheon -j8 --summary all", + "exit": 0, + "steps_passed": 570, + "steps_total": 570, + "executed_passed": 3872, + "executed_total": 3897, + "skipped": 25, + "other_results": "cached" + }, + "plain": { + "exit": 0, + "steps": 30 + }, + "native_build": { + "exit": 0, + "steps": 11 + }, + "lean": { + "base": 425, + "candidate": 425, + "new": 0, + "same_checker": true, + "baseline": "0d19cc19b5b49a0b4a0188a56b6705bbedae91e4" + }, + "compile_resource_audit": { + "exit": 0, + "records": 1493, + "stale": 0, + "applicable_launch_failures": 0, + "sms": [ + 80, + 86, + 89, + 120, + 121 + ], + "execution_chips": [ + 120 + ] + }, + "norm_diagnostic": { + "exit": 0, + "kernels_pass": 1, + "kernels_fail": 0, + "controls_red": 1, + "controls_missed": 0, + "fp16_stress_miss_factor": 256, + "bf16_stress_miss_factor": 0.7, + "limitation": "BF16 output rounding hides BF16 sum error; the FP16 stress remains mandatory", + "scope": "Separate diagnostic command; its seed differs from the complete runner. Full-run stress output is retained independently." + }, + "api": { + "passed": true, + "checks": 32, + "failures": [], + "fixture_lengths": [ + 1, + 32, + 129, + 257, + 4097 + ] + }, + "fp64": { + "passed": true, + "prompt_rows": 6, + "decode_rows": 12, + "projections": 24, + "bound": { + "fp32_unit": 5.960464477539063e-08, + "head_depth": "ceil(hidden/2048)*8+13", + "head": "gamma(depth)*sum(abs(x*w)) plus FP32 output rounding", + "reduction_depth": "ceil(vocab/256)+8", + "post_reduction_ops": 12, + "logprob": "per-token head bound + row-max head bound + reduction bound + FP32 subtraction rounding" + }, + "reference_environment": { + "torch": "2.13.0a0+9186a08b2c.nv26.07", + "cuda": "13.3" + }, + "phases": { + "prompt": { + "worst_head_absolute": { + "capture": "0-meta.json", + "phase": "prompt", + "worst_head_absolute": 2.455664798617363e-06, + "worst_head_absolute_row": 1, + "worst_head_absolute_token": 151373 + }, + "worst_head_bound_ratio": { + "capture": "10-meta.json", + "phase": "prompt", + "worst_head_bound_ratio": 0.020238330202637583, + "worst_head_bound_row": 0, + "worst_head_bound_token": 248254 + }, + "worst_logprob_absolute": { + "capture": "10-meta.json", + "phase": "prompt", + "worst_logprob_absolute": 5.418979458937656e-06, + "worst_logprob_absolute_row": 0, + "worst_logprob_absolute_token": 5811 + }, + "worst_logprob_bound_ratio": { + "capture": "10-meta.json", + "phase": "prompt", + "worst_logprob_bound_ratio": 0.011101815705558212, + "worst_logprob_bound_row": 0, + "worst_logprob_bound_token": 248286 + }, + "worst_reduction_absolute": { + "capture": "10-meta.json", + "phase": "prompt", + "worst_reduction_absolute": 3.2291501241843434e-06 + }, + "worst_reduction_bound_ratio": { + "capture": "10-meta.json", + "phase": "prompt", + "worst_reduction_bound_ratio": 0.04551001952918418 + }, + "argmax_differences": 0 + }, + "decode": { + "worst_head_absolute": { + "capture": "4-meta.json", + "phase": "decode", + "worst_head_absolute": 2.588785719126463e-06, + "worst_head_absolute_row": 0, + "worst_head_absolute_token": 248069 + }, + "worst_head_bound_ratio": { + "capture": "14-meta.json", + "phase": "decode", + "worst_head_bound_ratio": 0.02299474290362627, + "worst_head_bound_row": 0, + "worst_head_bound_token": 222763 + }, + "worst_logprob_absolute": { + "capture": "4-meta.json", + "phase": "decode", + "worst_logprob_absolute": 6.144032695942769e-06, + "worst_logprob_absolute_row": 0, + "worst_logprob_absolute_token": 44592 + }, + "worst_logprob_bound_ratio": { + "capture": "14-meta.json", + "phase": "decode", + "worst_logprob_bound_ratio": 0.010784211652051203, + "worst_logprob_bound_row": 0, + "worst_logprob_bound_token": 85462 + }, + "worst_reduction_absolute": { + "capture": "1-meta.json", + "phase": "decode", + "worst_reduction_absolute": 3.006978420927453e-06 + }, + "worst_reduction_bound_ratio": { + "capture": "1-meta.json", + "phase": "decode", + "worst_reduction_bound_ratio": 0.0409757334807264 + }, + "argmax_differences": 0 + } + }, + "projection_classes": { + "model.language_model.layers.0.linear_attn.in_proj_a.weight": { + "captures": 2, + "passed": true, + "worst_absolute": { + "capture": "20-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.0.linear_attn.in_proj_a.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.005401957780122757, + "worst_bound_ratio": 0.6910126214722134, + "worst_bound_row": 0, + "worst_bound_column": 43, + "worst_absolute_row": 1, + "worst_absolute_column": 45 + }, + "worst_bound_ratio": { + "capture": "20-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.0.linear_attn.in_proj_a.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.005401957780122757, + "worst_bound_ratio": 0.6910126214722134, + "worst_bound_row": 0, + "worst_bound_column": 43, + "worst_absolute_row": 1, + "worst_absolute_column": 45 + } + }, + "model.language_model.layers.0.linear_attn.in_proj_b.weight": { + "captures": 2, + "passed": true, + "worst_absolute": { + "capture": "21-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.0.linear_attn.in_proj_b.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.003789226000662893, + "worst_bound_ratio": 0.951679315024013, + "worst_bound_row": 1, + "worst_bound_column": 12, + "worst_absolute_row": 1, + "worst_absolute_column": 12 + }, + "worst_bound_ratio": { + "capture": "21-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.0.linear_attn.in_proj_b.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.003789226000662893, + "worst_bound_ratio": 0.951679315024013, + "worst_bound_row": 1, + "worst_bound_column": 12, + "worst_absolute_row": 1, + "worst_absolute_column": 12 + } + }, + "model.language_model.layers.0.linear_attn.in_proj_qkv.weight": { + "captures": 2, + "passed": true, + "worst_absolute": { + "capture": "18-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.0.linear_attn.in_proj_qkv.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.007802778389304876, + "worst_bound_ratio": 0.978123308189507, + "worst_bound_row": 0, + "worst_bound_column": 10058, + "worst_absolute_row": 0, + "worst_absolute_column": 9676 + }, + "worst_bound_ratio": { + "capture": "18-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.0.linear_attn.in_proj_qkv.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.007802778389304876, + "worst_bound_ratio": 0.978123308189507, + "worst_bound_row": 0, + "worst_bound_column": 10058, + "worst_absolute_row": 0, + "worst_absolute_column": 9676 + } + }, + "model.language_model.layers.0.linear_attn.in_proj_z.weight": { + "captures": 2, + "passed": true, + "worst_absolute": { + "capture": "19-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.0.linear_attn.in_proj_z.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.007809765636920929, + "worst_bound_ratio": 0.9803548570449679, + "worst_bound_row": 0, + "worst_bound_column": 3312, + "worst_absolute_row": 1, + "worst_absolute_column": 3437 + }, + "worst_bound_ratio": { + "capture": "19-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.0.linear_attn.in_proj_z.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.007809765636920929, + "worst_bound_ratio": 0.9803548570449679, + "worst_bound_row": 0, + "worst_bound_column": 3312, + "worst_absolute_row": 1, + "worst_absolute_column": 3437 + } + }, + "model.language_model.layers.0.linear_attn.out_proj.weight": { + "captures": 2, + "passed": true, + "worst_absolute": { + "capture": "22-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.0.linear_attn.out_proj.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.015277322381734848, + "worst_bound_ratio": 0.9643655336704298, + "worst_bound_row": 1, + "worst_bound_column": 4114, + "worst_absolute_row": 1, + "worst_absolute_column": 1363 + }, + "worst_bound_ratio": { + "capture": "22-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.0.linear_attn.out_proj.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.015277322381734848, + "worst_bound_ratio": 0.9643655336704298, + "worst_bound_row": 1, + "worst_bound_column": 4114, + "worst_absolute_row": 1, + "worst_absolute_column": 1363 + } + }, + "model.language_model.layers.0.mlp.down_proj.weight": { + "captures": 2, + "passed": true, + "worst_absolute": { + "capture": "17-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.0.mlp.down_proj.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.01529441075399518, + "worst_bound_ratio": 0.9268247427556046, + "worst_bound_row": 0, + "worst_bound_column": 1462, + "worst_absolute_row": 1, + "worst_absolute_column": 447 + }, + "worst_bound_ratio": { + "capture": "17-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.0.mlp.down_proj.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.01529441075399518, + "worst_bound_ratio": 0.9268247427556046, + "worst_bound_row": 0, + "worst_bound_column": 1462, + "worst_absolute_row": 1, + "worst_absolute_column": 447 + } + }, + "model.language_model.layers.0.mlp.gate_proj.weight": { + "captures": 2, + "passed": true, + "worst_absolute": { + "capture": "15-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.0.mlp.gate_proj.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.007765843067318201, + "worst_bound_ratio": 0.9666033577313942, + "worst_bound_row": 0, + "worst_bound_column": 14827, + "worst_absolute_row": 0, + "worst_absolute_column": 14827 + }, + "worst_bound_ratio": { + "capture": "15-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.0.mlp.gate_proj.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.007765843067318201, + "worst_bound_ratio": 0.9666033577313942, + "worst_bound_row": 0, + "worst_bound_column": 14827, + "worst_absolute_row": 0, + "worst_absolute_column": 14827 + } + }, + "model.language_model.layers.0.mlp.up_proj.weight": { + "captures": 2, + "passed": true, + "worst_absolute": { + "capture": "16-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.0.mlp.up_proj.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.007748669479042292, + "worst_bound_ratio": 0.9727463176006625, + "worst_bound_row": 1, + "worst_bound_column": 9897, + "worst_absolute_row": 0, + "worst_absolute_column": 12075 + }, + "worst_bound_ratio": { + "capture": "16-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.0.mlp.up_proj.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.007748669479042292, + "worst_bound_ratio": 0.9727463176006625, + "worst_bound_row": 1, + "worst_bound_column": 9897, + "worst_absolute_row": 0, + "worst_absolute_column": 12075 + } + }, + "model.language_model.layers.3.self_attn.k_proj.weight": { + "captures": 2, + "passed": true, + "worst_absolute": { + "capture": "24-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.3.self_attn.k_proj.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.010409727692604065, + "worst_bound_ratio": 0.9328244145237949, + "worst_bound_row": 0, + "worst_bound_column": 73, + "worst_absolute_row": 0, + "worst_absolute_column": 309 + }, + "worst_bound_ratio": { + "capture": "24-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.3.self_attn.k_proj.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.010409727692604065, + "worst_bound_ratio": 0.9328244145237949, + "worst_bound_row": 0, + "worst_bound_column": 73, + "worst_absolute_row": 0, + "worst_absolute_column": 309 + } + }, + "model.language_model.layers.3.self_attn.o_proj.weight": { + "captures": 2, + "passed": true, + "worst_absolute": { + "capture": "26-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.3.self_attn.o_proj.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.015566423069685698, + "worst_bound_ratio": 0.9826131545804113, + "worst_bound_row": 1, + "worst_bound_column": 4349, + "worst_absolute_row": 1, + "worst_absolute_column": 4349 + }, + "worst_bound_ratio": { + "capture": "26-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.3.self_attn.o_proj.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.015566423069685698, + "worst_bound_ratio": 0.9826131545804113, + "worst_bound_row": 1, + "worst_bound_column": 4349, + "worst_absolute_row": 1, + "worst_absolute_column": 4349 + } + }, + "model.language_model.layers.3.self_attn.q_proj.weight": { + "captures": 2, + "passed": true, + "worst_absolute": { + "capture": "23-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.3.self_attn.q_proj.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.01554406899958849, + "worst_bound_ratio": 0.9663650242200285, + "worst_bound_row": 1, + "worst_bound_column": 3023, + "worst_absolute_row": 0, + "worst_absolute_column": 9708 + }, + "worst_bound_ratio": { + "capture": "23-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.3.self_attn.q_proj.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.01554406899958849, + "worst_bound_ratio": 0.9663650242200285, + "worst_bound_row": 1, + "worst_bound_column": 3023, + "worst_absolute_row": 0, + "worst_absolute_column": 9708 + } + }, + "model.language_model.layers.3.self_attn.v_proj.weight": { + "captures": 2, + "passed": true, + "worst_absolute": { + "capture": "25-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.3.self_attn.v_proj.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.0077336933463811874, + "worst_bound_ratio": 0.9437144604709241, + "worst_bound_row": 0, + "worst_bound_column": 168, + "worst_absolute_row": 0, + "worst_absolute_column": 436 + }, + "worst_bound_ratio": { + "capture": "25-meta.json", + "phase": "prompt", + "projection": "model.language_model.layers.3.self_attn.v_proj.weight", + "rows": 2, + "passed": true, + "worst_absolute": 0.0077336933463811874, + "worst_bound_ratio": 0.9437144604709241, + "worst_bound_row": 0, + "worst_bound_column": 168, + "worst_absolute_row": 0, + "worst_absolute_column": 436 + } + } + } + }, + "independent_reference": { + "scope": "CPU BF16/promoted-FP32 forwards with FP32 vocabulary head; actual HTTP comparison separate from auxiliary historical captures", + "complete": true, + "input_files": { + "fixtures": { + "path": "", + "sha256": "c83f0cb7e56f447de3b6131b921ac06b0743cbfcdfbe856970f0f5e7e9c61fe4" + }, + "api": { + "path": "", + "sha256": "3541b3afa2debed9030b0e69371f413b053001195bffafd117110624f5e08667" + }, + "fp64_reference": { + "path": "", + "sha256": "9a7344dfeca63b07c94fd36f6e0cabf5cbceec7fee4f26812c16e95b8fea6b2a" + }, + "captures_dir": "" + }, + "reference_source_sha256": { + "qwen35_transformers_reference.py": "162254fe40d058017e530c32d90593f981ecd2d4ab9f085020f9e3085f17838b", + "qwen35_reference_inputs.py": "f54759f00b14100e7ca40e1b0211a0440bda79463648cf81610ae987359dc55e", + "qwen35_reference_forward.py": "4d3c3c8e68f011049cf6c7dc42d86c74f9992889d7710f6cd1ce1c91067b7562", + "qwen35_reference_fixture.py": "f4ea4b17bab9ec5c83c5c06084799bea2296f82e5c5b25c79968418960e88c96", + "qwen35_reference_compare.py": "fd918c442874c011ce21166fcc57132d136832c90ac63bf50836851c9db03b14", + "qwen35_reference_verdict.py": "fc7790d0292d350947fb87926d8566da1d664d32c16c8dac977ddf6bdfe308de" + }, + "elapsed_s": 444.846337, + "peak_rss_gb": 53.94231033325195, + "environment": { + "python": "3.12.3", + "executable": "python3", + "platform": "Linux-7.2.8-9-omarchy-x86_64-with-glibc2.39", + "torch": "2.15.0+cu132", + "torch_version_cuda": "13.2", + "torch_num_threads": 16, + "torch_interop_threads": 32, + "torch_mkldnn_available": true, + "transformers": "5.22.1", + "accelerate": "1.15.0", + "safetensors": "0.8.0", + "numpy": "2.5.4", + "cuda_visible_devices": "", + "cuda_available": false, + "cuda_device_count": 0, + "cuda_used": false, + "cpu_count": 32, + "tokenizers": "0.23.3" + }, + "stored_fp32_restore": { + "count": 96, + "tensors_changed_by_auto_dtype": 48 + }, + "both_arm_scored_rows": 4511, + "headline": { + "fixtures_reported": [ + 0, + 1, + 2, + 3, + 4 + ], + "fixture_lengths": [ + 1, + 32, + 129, + 257, + 4097 + ], + "fixtures_with_both_arms": [ + 0, + 1, + 2, + 3, + 4 + ], + "fixtures_fp32_skipped": [], + "rows_compared": 4511, + "max_abs_logprob_delta_bf16_vs_fp32": 5.2248382568359375, + "mean_abs_logprob_delta_bf16_vs_fp32": 0.007090691160769876, + "max_abs_logit_delta_bf16_vs_fp32": 10.056853294372559, + "max_abs_lse_delta_bf16_vs_fp32": 7.637477874755859, + "argmax_agreement_rows": 4507, + "rank_agreement_rows": 4486, + "by_fixture": { + "0": {}, + "1": { + "rows": 31, + "max_abs_logprob_delta": 0.02388763427734375, + "mean_abs_logprob_delta": 0.00594283688452936, + "max_abs_logit_delta": 0.114776611328125, + "max_abs_lse_delta": 0.11450386047363281, + "argmax_agreement_rows": 31, + "rank_agreement_rows": 27 + }, + "2": { + "rows": 128, + "max_abs_logprob_delta": 0.04261589050292969, + "mean_abs_logprob_delta": 0.001597762107849121, + "max_abs_logit_delta": 0.13372802734375, + "max_abs_lse_delta": 0.1337261199951172, + "argmax_agreement_rows": 128, + "rank_agreement_rows": 128 + }, + "3": { + "rows": 256, + "max_abs_logprob_delta": 5.2248382568359375, + "mean_abs_logprob_delta": 0.12231740355491638, + "max_abs_logit_delta": 10.056853294372559, + "max_abs_lse_delta": 7.637477874755859, + "argmax_agreement_rows": 252, + "rank_agreement_rows": 235 + }, + "4": { + "rows": 4096, + "max_abs_logprob_delta": 0.04261589050292969, + "mean_abs_logprob_delta": 6.936304271221161e-05, + "max_abs_logit_delta": 3.133115768432617, + "max_abs_lse_delta": 3.1326770782470703, + "argmax_agreement_rows": 4096, + "rank_agreement_rows": 4096 + } + } + } + }, + "served_reference": { + "collection_passed": true, + "policy": "measured distances only; cross-engine tolerance is not a required pass in the agreed issue gate", + "rows": 4511, + "outside_strict_fp32_distance": 1719, + "outside_strict_bf16_distance": 1911, + "reference_sha256": "c1ba911925f8eec398b50174f7508f4a7041994374bd228a047519dc9fa0d730", + "fixtures": [ + { + "fixture": 0, + "length": 1, + "rows": 0, + "null_first_row_verified": true + }, + { + "fixture": 1, + "length": 32, + "rows": 31, + "worst_native_to_fp32": { + "position": 18, + "token_id": 20139, + "native_logprob": -0.16663360595703125, + "transformers_bf16_logprob": -0.2276897430419922, + "transformers_fp32_logprob": -0.2081432342529297, + "native_to_fp32": 0.04150962829589844, + "native_to_bf16": 0.06105613708496094, + "bf16_to_fp32": 0.0195465087890625, + "within_fp32_distance": false, + "within_bf16_distance": false, + "native_rank": 1, + "transformers_bf16_rank": 1, + "transformers_fp32_rank": 1 + }, + "worst_native_to_bf16": { + "position": 18, + "token_id": 20139, + "native_logprob": -0.16663360595703125, + "transformers_bf16_logprob": -0.2276897430419922, + "transformers_fp32_logprob": -0.2081432342529297, + "native_to_fp32": 0.04150962829589844, + "native_to_bf16": 0.06105613708496094, + "bf16_to_fp32": 0.0195465087890625, + "within_fp32_distance": false, + "within_bf16_distance": false, + "native_rank": 1, + "transformers_bf16_rank": 1, + "transformers_fp32_rank": 1 + }, + "worst_bf16_to_fp32": { + "position": 9, + "token_id": 357, + "native_logprob": -6.4749040603637695, + "transformers_bf16_logprob": -6.480855941772461, + "transformers_fp32_logprob": -6.456968307495117, + "native_to_fp32": 0.017935752868652344, + "native_to_bf16": 0.005951881408691406, + "bf16_to_fp32": 0.02388763427734375, + "within_fp32_distance": true, + "within_bf16_distance": true, + "native_rank": 37, + "transformers_bf16_rank": 38, + "transformers_fp32_rank": 37 + }, + "mean_native_to_fp32": 0.009358067666330645, + "mean_native_to_bf16": 0.010679091176679057, + "outside_fp32_distance": 18, + "outside_bf16_distance": 23, + "rank_agreement_bf16": 25, + "rank_agreement_fp32": 26 + }, + { + "fixture": 2, + "length": 129, + "rows": 128, + "worst_native_to_fp32": { + "position": 41, + "token_id": 1393, + "native_logprob": -3.470926284790039, + "transformers_bf16_logprob": -3.5087404251098633, + "transformers_fp32_logprob": -3.5145492553710938, + "native_to_fp32": 0.04362297058105469, + "native_to_bf16": 0.03781414031982422, + "bf16_to_fp32": 0.005808830261230469, + "within_fp32_distance": false, + "within_bf16_distance": false, + "native_rank": 7, + "transformers_bf16_rank": 7, + "transformers_fp32_rank": 7 + }, + "worst_native_to_bf16": { + "position": 41, + "token_id": 1393, + "native_logprob": -3.470926284790039, + "transformers_bf16_logprob": -3.5087404251098633, + "transformers_fp32_logprob": -3.5145492553710938, + "native_to_fp32": 0.04362297058105469, + "native_to_bf16": 0.03781414031982422, + "bf16_to_fp32": 0.005808830261230469, + "within_fp32_distance": false, + "within_bf16_distance": false, + "native_rank": 7, + "transformers_bf16_rank": 7, + "transformers_fp32_rank": 7 + }, + "worst_bf16_to_fp32": { + "position": 40, + "token_id": 73111, + "native_logprob": -2.215632438659668, + "transformers_bf16_logprob": -2.2460451126098633, + "transformers_fp32_logprob": -2.2034292221069336, + "native_to_fp32": 0.012203216552734375, + "native_to_bf16": 0.030412673950195312, + "bf16_to_fp32": 0.04261589050292969, + "within_fp32_distance": true, + "within_bf16_distance": true, + "native_rank": 2, + "transformers_bf16_rank": 2, + "transformers_fp32_rank": 2 + }, + "mean_native_to_fp32": 0.001297876238822937, + "mean_native_to_bf16": 0.001979827880859375, + "outside_fp32_distance": 57, + "outside_bf16_distance": 60, + "rank_agreement_bf16": 128, + "rank_agreement_fp32": 128 + }, + { + "fixture": 3, + "length": 257, + "rows": 256, + "worst_native_to_fp32": { + "position": 235, + "token_id": 7890, + "native_logprob": -8.846553802490234, + "transformers_bf16_logprob": -5.701790809631348, + "transformers_fp32_logprob": -3.30010986328125, + "native_to_fp32": 5.546443939208984, + "native_to_bf16": 3.1447629928588867, + "bf16_to_fp32": 2.4016809463500977, + "within_fp32_distance": false, + "within_bf16_distance": false, + "native_rank": 69, + "transformers_bf16_rank": 21, + "transformers_fp32_rank": 7 + }, + "worst_native_to_bf16": { + "position": 221, + "token_id": 814, + "native_logprob": -3.6872997283935547, + "transformers_bf16_logprob": -9.454484939575195, + "transformers_fp32_logprob": -4.229646682739258, + "native_to_fp32": 0.5423469543457031, + "native_to_bf16": 5.767185211181641, + "bf16_to_fp32": 5.2248382568359375, + "within_fp32_distance": true, + "within_bf16_distance": false, + "native_rank": 8, + "transformers_bf16_rank": 124, + "transformers_fp32_rank": 7 + }, + "worst_bf16_to_fp32": { + "position": 221, + "token_id": 814, + "native_logprob": -3.6872997283935547, + "transformers_bf16_logprob": -9.454484939575195, + "transformers_fp32_logprob": -4.229646682739258, + "native_to_fp32": 0.5423469543457031, + "native_to_bf16": 5.767185211181641, + "bf16_to_fp32": 5.2248382568359375, + "within_fp32_distance": true, + "within_bf16_distance": false, + "native_rank": 8, + "transformers_bf16_rank": 124, + "transformers_fp32_rank": 7 + }, + "mean_native_to_fp32": 0.12244363129138947, + "mean_native_to_bf16": 0.10815522074699402, + "outside_fp32_distance": 124, + "outside_bf16_distance": 136, + "rank_agreement_bf16": 234, + "rank_agreement_fp32": 233 + }, + { + "fixture": 4, + "length": 4097, + "rows": 4096, + "worst_native_to_fp32": { + "position": 41, + "token_id": 1393, + "native_logprob": -3.470926284790039, + "transformers_bf16_logprob": -3.5087404251098633, + "transformers_fp32_logprob": -3.5145492553710938, + "native_to_fp32": 0.04362297058105469, + "native_to_bf16": 0.03781414031982422, + "bf16_to_fp32": 0.005808830261230469, + "within_fp32_distance": false, + "within_bf16_distance": false, + "native_rank": 7, + "transformers_bf16_rank": 7, + "transformers_fp32_rank": 7 + }, + "worst_native_to_bf16": { + "position": 41, + "token_id": 1393, + "native_logprob": -3.470926284790039, + "transformers_bf16_logprob": -3.5087404251098633, + "transformers_fp32_logprob": -3.5145492553710938, + "native_to_fp32": 0.04362297058105469, + "native_to_bf16": 0.03781414031982422, + "bf16_to_fp32": 0.005808830261230469, + "within_fp32_distance": false, + "within_bf16_distance": false, + "native_rank": 7, + "transformers_bf16_rank": 7, + "transformers_fp32_rank": 7 + }, + "worst_bf16_to_fp32": { + "position": 40, + "token_id": 73111, + "native_logprob": -2.215632438659668, + "transformers_bf16_logprob": -2.2460451126098633, + "transformers_fp32_logprob": -2.2034292221069336, + "native_to_fp32": 0.012203216552734375, + "native_to_bf16": 0.030412673950195312, + "bf16_to_fp32": 0.04261589050292969, + "within_fp32_distance": true, + "within_bf16_distance": true, + "native_rank": 2, + "transformers_bf16_rank": 2, + "transformers_fp32_rank": 2 + }, + "mean_native_to_fp32": 5.915295332670212e-05, + "mean_native_to_bf16": 8.250633254647255e-05, + "outside_fp32_distance": 1520, + "outside_bf16_distance": 1692, + "rank_agreement_bf16": 4096, + "rank_agreement_fp32": 4096 + } + ] + }, + "clients": { + "decode": "tools/bench_openai.py --tokens 128 --reps 3 --temperatures 0", + "native_concurrent": "tools/bench_concurrent.py --tokens 128 --reps 3 --temperatures 0,0.7 --levels 1,4 --alone --serial", + "sglang_concurrent": "tools/bench_concurrent.py --tokens 128 --reps 3 --temperatures 0,0.7 --levels 1,4; native hash reference flags omitted", + "decode_warmups": 2, + "concurrent_warmups": 4, + "concurrent_warmup_tokens": 16, + "measured_concurrent_requests": 60, + "seeds": "decode seeds 1234/1235/1236 at greedy temperature 0; concurrency seed 1234+i for sampled stream i, greedy 1234", + "generation": "ignore_eos true; no-thinking; no external drafter; native drafting enabled", + "timings": "decode excludes first token; whole-request throughput includes prefill/makespan; SSE chunk timing is not GPU kernel timing" + }, + "performance": { + "bf16": { + "decode": [ + { + "label": "", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 23.68314090371728, + "decode_tps_all": [ + 23.69, + 23.68, + 23.67 + ], + "ttft_s_median": 0.3516180169972358, + "prefill_tps_median": 39.816, + "itl_mean_ms_median": 42.224, + "itl_p50_ms_median": 34.085, + "itl_p95_ms_median": 34.225, + "round_gap_p50_ms_median": 34.085, + "round_gap_p95_ms_median": 34.225, + "tokens_per_chunk_median": 1.032 + }, + { + "label": "", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 29.319376302379247, + "decode_tps_all": [ + 29.32, + 29.32, + 29.3 + ], + "ttft_s_median": 0.7671338379877852, + "prefill_tps_median": 40.41, + "itl_mean_ms_median": 34.107, + "itl_p50_ms_median": 34.106, + "itl_p95_ms_median": 34.171, + "round_gap_p50_ms_median": 34.106, + "round_gap_p95_ms_median": 34.171, + "tokens_per_chunk_median": 1.0 + } + ], + "concurrent": [ + { + "prompt": "code", + "temperature": 0.0, + "streams": 1, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 23.7, + "per_stream_tps": 23.7, + "ttft_s_max": 0.35, + "request": { + "ttft_s": 0.352, + "decode_tps": 23.667, + "prefill_tps": 39.722, + "itl_mean_ms": 42.253, + "itl_p50_ms": 34.104, + "itl_p95_ms": 34.222, + "round_gap_p50_ms": 34.108, + "round_gap_p95_ms": 34.222, + "tokens_per_chunk": 1.032 + }, + "pooled": { + "aggregate_prefill_tps": 39.722, + "itl_mean_ms": 42.253, + "itl_p50_ms": 34.104, + "itl_p95_ms": 34.222, + "round_gap_p50_ms": 34.108, + "round_gap_p95_ms": 34.222, + "tokens_per_chunk": 1.032 + }, + "timing_valid": true, + "end_to_end_tps": 22.382627332615897, + "makespan_s": 5.718720957011101, + "alone": { + "equal": 3, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 1, + "unequal": 0, + "failed": 0 + } + }, + { + "prompt": "code", + "temperature": 0.0, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 8.9, + "per_stream_tps": 2.2, + "ttft_s_max": 1.41, + "request": { + "ttft_s": 0.879, + "decode_tps": 2.244, + "prefill_tps": 16.58, + "itl_mean_ms": 445.542, + "itl_p50_ms": 425.247, + "itl_p95_ms": 426.199, + "round_gap_p50_ms": 425.257, + "round_gap_p95_ms": 426.199, + "tokens_per_chunk": 1.032 + }, + "pooled": { + "aggregate_prefill_tps": 39.774, + "itl_mean_ms": 445.508, + "itl_p50_ms": 425.249, + "itl_p95_ms": 426.194, + "round_gap_p50_ms": 425.257, + "round_gap_p95_ms": 426.247, + "tokens_per_chunk": 1.032 + }, + "timing_valid": true, + "end_to_end_tps": 8.910463467831484, + "makespan_s": 57.46053522899456, + "steady_tps": 9.1, + "alone": { + "equal": 12, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 1, + "unequal": 0, + "failed": 0 + } + }, + { + "prompt": "chat", + "temperature": 0.0, + "streams": 1, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 29.3, + "per_stream_tps": 29.3, + "ttft_s_max": 0.77, + "request": { + "ttft_s": 0.768, + "decode_tps": 29.304, + "prefill_tps": 40.38, + "itl_mean_ms": 34.125, + "itl_p50_ms": 34.123, + "itl_p95_ms": 34.174, + "round_gap_p50_ms": 34.123, + "round_gap_p95_ms": 34.174, + "tokens_per_chunk": 1.0 + }, + "pooled": { + "aggregate_prefill_tps": 40.38, + "itl_mean_ms": 34.125, + "itl_p50_ms": 34.123, + "itl_p95_ms": 34.174, + "round_gap_p50_ms": 34.123, + "round_gap_p95_ms": 34.174, + "tokens_per_chunk": 1.0 + }, + "timing_valid": true, + "end_to_end_tps": 25.09008202904449, + "makespan_s": 5.101617437991081, + "alone": { + "equal": 3, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 1, + "unequal": 0, + "failed": 0 + } + }, + { + "prompt": "chat", + "temperature": 0.0, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 9.0, + "per_stream_tps": 2.3, + "ttft_s_max": 3.07, + "request": { + "ttft_s": 1.916, + "decode_tps": 2.303, + "prefill_tps": 16.845, + "itl_mean_ms": 434.313, + "itl_p50_ms": 425.128, + "itl_p95_ms": 425.795, + "round_gap_p50_ms": 425.128, + "round_gap_p95_ms": 425.795, + "tokens_per_chunk": 1.0 + }, + "pooled": { + "aggregate_prefill_tps": 40.44, + "itl_mean_ms": 434.219, + "itl_p50_ms": 425.123, + "itl_p95_ms": 425.797, + "round_gap_p50_ms": 425.123, + "round_gap_p95_ms": 425.797, + "tokens_per_chunk": 1.0 + }, + "timing_valid": true, + "end_to_end_tps": 8.972713262902161, + "makespan_s": 57.06189254000492, + "steady_tps": 9.4, + "alone": { + "equal": 12, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 1, + "unequal": 0, + "failed": 0 + } + }, + { + "prompt": "code", + "temperature": 0.7, + "streams": 1, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 20.1, + "per_stream_tps": 20.1, + "ttft_s_max": 0.35, + "request": { + "ttft_s": 0.352, + "decode_tps": 20.148, + "prefill_tps": 39.772, + "itl_mean_ms": 49.634, + "itl_p50_ms": 34.146, + "itl_p95_ms": 34.223, + "round_gap_p50_ms": 34.148, + "round_gap_p95_ms": 34.223, + "tokens_per_chunk": 1.016 + }, + "pooled": { + "aggregate_prefill_tps": 39.772, + "itl_mean_ms": 49.634, + "itl_p50_ms": 34.146, + "itl_p95_ms": 34.223, + "round_gap_p50_ms": 34.148, + "round_gap_p95_ms": 34.223, + "tokens_per_chunk": 1.016 + }, + "timing_valid": true, + "end_to_end_tps": 19.232591697977647, + "makespan_s": 6.6553692820016295, + "alone": { + "equal": 3, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 4, + "unequal": 0, + "failed": 0 + } + }, + { + "prompt": "code", + "temperature": 0.7, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 8.7, + "per_stream_tps": 2.2, + "ttft_s_max": 1.41, + "request": { + "ttft_s": 0.88, + "decode_tps": 2.206, + "prefill_tps": 16.576, + "itl_mean_ms": 453.376, + "itl_p50_ms": 425.576, + "itl_p95_ms": 842.011, + "round_gap_p50_ms": 425.578, + "round_gap_p95_ms": 842.011, + "tokens_per_chunk": 1.024 + }, + "pooled": { + "aggregate_prefill_tps": 39.774, + "itl_mean_ms": 450.962, + "itl_p50_ms": 425.576, + "itl_p95_ms": 842.272, + "round_gap_p50_ms": 425.584, + "round_gap_p95_ms": 842.279, + "tokens_per_chunk": 1.024 + }, + "timing_valid": true, + "end_to_end_tps": 8.70127972213928, + "makespan_s": 58.84191939000448, + "steady_tps": 9.0, + "alone": { + "equal": 12, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 4, + "unequal": 0, + "failed": 0 + } + }, + { + "prompt": "chat", + "temperature": 0.7, + "streams": 1, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 29.3, + "per_stream_tps": 29.3, + "ttft_s_max": 0.77, + "request": { + "ttft_s": 0.767, + "decode_tps": 29.277, + "prefill_tps": 40.424, + "itl_mean_ms": 34.156, + "itl_p50_ms": 34.156, + "itl_p95_ms": 34.213, + "round_gap_p50_ms": 34.156, + "round_gap_p95_ms": 34.213, + "tokens_per_chunk": 1.0 + }, + "pooled": { + "aggregate_prefill_tps": 40.424, + "itl_mean_ms": 34.156, + "itl_p50_ms": 34.156, + "itl_p95_ms": 34.213, + "round_gap_p50_ms": 34.156, + "round_gap_p95_ms": 34.213, + "tokens_per_chunk": 1.0 + }, + "timing_valid": true, + "end_to_end_tps": 25.073855590121465, + "makespan_s": 5.104918928002007, + "alone": { + "equal": 3, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 4, + "unequal": 0, + "failed": 0 + } + }, + { + "prompt": "chat", + "temperature": 0.7, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 9.0, + "per_stream_tps": 2.3, + "ttft_s_max": 3.07, + "request": { + "ttft_s": 1.915, + "decode_tps": 2.303, + "prefill_tps": 16.85, + "itl_mean_ms": 434.33, + "itl_p50_ms": 425.187, + "itl_p95_ms": 425.794, + "round_gap_p50_ms": 425.187, + "round_gap_p95_ms": 425.794, + "tokens_per_chunk": 1.0 + }, + "pooled": { + "aggregate_prefill_tps": 40.458, + "itl_mean_ms": 434.234, + "itl_p50_ms": 425.2, + "itl_p95_ms": 425.804, + "round_gap_p50_ms": 425.2, + "round_gap_p95_ms": 425.804, + "tokens_per_chunk": 1.0 + }, + "timing_valid": true, + "end_to_end_tps": 8.972580238514588, + "makespan_s": 57.0627385199914, + "steady_tps": 9.4, + "alone": { + "equal": 12, + "unequal": 0, + "failed": 0 + }, + "serial": { + "equal": 4, + "unequal": 0, + "failed": 0 + } + } + ] + }, + "sglang": { + "decode": [ + { + "label": "", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 27.69607996953815, + "decode_tps_all": [ + 27.76, + 27.7, + 27.64 + ], + "ttft_s_median": 0.07561542600160465, + "prefill_tps_median": null, + "itl_mean_ms_median": 36.106, + "itl_p50_ms_median": 36.1, + "itl_p95_ms_median": 36.262, + "round_gap_p50_ms_median": 36.1, + "round_gap_p95_ms_median": 36.262, + "tokens_per_chunk_median": 1.0 + }, + { + "label": "", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 27.582035108870322, + "decode_tps_all": [ + 27.61, + 27.58, + 27.55 + ], + "ttft_s_median": 0.0793492250086274, + "prefill_tps_median": null, + "itl_mean_ms_median": 36.255, + "itl_p50_ms_median": 36.256, + "itl_p95_ms_median": 36.402, + "round_gap_p50_ms_median": 36.256, + "round_gap_p95_ms_median": 36.402, + "tokens_per_chunk_median": 1.0 + } + ], + "concurrent": [ + { + "prompt": "code", + "temperature": 0.0, + "streams": 1, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 27.5, + "per_stream_tps": 27.5, + "ttft_s_max": 0.08, + "request": { + "ttft_s": 0.076, + "decode_tps": 27.536, + "prefill_tps": null, + "itl_mean_ms": 36.317, + "itl_p50_ms": 36.316, + "itl_p95_ms": 36.422, + "round_gap_p50_ms": 36.316, + "round_gap_p95_ms": 36.422, + "tokens_per_chunk": 1.0 + }, + "pooled": { + "aggregate_prefill_tps": null, + "itl_mean_ms": 36.317, + "itl_p50_ms": 36.316, + "itl_p95_ms": 36.422, + "round_gap_p50_ms": 36.316, + "round_gap_p95_ms": 36.422, + "tokens_per_chunk": 1.0 + }, + "timing_valid": true, + "end_to_end_tps": 27.3039787319187, + "makespan_s": 4.687961460003862 + }, + { + "prompt": "code", + "temperature": 0.0, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 109.6, + "per_stream_tps": 27.4, + "ttft_s_max": 0.08, + "request": { + "ttft_s": 0.081, + "decode_tps": 27.407, + "prefill_tps": null, + "itl_mean_ms": 36.486, + "itl_p50_ms": 36.499, + "itl_p95_ms": 36.634, + "round_gap_p50_ms": 36.499, + "round_gap_p95_ms": 36.634, + "tokens_per_chunk": 1.0 + }, + "pooled": { + "aggregate_prefill_tps": null, + "itl_mean_ms": 36.486, + "itl_p50_ms": 36.498, + "itl_p95_ms": 36.64, + "round_gap_p50_ms": 36.498, + "round_gap_p95_ms": 36.64, + "tokens_per_chunk": 1.0 + }, + "timing_valid": true, + "end_to_end_tps": 108.57239560620481, + "makespan_s": 4.715747470996575, + "steady_tps": 109.7 + }, + { + "prompt": "chat", + "temperature": 0.0, + "streams": 1, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 27.5, + "per_stream_tps": 27.5, + "ttft_s_max": 0.08, + "request": { + "ttft_s": 0.08, + "decode_tps": 27.482, + "prefill_tps": null, + "itl_mean_ms": 36.388, + "itl_p50_ms": 36.39, + "itl_p95_ms": 36.497, + "round_gap_p50_ms": 36.39, + "round_gap_p95_ms": 36.497, + "tokens_per_chunk": 1.0 + }, + "pooled": { + "aggregate_prefill_tps": null, + "itl_mean_ms": 36.388, + "itl_p50_ms": 36.39, + "itl_p95_ms": 36.497, + "round_gap_p50_ms": 36.39, + "round_gap_p95_ms": 36.497, + "tokens_per_chunk": 1.0 + }, + "timing_valid": true, + "end_to_end_tps": 27.227406255280158, + "makespan_s": 4.701145558996359 + }, + { + "prompt": "chat", + "temperature": 0.0, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 109.5, + "per_stream_tps": 27.4, + "ttft_s_max": 0.09, + "request": { + "ttft_s": 0.09, + "decode_tps": 27.388, + "prefill_tps": null, + "itl_mean_ms": 36.512, + "itl_p50_ms": 36.515, + "itl_p95_ms": 36.682, + "round_gap_p50_ms": 36.515, + "round_gap_p95_ms": 36.682, + "tokens_per_chunk": 1.0 + }, + "pooled": { + "aggregate_prefill_tps": null, + "itl_mean_ms": 36.514, + "itl_p50_ms": 36.516, + "itl_p95_ms": 36.676, + "round_gap_p50_ms": 36.516, + "round_gap_p95_ms": 36.676, + "tokens_per_chunk": 1.0 + }, + "timing_valid": true, + "end_to_end_tps": 108.31318625025082, + "makespan_s": 4.727032947004773, + "steady_tps": 109.9 + }, + { + "prompt": "code", + "temperature": 0.7, + "streams": 1, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 27.4, + "per_stream_tps": 27.4, + "ttft_s_max": 0.08, + "request": { + "ttft_s": 0.076, + "decode_tps": 27.438, + "prefill_tps": null, + "itl_mean_ms": 36.446, + "itl_p50_ms": 36.439, + "itl_p95_ms": 36.578, + "round_gap_p50_ms": 36.439, + "round_gap_p95_ms": 36.578, + "tokens_per_chunk": 1.0 + }, + "pooled": { + "aggregate_prefill_tps": null, + "itl_mean_ms": 36.446, + "itl_p50_ms": 36.439, + "itl_p95_ms": 36.578, + "round_gap_p50_ms": 36.439, + "round_gap_p95_ms": 36.578, + "tokens_per_chunk": 1.0 + }, + "timing_valid": true, + "end_to_end_tps": 27.20714335425078, + "makespan_s": 4.704646802987554 + }, + { + "prompt": "code", + "temperature": 0.7, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 109.3, + "per_stream_tps": 27.3, + "ttft_s_max": 0.08, + "request": { + "ttft_s": 0.081, + "decode_tps": 27.321, + "prefill_tps": null, + "itl_mean_ms": 36.603, + "itl_p50_ms": 36.603, + "itl_p95_ms": 36.77, + "round_gap_p50_ms": 36.603, + "round_gap_p95_ms": 36.77, + "tokens_per_chunk": 1.0 + }, + "pooled": { + "aggregate_prefill_tps": null, + "itl_mean_ms": 36.602, + "itl_p50_ms": 36.601, + "itl_p95_ms": 36.78, + "round_gap_p50_ms": 36.601, + "round_gap_p95_ms": 36.78, + "tokens_per_chunk": 1.0 + }, + "timing_valid": true, + "end_to_end_tps": 108.26259540253565, + "makespan_s": 4.7292418780125445, + "steady_tps": 109.0 + }, + { + "prompt": "chat", + "temperature": 0.7, + "streams": 1, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 27.4, + "per_stream_tps": 27.4, + "ttft_s_max": 0.08, + "request": { + "ttft_s": 0.08, + "decode_tps": 27.389, + "prefill_tps": null, + "itl_mean_ms": 36.511, + "itl_p50_ms": 36.51, + "itl_p95_ms": 36.617, + "round_gap_p50_ms": 36.51, + "round_gap_p95_ms": 36.617, + "tokens_per_chunk": 1.0 + }, + "pooled": { + "aggregate_prefill_tps": null, + "itl_mean_ms": 36.511, + "itl_p50_ms": 36.51, + "itl_p95_ms": 36.617, + "round_gap_p50_ms": 36.51, + "round_gap_p95_ms": 36.617, + "tokens_per_chunk": 1.0 + }, + "timing_valid": true, + "end_to_end_tps": 27.138389005239, + "makespan_s": 4.716565893992083 + }, + { + "prompt": "chat", + "temperature": 0.7, + "streams": 4, + "failed": 0, + "unmeasured": 0, + "aggregate_tps": 109.2, + "per_stream_tps": 27.3, + "ttft_s_max": 0.09, + "request": { + "ttft_s": 0.09, + "decode_tps": 27.298, + "prefill_tps": null, + "itl_mean_ms": 36.632, + "itl_p50_ms": 36.634, + "itl_p95_ms": 36.815, + "round_gap_p50_ms": 36.634, + "round_gap_p95_ms": 36.815, + "tokens_per_chunk": 1.0 + }, + "pooled": { + "aggregate_prefill_tps": null, + "itl_mean_ms": 36.633, + "itl_p50_ms": 36.631, + "itl_p95_ms": 36.807, + "round_gap_p50_ms": 36.631, + "round_gap_p95_ms": 36.807, + "tokens_per_chunk": 1.0 + }, + "timing_valid": true, + "end_to_end_tps": 107.94896582681284, + "makespan_s": 4.742981982999481, + "steady_tps": 109.3 + } + ] + } + }, + "existing_formats": { + "mlx4": { + "order": [ + "baseline", + "candidate", + "baseline", + "candidate" + ], + "decode": [ + { + "process": 0, + "arm": "baseline", + "rows": [ + { + "label": "", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 83.69777850403305, + "decode_tps_all": [ + 83.88, + 83.7, + 83.51 + ], + "ttft_s_median": 0.015347501001087949, + "prefill_tps_median": 912.201, + "itl_mean_ms_median": 11.948, + "itl_p50_ms_median": 12.473, + "itl_p95_ms_median": 12.668, + "round_gap_p50_ms_median": 12.474, + "round_gap_p95_ms_median": 12.668, + "tokens_per_chunk_median": 1.049 + }, + { + "label": "", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 80.08182793976654, + "decode_tps_all": [ + 80.25, + 80.08, + 80.06 + ], + "ttft_s_median": 0.0786635280092014, + "prefill_tps_median": 394.084, + "itl_mean_ms_median": 12.487, + "itl_p50_ms_median": 12.533, + "itl_p95_ms_median": 12.579, + "round_gap_p50_ms_median": 12.533, + "round_gap_p95_ms_median": 12.579, + "tokens_per_chunk_median": 1.0 + } + ] + }, + { + "process": 1, + "arm": "candidate", + "rows": [ + { + "label": "", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 83.62615795274348, + "decode_tps_all": [ + 83.87, + 83.63, + 83.55 + ], + "ttft_s_median": 0.015391046006698161, + "prefill_tps_median": 909.62, + "itl_mean_ms_median": 11.958, + "itl_p50_ms_median": 12.471, + "itl_p95_ms_median": 12.662, + "round_gap_p50_ms_median": 12.474, + "round_gap_p95_ms_median": 12.662, + "tokens_per_chunk_median": 1.049 + }, + { + "label": "", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 80.17831110965382, + "decode_tps_all": [ + 80.24, + 80.18, + 80.06 + ], + "ttft_s_median": 0.07904019100533333, + "prefill_tps_median": 392.206, + "itl_mean_ms_median": 12.472, + "itl_p50_ms_median": 12.533, + "itl_p95_ms_median": 12.572, + "round_gap_p50_ms_median": 12.533, + "round_gap_p95_ms_median": 12.572, + "tokens_per_chunk_median": 1.0 + } + ] + }, + { + "process": 2, + "arm": "baseline", + "rows": [ + { + "label": "", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 83.70820945412511, + "decode_tps_all": [ + 83.95, + 83.71, + 83.56 + ], + "ttft_s_median": 0.01528543200402055, + "prefill_tps_median": 915.905, + "itl_mean_ms_median": 11.946, + "itl_p50_ms_median": 12.467, + "itl_p95_ms_median": 12.658, + "round_gap_p50_ms_median": 12.47, + "round_gap_p95_ms_median": 12.658, + "tokens_per_chunk_median": 1.049 + }, + { + "label": "", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 80.23383885721884, + "decode_tps_all": [ + 80.23, + 80.25, + 80.16 + ], + "ttft_s_median": 0.07866058900253847, + "prefill_tps_median": 394.098, + "itl_mean_ms_median": 12.464, + "itl_p50_ms_median": 12.518, + "itl_p95_ms_median": 12.563, + "round_gap_p50_ms_median": 12.518, + "round_gap_p95_ms_median": 12.563, + "tokens_per_chunk_median": 1.0 + } + ] + }, + { + "process": 3, + "arm": "candidate", + "rows": [ + { + "label": "", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 83.96708226989077, + "decode_tps_all": [ + 84.06, + 83.97, + 83.58 + ], + "ttft_s_median": 0.015365143000963144, + "prefill_tps_median": 911.153, + "itl_mean_ms_median": 11.909, + "itl_p50_ms_median": 12.43, + "itl_p95_ms_median": 12.63, + "round_gap_p50_ms_median": 12.432, + "round_gap_p95_ms_median": 12.63, + "tokens_per_chunk_median": 1.049 + }, + { + "label": "", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 80.35755848604694, + "decode_tps_all": [ + 80.4, + 80.36, + 80.29 + ], + "ttft_s_median": 0.07896163499390241, + "prefill_tps_median": 392.596, + "itl_mean_ms_median": 12.444, + "itl_p50_ms_median": 12.499, + "itl_p95_ms_median": 12.554, + "round_gap_p50_ms_median": 12.499, + "round_gap_p95_ms_median": 12.554, + "tokens_per_chunk_median": 1.0 + } + ] + } + ], + "full_token_hash_matches": 20, + "scoring_admission": [ + { + "process": 0, + "arm": "baseline", + "http_status": 400 + }, + { + "process": 1, + "arm": "candidate", + "http_status": 400 + }, + { + "process": 2, + "arm": "baseline", + "http_status": 400 + }, + { + "process": 3, + "arm": "candidate", + "http_status": 400 + } + ], + "descriptive_rates": [ + { + "prompt": "fibonacci-raw", + "all_process_medians": [ + 83.69777850403305, + 83.62615795274348, + 83.70820945412511, + 83.96708226989077 + ], + "baseline_median_of_process_medians": 83.70299397907908, + "candidate_median_of_process_medians": 83.79662011131713, + "change_percent": 0.11185517720124771, + "scope": "descriptive; no statistical noninferiority claim" + }, + { + "prompt": "gpu-chat-no-think", + "all_process_medians": [ + 80.08182793976654, + 80.17831110965382, + 80.23383885721884, + 80.35755848604694 + ], + "baseline_median_of_process_medians": 80.1578333984927, + "candidate_median_of_process_medians": 80.26793479785039, + "change_percent": 0.137355757621771, + "scope": "descriptive; no statistical noninferiority claim" + } + ] + }, + "modelopt": { + "order": [ + "baseline", + "candidate", + "baseline", + "candidate" + ], + "decode": [ + { + "process": 0, + "arm": "baseline", + "rows": [ + { + "label": "", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 63.841567228005204, + "decode_tps_all": [ + 63.98, + 63.84, + 63.73 + ], + "ttft_s_median": 0.01842584100086242, + "prefill_tps_median": 759.802, + "itl_mean_ms_median": 15.664, + "itl_p50_ms_median": 15.669, + "itl_p95_ms_median": 15.723, + "round_gap_p50_ms_median": 15.669, + "round_gap_p95_ms_median": 15.723, + "tokens_per_chunk_median": 1.0 + }, + { + "label": "", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 63.65870643908519, + "decode_tps_all": [ + 63.75, + 63.66, + 63.54 + ], + "ttft_s_median": 0.08811796200461686, + "prefill_tps_median": 351.801, + "itl_mean_ms_median": 15.709, + "itl_p50_ms_median": 15.769, + "itl_p95_ms_median": 15.827, + "round_gap_p50_ms_median": 15.769, + "round_gap_p95_ms_median": 15.827, + "tokens_per_chunk_median": 1.0 + } + ] + }, + { + "process": 1, + "arm": "candidate", + "rows": [ + { + "label": "", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 63.68078257763841, + "decode_tps_all": [ + 63.79, + 63.68, + 63.56 + ], + "ttft_s_median": 0.018456204008543864, + "prefill_tps_median": 758.553, + "itl_mean_ms_median": 15.703, + "itl_p50_ms_median": 15.702, + "itl_p95_ms_median": 15.785, + "round_gap_p50_ms_median": 15.702, + "round_gap_p95_ms_median": 15.785, + "tokens_per_chunk_median": 1.0 + }, + { + "label": "", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 63.491798256545614, + "decode_tps_all": [ + 63.6, + 63.49, + 63.4 + ], + "ttft_s_median": 0.08852486198884435, + "prefill_tps_median": 350.184, + "itl_mean_ms_median": 15.75, + "itl_p50_ms_median": 15.823, + "itl_p95_ms_median": 15.862, + "round_gap_p50_ms_median": 15.823, + "round_gap_p95_ms_median": 15.862, + "tokens_per_chunk_median": 1.0 + } + ] + }, + { + "process": 2, + "arm": "baseline", + "rows": [ + { + "label": "", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 63.63310237837419, + "decode_tps_all": [ + 63.79, + 63.63, + 63.54 + ], + "ttft_s_median": 0.01836696699319873, + "prefill_tps_median": 762.238, + "itl_mean_ms_median": 15.715, + "itl_p50_ms_median": 15.713, + "itl_p95_ms_median": 15.759, + "round_gap_p50_ms_median": 15.713, + "round_gap_p95_ms_median": 15.759, + "tokens_per_chunk_median": 1.0 + }, + { + "label": "", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 63.48527319416725, + "decode_tps_all": [ + 63.6, + 63.49, + 63.45 + ], + "ttft_s_median": 0.0880447700037621, + "prefill_tps_median": 352.094, + "itl_mean_ms_median": 15.752, + "itl_p50_ms_median": 15.819, + "itl_p95_ms_median": 15.862, + "round_gap_p50_ms_median": 15.819, + "round_gap_p95_ms_median": 15.862, + "tokens_per_chunk_median": 1.0 + } + ] + }, + { + "process": 3, + "arm": "candidate", + "rows": [ + { + "label": "", + "prompt": "fibonacci-raw", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 63.742755359874394, + "decode_tps_all": [ + 63.93, + 63.74, + 63.62 + ], + "ttft_s_median": 0.018511495989514515, + "prefill_tps_median": 756.287, + "itl_mean_ms_median": 15.688, + "itl_p50_ms_median": 15.69, + "itl_p95_ms_median": 15.744, + "round_gap_p50_ms_median": 15.69, + "round_gap_p95_ms_median": 15.744, + "tokens_per_chunk_median": 1.0 + }, + { + "label": "", + "prompt": "gpu-chat-no-think", + "temperature": 0.0, + "tokens": 128, + "decode_tps_median": 63.56980495388808, + "decode_tps_all": [ + 63.67, + 63.57, + 63.5 + ], + "ttft_s_median": 0.08842688999720849, + "prefill_tps_median": 350.572, + "itl_mean_ms_median": 15.731, + "itl_p50_ms_median": 15.803, + "itl_p95_ms_median": 15.841, + "round_gap_p50_ms_median": 15.803, + "round_gap_p95_ms_median": 15.841, + "tokens_per_chunk_median": 1.0 + } + ] + } + ], + "full_token_hash_matches": 20, + "scoring_admission": [ + { + "process": 0, + "arm": "baseline", + "http_status": 400 + }, + { + "process": 1, + "arm": "candidate", + "http_status": 400 + }, + { + "process": 2, + "arm": "baseline", + "http_status": 400 + }, + { + "process": 3, + "arm": "candidate", + "http_status": 400 + } + ], + "descriptive_rates": [ + { + "prompt": "fibonacci-raw", + "all_process_medians": [ + 63.841567228005204, + 63.68078257763841, + 63.63310237837419, + 63.742755359874394 + ], + "baseline_median_of_process_medians": 63.7373348031897, + "candidate_median_of_process_medians": 63.7117689687564, + "change_percent": -0.040111238589179976, + "scope": "descriptive; no statistical noninferiority claim" + }, + { + "prompt": "gpu-chat-no-think", + "all_process_medians": [ + 63.65870643908519, + 63.491798256545614, + 63.48527319416725, + 63.56980495388808 + ], + "baseline_median_of_process_medians": 63.57198981662622, + "candidate_median_of_process_medians": 63.53080160521685, + "change_percent": -0.06478987291128613, + "scope": "descriptive; no statistical noninferiority claim" + } + ] + } + }, + "lifecycle": { + "cache-fresh": { + "schema_version": 1, + "mode": "fresh", + "reply_tokens": 8, + "temperature": 0, + "seed": 1234, + "client": "bench_concurrent.stream/together and bench_cache.receipt/qualify", + "client_source_sha256": "6334a19acfa43de98ebe614dfbb61db047de435eb661fcff228d5c39f229eecd", + "qualified": true, + "cases": 2, + "all_qualified": true, + "details": "Linked asset: lifecycle/cache-fresh.json" + }, + "cache-retained": { + "schema_version": 1, + "mode": "retained", + "reply_tokens": 8, + "temperature": 0, + "seed": 1234, + "client": "bench_concurrent.stream/together and bench_cache.receipt/qualify", + "client_source_sha256": "6334a19acfa43de98ebe614dfbb61db047de435eb661fcff228d5c39f229eecd", + "qualified": true, + "cases": 2, + "all_qualified": true, + "details": "Linked asset: lifecycle/cache-retained.json" + }, + "cache-restart": { + "schema_version": 1, + "mode": "fresh", + "reply_tokens": 8, + "temperature": 0, + "seed": 1234, + "client": "bench_concurrent.stream/together and bench_cache.receipt/qualify", + "client_source_sha256": "6334a19acfa43de98ebe614dfbb61db047de435eb661fcff228d5c39f229eecd", + "qualified": true, + "cases": 2, + "all_qualified": true, + "details": "Linked asset: lifecycle/cache-restart.json" + }, + "observed-cancellation": { + "schema": 1, + "client_source_sha256": "b786fdb8eebc8f9cb82a0edea70055dcc1ddcfe587d19c9077febefaf161e2a9", + "passed": true, + "checks": [ + { + "check": "reference_cache_off", + "passed": true, + "reference": { + "token_ids": [ + 13, + 271, + 248068, + 271, + 248069, + 271, + 6479, + 44896 + ], + "score_sha256": "46c305a756cbddf88041a6e9a02a120fc59347282dfb077ede76a592f096d28a", + "cached_tokens": 0 + } + }, + { + "check": "prefill_observed_before_reset", + "passed": true, + "status": { + "running": 1, + "fill_prompt_tokens": 4097, + "fill_tokens_left": 4097, + "generation_tokens_running": 0 + } + }, + { + "check": "prefill_cancellation_acknowledged", + "passed": true, + "counter_before": 0, + "counter_after": 1 + }, + { + "check": "score_after_prefill_cancel", + "passed": true, + "observed": { + "token_ids": [ + 13, + 271, + 248068, + 271, + 248069, + 271, + 6479, + 44896 + ], + "score_sha256": "46c305a756cbddf88041a6e9a02a120fc59347282dfb077ede76a592f096d28a", + "cached_tokens": 0 + } + }, + { + "check": "decode_observed_before_close", + "passed": true, + "status": { + "running": 1, + "generation_tokens_running": 1 + } + }, + { + "check": "decode_cancellation_acknowledged", + "passed": true, + "counter_before": 1, + "counter_after": 2 + }, + { + "check": "score_after_decode_cancel", + "passed": true, + "observed": { + "token_ids": [ + 13, + 271, + 248068, + 271, + 248069, + 271, + 6479, + 44896 + ], + "score_sha256": "46c305a756cbddf88041a6e9a02a120fc59347282dfb077ede76a592f096d28a", + "cached_tokens": 0 + } + } + ], + "details": "Linked asset: lifecycle/observed-cancellation.json" + } + }, + "memory": { + "memory-post-cold-65536": { + "case": "cold-65536", + "prompt_tokens": 65536, + "context": 65568, + "parallel": 1, + "cache_gib": 0, + "request_exit": 0, + "measurement": "single metrics read after the timed request completed; runtime lifetime peaks include load and that request", + "counters": { + "process_resident_bytes": 616386560, + "process_resident_peak_bytes": 6433718272, + "device_memory_bytes": 59203974944, + "device_memory_peak_bytes": 59379591968, + "pinned_memory_bytes": 64103456 + } + }, + "memory-post-sglang-short": { + "cgroup_memory_peak_bytes": 34359742464, + "case": "sglang-short", + "context": 8192, + "parallel": 4, + "measurement": "post-timed Linux per-process high-water marks; each process peak is separate, not a group-summed physical peak; collector process excluded; python -S avoids Torch startup hooks; cgroup peak read before the census probe", + "process_count": 6, + "largest_single_process_VmHWM_bytes": 7317155840 + }, + "memory-post-sglang-cold-65536": { + "cgroup_memory_peak_bytes": 6515748864, + "case": "sglang-cold-65536", + "context": 65568, + "parallel": 1, + "measurement": "post-timed Linux per-process high-water marks; each process peak is separate, not a group-summed physical peak; collector process excluded; python -S avoids Torch startup hooks; cgroup peak read before the census probe", + "process_count": 38, + "largest_single_process_VmHWM_bytes": 7324057600 + }, + "memory-cacheoff": { + "case": "memory-cacheoff", + "context": 8192, + "parallel": 4, + "cache_gib": 0, + "samples": 4092, + "observed_max": { + "process_resident_bytes": 619311104, + "process_resident_peak_bytes": 6425047040, + "device_memory_bytes": 57550903072, + "device_memory_peak_bytes": 58008400672, + "pinned_memory_bytes": 64103456 + }, + "scope": "separate untimed sampling; 4097-token raw requests; large context is admission, not full64k peak" + }, + "memory-large-admission": { + "case": "memory-large-admission", + "context": 65568, + "parallel": 1, + "cache_gib": 0, + "samples": 4099, + "observed_max": { + "process_resident_bytes": 609476608, + "process_resident_peak_bytes": 6423191552, + "device_memory_bytes": 59238651680, + "device_memory_peak_bytes": 59379591968, + "pinned_memory_bytes": 64103456 + }, + "scope": "separate untimed sampling; 4097-token raw requests; large context is admission, not full64k peak" + }, + "memory-post-sglang-cold-32768": { + "cgroup_memory_peak_bytes": 6515982336, + "case": "sglang-cold-32768", + "context": 32800, + "parallel": 1, + "measurement": "post-timed Linux per-process high-water marks; each process peak is separate, not a group-summed physical peak; collector process excluded; python -S avoids Torch startup hooks; cgroup peak read before the census probe", + "process_count": 38, + "largest_single_process_VmHWM_bytes": 7313494016 + }, + "memory-post-cold-8192": { + "case": "cold-8192", + "prompt_tokens": 8192, + "context": 8224, + "parallel": 1, + "cache_gib": 0, + "request_exit": 0, + "measurement": "single metrics read after the timed request completed; runtime lifetime peaks include load and that request", + "counters": { + "process_resident_bytes": 605163520, + "process_resident_peak_bytes": 6433665024, + "device_memory_bytes": 55445878560, + "device_memory_peak_bytes": 55621495584, + "pinned_memory_bytes": 64103456 + } + }, + "memory-post-sglang-cold-8192": { + "cgroup_memory_peak_bytes": 6507474944, + "case": "sglang-cold-8192", + "context": 8224, + "parallel": 1, + "measurement": "post-timed Linux per-process high-water marks; each process peak is separate, not a group-summed physical peak; collector process excluded; python -S avoids Torch startup hooks; cgroup peak read before the census probe", + "process_count": 38, + "largest_single_process_VmHWM_bytes": 7312592896 + }, + "memory-post-cold-2048": { + "case": "cold-2048", + "prompt_tokens": 2048, + "context": 2080, + "parallel": 1, + "cache_gib": 0, + "request_exit": 0, + "measurement": "single metrics read after the timed request completed; runtime lifetime peaks include load and that request", + "counters": { + "process_resident_bytes": 599642112, + "process_resident_peak_bytes": 6436241408, + "device_memory_bytes": 55043225376, + "device_memory_peak_bytes": 55218842400, + "pinned_memory_bytes": 64103456 + } + }, + "memory-post-sglang-cold-2048": { + "cgroup_memory_peak_bytes": 34359738368, + "case": "sglang-cold-2048", + "context": 2080, + "parallel": 1, + "measurement": "post-timed Linux per-process high-water marks; each process peak is separate, not a group-summed physical peak; collector process excluded; python -S avoids Torch startup hooks; cgroup peak read before the census probe", + "process_count": 38, + "largest_single_process_VmHWM_bytes": 7312580608 + }, + "memory-post-cold-32768": { + "case": "cold-32768", + "prompt_tokens": 32768, + "context": 32800, + "parallel": 1, + "cache_gib": 0, + "request_exit": 0, + "measurement": "single metrics read after the timed request completed; runtime lifetime peaks include load and that request", + "counters": { + "process_resident_bytes": 612712448, + "process_resident_peak_bytes": 6436474880, + "device_memory_bytes": 57056491296, + "device_memory_peak_bytes": 57232108320, + "pinned_memory_bytes": 64103456 + } + }, + "memory-retained": { + "scope": "separate untimed retained-cache exactness run; sampled counters, not physical full-context peak", + "samples": 2073, + "observed_max": { + "process_resident_bytes": 1055105024, + "process_resident_peak_bytes": 6442209280, + "device_memory_bytes": 57674504992, + "device_memory_peak_bytes": 58008400672, + "pinned_memory_bytes": 486482976 + } + } + }, + "cold": { + "native-2048": { + "prompt_tokens": 2048, + "tokens": 8, + "cached_tokens": 0, + "complete": true, + "ttft_s": 49.51466282599722, + "decode_tps": null, + "output_sha256": "0d63a796d361256be64abda1d9dd78182ce8b1f0a0fc5d2b3a959e5ce76cece5", + "qualified": true, + "http_read_timeout_s": 1800 + }, + "sglang-2048": { + "prompt_tokens": 2048, + "tokens": 8, + "cached_tokens": null, + "complete": true, + "ttft_s": 0.44657828799972776, + "decode_tps": 28.238741617079423, + "output_sha256": "0d63a796d361256be64abda1d9dd78182ce8b1f0a0fc5d2b3a959e5ce76cece5", + "qualified": false, + "http_read_timeout_s": 1800 + }, + "native-8192": { + "prompt_tokens": 8192, + "tokens": 8, + "cached_tokens": 0, + "complete": true, + "ttft_s": 199.77739574100997, + "decode_tps": null, + "output_sha256": "47c3cdb03e7a6ef10221111229954881668aafbc165f829e8c12d287a988ff5e", + "qualified": true, + "http_read_timeout_s": 1800 + }, + "sglang-8192": { + "prompt_tokens": 8192, + "tokens": 8, + "cached_tokens": null, + "complete": true, + "ttft_s": 1.900649514995166, + "decode_tps": 27.139285275192837, + "output_sha256": "47c3cdb03e7a6ef10221111229954881668aafbc165f829e8c12d287a988ff5e", + "qualified": false, + "http_read_timeout_s": 1800 + }, + "native-32768": { + "prompt_tokens": 32768, + "tokens": 8, + "cached_tokens": 0, + "complete": true, + "ttft_s": 801.7859435379942, + "decode_tps": null, + "output_sha256": "ce52e19fb60e4a98a65e23e48e9bc5a026e6230b8eb248d99219c97578508a7b", + "qualified": true, + "http_read_timeout_s": 1800 + }, + "sglang-32768": { + "prompt_tokens": 32768, + "tokens": 8, + "cached_tokens": null, + "complete": true, + "ttft_s": 9.211406823000289, + "decode_tps": 22.561751586190454, + "output_sha256": "ce52e19fb60e4a98a65e23e48e9bc5a026e6230b8eb248d99219c97578508a7b", + "qualified": false, + "http_read_timeout_s": 1800 + }, + "native-65536": { + "prompt_tokens": 65536, + "tokens": 8, + "cached_tokens": 0, + "complete": true, + "ttft_s": 1601.8139554319932, + "decode_tps": null, + "output_sha256": "036b5141a8b45cc5fcb3ccf346bdf8165c5ca5795fc0a418c4257679896df186", + "qualified": true, + "http_read_timeout_s": 3600 + }, + "sglang-65536": { + "prompt_tokens": 65536, + "tokens": 8, + "cached_tokens": null, + "complete": true, + "ttft_s": 24.60757574099989, + "decode_tps": 18.695103864223043, + "output_sha256": "036b5141a8b45cc5fcb3ccf346bdf8165c5ca5795fc0a418c4257679896df186", + "qualified": false, + "http_read_timeout_s": 3600 + } + }, + "kernel_contract": { + "summary": "SUMMARY 559 kernels: 559 pass gates 1-4, 0 fail, 6 known findings; 367 controls: 367 red as planted, 0 missed; 0 limit problems; gates 4023784 ms, limits 760889 ms", + "known_findings": [ + "KNOWN nonfinite cuda qwen35 decode attention, bf16 cache (tf_q35_attn_partial, tf_q35_attn_merge): a NaN key in one of a row's several chunks leaves the row finite: tf_q35_attn_merge skips that chunk", + "KNOWN nonfinite cuda qwen35 decode attention, fp8 cache (tf_q35_attn_partial8, tf_q35_attn_merge): a NaN key in one of a row's several chunks leaves the row finite: tf_q35_attn_merge skips that chunk", + "KNOWN nonfinite cuda glm tf_glm_scores on pages out of order: relu is fmaxf(x, 0), as Triton's tl.maximum: a NaN dot scores 0 where float64 keeps the NaN", + "KNOWN nonfinite cuda glm tf_glm_index_scores on pages out of order: relu is fmaxf(x, 0), as Triton's tl.maximum: a NaN dot scores 0 where float64 keeps the NaN", + "KNOWN nonfinite cuda qwen35 contiguous attention, bf16 cache (tf_q35_attn_partial_legacy, tf_q35_attn_merge): a NaN key in one of a row's several chunks leaves the row finite: tf_q35_attn_merge skips that chunk", + "KNOWN nonfinite cuda qwen35 contiguous attention, fp8 cache (tf_q35_attn_partial8_legacy, tf_q35_attn_merge): a NaN key in one of a row's several chunks leaves the row finite: tf_q35_attn_merge skips that chunk" + ], + "scope": "complete backend runner; diagnostic norm subset is separate", + "counts": { + "kernels": 559, + "passed": 559, + "failed": 0, + "known": 6, + "controls": 367, + "controls_red": 367, + "controls_missed": 0, + "limit_problems": 0, + "gates_ms": 4023784, + "limits_ms": 760889 + }, + "full_norm_stress_lines": [ + "PASS sums cuda RMS norm tf_add_rms_rows_bf16h_f32w (Qwen GDN scales): within its bound at k 128; fp16 sums would miss 256x, bf16 0.3x (BF16 output rounding can hide BF16 reduction error; the FP16 replay must still miss the exact-sum bound 100x)" + ], + "run_status": { + "source_commit": "b168b36d0cc3503ae69e8bffcad494574019caf5", + "build_exit": 0, + "build_elapsed_s": 217.38851284980774, + "initial_runner_sha256": "bd9574f60955b11718d74b65d81cba4f22b30e2306a9eee7df03e12dd152d27e", + "build_args": [ + "-Dnvcc=/usr/local/cuda/bin/nvcc", + "-Doptimize=ReleaseFast", + "-Dsm=80,86,89,120,121", + "-Dfatbins=/qual/readiness/candidate/zig-out/fatbin", + "-Dcontract-controls=/qual/readiness/candidate/zig-out/fatbin/contract_controls.fatbin", + "-j8", + "--summary", + "all" + ], + "setup_correction": "The initial plain build omitted -Dsm for independently compiled H3. Prebuilt common fatbins already contained all five targets. Retry explicitly builds auxiliary images for all five SMs; source and gates unchanged.", + "runner_sha256": "1cec1417c7d6d47ff86cf278dbba47f60267e9f9e4b99ca4d2a7964863555c39", + "runner_bytes": 433762408, + "kernel_contract_exit": 0, + "kernel_contract_elapsed_s": 4786.48529624939 + }, + "auxiliary_image_proof": { + "scope": "Exact embedded-image byte search and CUDA object profile listing; source and gates unchanged.", + "images": [ + { + "image": "h3.fatbin", + "sha256": "fd47d35dc9bf50d6b23a0e3263e186db7f97dc4657bbc345fdc9aa9d9b399e19", + "bytes": 166328, + "initial_runner_contains_exact_image": true, + "retry_runner_contains_exact_image": false, + "sm_profiles": [ + "121" + ] + }, + { + "image": "h3.fatbin", + "sha256": "f1949a9db75d8474c2d5ec1904dd7e9a7567bb1ae62d9def2b7472ecc9c76f68", + "bytes": 751296, + "initial_runner_contains_exact_image": false, + "retry_runner_contains_exact_image": true, + "sm_profiles": [ + "120", + "121", + "80", + "86", + "89" + ] + } + ], + "initial_runner_sha256": "bd9574f60955b11718d74b65d81cba4f22b30e2306a9eee7df03e12dd152d27e", + "retry_runner_sha256": "1cec1417c7d6d47ff86cf278dbba47f60267e9f9e4b99ca4d2a7964863555c39", + "served_native_sha256": "fa2f415a1b7a6f47a62ee078e7f6de86f3f677d2bf74ffa5c2d273e1ce713a64" + } + }, + "qualification_limits": [ + "Other-engine strict distance comparison fails; no broader bound replaces it.", + "No performance qualification claim.", + "Other physical chips/backends, multiple ranks, FP8 KV and optional grammar/tool paths unqualified.", + "Vision, int8 prompts and learning refused for this new text format.", + "Physical 128 GB-class host; the serving 32 GiB quota does not qualify a physical 32 GiB machine.", + "GB10 execution remains with the maintainer." + ], + "build_and_contract_budgets": { + "source": "b168b36d0cc3503ae69e8bffcad494574019caf5", + "tool": "Zig 0.17.0", + "container_workdir": "/work", + "tool_mount": "/toolchain", + "compiler_image": "nvidia/cuda:13.0.2-devel-ubuntu24.04", + "scope": "Generic container paths are the actual build paths; private host mount sources are omitted. Source and asset hashes are in identities.", + "plain_argv": [ + "zig", + "build", + "-Dnvcc=/usr/local/cuda/bin/nvcc", + "-Doptimize=ReleaseFast", + "-Dfatbins=/qual/readiness/candidate/zig-out/fatbin", + "-Dcontract-controls=/qual/readiness/candidate/zig-out/fatbin/contract_controls.fatbin", + "-j8", + "--summary", + "all" + ], + "native_and_capture_argv": [ + "zig", + "build", + "native", + "qwen35-score-reference", + "-Dnvcc=/usr/local/cuda/bin/nvcc", + "-Doptimize=ReleaseFast", + "-Dfatbins=/qual/readiness/candidate/zig-out/fatbin", + "-Dcontract-controls=/qual/readiness/candidate/zig-out/fatbin/contract_controls.fatbin", + "-j8", + "--summary", + "all" + ], + "host_argv": [ + "zig", + "build", + "test", + "test-kernel-contract", + "test-golden", + "fuzz-cortheon", + "-j8", + "--summary", + "all" + ], + "baseline_native_argv": [ + "zig", + "build", + "native", + "-Doptimize=ReleaseFast", + "-Dfatbins=/qual/readiness/candidate/zig-out/fatbin", + "-j8", + "--summary", + "all" + ], + "baseline_source": "0d19cc19b5b49a0b4a0188a56b6705bbedae91e4", + "build_budget": { + "cpu_quota": 8, + "ram_gib": 32, + "unprivileged": true + }, + "correction": "Initial plain/native builds omit explicit -Dsm while using five-SM prebuilt common assets. The complete CUDA retry rebuild adds -Dsm=80,86,89,120,121 for independently compiled auxiliary H3. The served native is not rebuilt in that retry and remains byte-identical. Exact retry argv/hash/status are separate.", + "gpu_contract_budget": "One GPU under the existing lock; host CPU/RAM available, no serving container CPU/RAM cap. This numerical qualification job is separate from timed serving and does not establish physical 32 GiB fit." + }, + "sglang_runtime_versions": { + "image": "lmsysorg/sglang@sha256:d6e7288627be8b02be88e4bba38e73f6d50e2826869f753c13a4c4385ab3eda9", + "sglang": "0.5.19", + "torch": "2.13.0+cu130", + "transformers": "5.12.1", + "verification": "CPU-only installed-distribution metadata query in the exact pinned image; no model/device workload." + }, + "host_hardware": { + "cpu_model": "AMD Ryzen 9 9950X3D 16-Core Processor", + "logical_cpus": 32, + "scope": "Public CPU product name and logical count only; no hostname, serial, address or device UUID." + }, + "post_serving_weight_verification": { + "passed": true, + "repo": "Qwen/Qwen3.5-27B", + "revision": "fc05daec18b0a78c049392ed2e771dde82bdf654", + "scope": "all11 stored checkpoint shards rehashed after all timed serving workloads; unchanged from pinned public LFS bytes", + "shards": [ + { + "name": "model.safetensors-00001-of-00011.safetensors", + "bytes": 5263851872, + "sha256": "9019228d172c87d5603266c2d56672d119e838facffa164de803a1ebf0d716d2" + }, + { + "name": "model.safetensors-00002-of-00011.safetensors", + "bytes": 5347741440, + "sha256": "890ef00c920b01c1c02755088c8d8ca5cdd6a1faa2a9a729eecd00857648b411" + }, + { + "name": "model.safetensors-00003-of-00011.safetensors", + "bytes": 5347741504, + "sha256": "8aca03689ad0717fb91455809a6670eecca818bea8c0b6bd3a591a8807cc3223" + }, + { + "name": "model.safetensors-00004-of-00011.safetensors", + "bytes": 5347741504, + "sha256": "20f539430c60fa611b3522b8408749a080b63f1fe034e551a6539ef864ca079a" + }, + { + "name": "model.safetensors-00005-of-00011.safetensors", + "bytes": 5347741504, + "sha256": "57a0c074c654f05fc2d6b5112eeec387ac04986e928e42f502993e69aa03a49d" + }, + { + "name": "model.safetensors-00006-of-00011.safetensors", + "bytes": 5347741504, + "sha256": "cfa4e6fbfc600854ef6c8e5465d0a1e43832a64b5e539f1e880333e3b1086703" + }, + { + "name": "model.safetensors-00007-of-00011.safetensors", + "bytes": 5347741496, + "sha256": "d426963325b2319cb9e1442bc8b89b9a7748a8f7a907aa4041c11531cda6b014" + }, + { + "name": "model.safetensors-00008-of-00011.safetensors", + "bytes": 5368714128, + "sha256": "fe60dbb9d25354c4eb2a9a59d9b1afd07741c8bebab5870f5eea6eadb4cf9a06" + }, + { + "name": "model.safetensors-00009-of-00011.safetensors", + "bytes": 5347745520, + "sha256": "71a153d882242734a1fc7e000734727f00f6ec8ca70b044f5e44fcf97736ef8f" + }, + { + "name": "model.safetensors-00010-of-00011.safetensors", + "bytes": 5347749200, + "sha256": "146745698b9f21940e2982beb1816a0eef3b80d77ab9cd884695b9a08c2697eb" + }, + { + "name": "model.safetensors-00011-of-00011.safetensors", + "bytes": 2148512760, + "sha256": "d947ce7483c4109b55039f1359f4494d22390cf123568100abd89816802f097d" + } + ] + }, + "sglang_cold_scheduler_cache": { + "2048": { + "timed_request_chunk_new_tokens": 2048, + "timed_request_cached_tokens_all_zero": true, + "client_exit": 1, + "scope": "Independent scheduler accounting; startup/health rows of 80 or 1 token are retained separately. Missing HTTP cache counter remains null and generic client qualifier remains false." + }, + "8192": { + "timed_request_chunk_new_tokens": 8192, + "timed_request_cached_tokens_all_zero": true, + "client_exit": 1, + "scope": "Independent scheduler accounting; startup/health rows of 80 or 1 token are retained separately. Missing HTTP cache counter remains null and generic client qualifier remains false." + }, + "32768": { + "timed_request_chunk_new_tokens": 32768, + "timed_request_cached_tokens_all_zero": true, + "client_exit": 1, + "scope": "Independent scheduler accounting; startup/health rows of 80 or 1 token are retained separately. Missing HTTP cache counter remains null and generic client qualifier remains false." + }, + "65536": { + "timed_request_chunk_new_tokens": 65536, + "timed_request_cached_tokens_all_zero": true, + "client_exit": 1, + "scope": "Independent scheduler accounting; startup/health rows of 80 or 1 token are retained separately. Missing HTTP cache counter remains null and generic client qualifier remains false." + } + }, + "exl3_admission": [ + { + "process": "0", + "arm": "baseline", + "status": "refused", + "error": "UnexpectedTensor", + "scope": "startup refusal only; no EXL3 inference qualification", + "log_sha256": "e6feb3388f8fde523c4dc572af624f0ade98ba5a08b89cc7e2ac15e60df964cc" + }, + { + "process": "1", + "arm": "candidate", + "status": "refused", + "error": "UnexpectedTensor", + "scope": "startup refusal only; no EXL3 inference qualification", + "log_sha256": "e6feb3388f8fde523c4dc572af624f0ade98ba5a08b89cc7e2ac15e60df964cc" + }, + { + "process": "2", + "arm": "baseline", + "status": "refused", + "error": "UnexpectedTensor", + "scope": "startup refusal only; no EXL3 inference qualification", + "log_sha256": "e6feb3388f8fde523c4dc572af624f0ade98ba5a08b89cc7e2ac15e60df964cc" + }, + { + "process": "3", + "arm": "candidate", + "status": "refused", + "error": "UnexpectedTensor", + "scope": "startup refusal only; no EXL3 inference qualification", + "log_sha256": "e6feb3388f8fde523c4dc572af624f0ade98ba5a08b89cc7e2ac15e60df964cc" + } + ], + "physical_footprints": [ + { + "case": "bf16", + "native_VmHWM_bytes": 6441259008, + "cgroup_memory_peak_bytes": 3113967616 + }, + { + "case": "cold-2048", + "native_VmHWM_bytes": 6436241408, + "cgroup_memory_peak_bytes": 6469681152 + }, + { + "case": "cold-32768", + "native_VmHWM_bytes": 6436474880, + "cgroup_memory_peak_bytes": 6452420608 + }, + { + "case": "cold-65536", + "native_VmHWM_bytes": 6433718272, + "cgroup_memory_peak_bytes": 6447153152 + }, + { + "case": "cold-8192", + "native_VmHWM_bytes": 6433665024, + "cgroup_memory_peak_bytes": 6472241152 + }, + { + "case": "exl3-0-baseline", + "native_VmHWM_bytes": null, + "cgroup_memory_peak_bytes": null + }, + { + "case": "exl3-1-candidate", + "native_VmHWM_bytes": null, + "cgroup_memory_peak_bytes": null + }, + { + "case": "exl3-2-baseline", + "native_VmHWM_bytes": null, + "cgroup_memory_peak_bytes": null + }, + { + "case": "exl3-3-candidate", + "native_VmHWM_bytes": null, + "cgroup_memory_peak_bytes": null + }, + { + "case": "memory-cacheoff", + "native_VmHWM_bytes": 6425047040, + "cgroup_memory_peak_bytes": 6456143872 + }, + { + "case": "memory-large-admission", + "native_VmHWM_bytes": 6423191552, + "cgroup_memory_peak_bytes": 6435307520 + }, + { + "case": "qwen35-mlx4-0-baseline", + "native_VmHWM_bytes": 2207768576, + "cgroup_memory_peak_bytes": 2325073920 + }, + { + "case": "qwen35-mlx4-1-candidate", + "native_VmHWM_bytes": 2217816064, + "cgroup_memory_peak_bytes": 2267201536 + }, + { + "case": "qwen35-mlx4-2-baseline", + "native_VmHWM_bytes": 2209771520, + "cgroup_memory_peak_bytes": 2283630592 + }, + { + "case": "qwen35-mlx4-3-candidate", + "native_VmHWM_bytes": 2211774464, + "cgroup_memory_peak_bytes": 2281840640 + }, + { + "case": "qwen35-modelopt-0-baseline", + "native_VmHWM_bytes": 4098674688, + "cgroup_memory_peak_bytes": 4108357632 + }, + { + "case": "qwen35-modelopt-1-candidate", + "native_VmHWM_bytes": 4085075968, + "cgroup_memory_peak_bytes": 4120010752 + }, + { + "case": "qwen35-modelopt-2-baseline", + "native_VmHWM_bytes": 4085542912, + "cgroup_memory_peak_bytes": 4113936384 + }, + { + "case": "qwen35-modelopt-3-candidate", + "native_VmHWM_bytes": 4092821504, + "cgroup_memory_peak_bytes": 4082470912 + }, + { + "case": "restart", + "native_VmHWM_bytes": 6453903360, + "cgroup_memory_peak_bytes": 6477742080 + }, + { + "case": "retained", + "native_VmHWM_bytes": 6442209280, + "cgroup_memory_peak_bytes": 6467104768 + }, + { + "case": "sglang-cold-2048", + "native_VmHWM_bytes": null, + "cgroup_memory_peak_bytes": 34359738368 + }, + { + "case": "sglang-cold-32768", + "native_VmHWM_bytes": null, + "cgroup_memory_peak_bytes": 6504267776 + }, + { + "case": "sglang-cold-65536", + "native_VmHWM_bytes": null, + "cgroup_memory_peak_bytes": 6507831296 + }, + { + "case": "sglang-cold-8192", + "native_VmHWM_bytes": null, + "cgroup_memory_peak_bytes": 6497947648 + }, + { + "case": "sglang-short", + "native_VmHWM_bytes": null, + "cgroup_memory_peak_bytes": 34359742464 + } + ], + "binary_scope": "Initial binaries are recorded above. The complete CUDA retry runner has its own hash/build identity below after rebuilding auxiliary H3 for all five SMs. Served native binary remains byte-identical; compile-resource file audit binds the original runner.", + "reference_optional_dependencies": { + "submitted_source": "c6f3e221", + "dependencies_present": { + "tests": 3, + "passed": 3, + "skipped": 0, + "device_inference": false + }, + "dependencies_absent": { + "tests": 11, + "passed": 8, + "skipped": 3 + }, + "scope": "Host-only test discovery guard; forward implementation and numerical gates unchanged." + }, + "final_status": { + "completed": true, + "scope": "Complete public-Qwen serving and device evidence; experimental functional-format review only. This is not model-equivalence or performance qualification.", + "source_commit": "b168b36d0cc3503ae69e8bffcad494574019caf5", + "kernel_contract_exit": 0, + "kernel_contract_runner_sha256": "1cec1417c7d6d47ff86cf278dbba47f60267e9f9e4b99ca4d2a7964863555c39", + "strict_served_reference_comparison": "failed; retained under the agreed issue gate", + "performance_qualification": "unqualified; all descriptive measurements retained", + "initial_cuda_attempt": "failed before numerical gates; independently compiled auxiliary GPU image target corrected without changing source or gates" + }, + "failed_attempts": [ + { + "attempt": "initial full CUDA command", + "exit": 1, + "numerical_gates_executed": false, + "reason": "CUDA_ERROR_NO_BINARY_FOR_GPU before numerical tests; independently built auxiliary H3 used the default target because -Dsm was omitted from the plain build. Retry explicitly targets all five SMs; numerical source and gates unchanged.", + "log": "attempts/kernel-contract-auxiliary-target-missing.log" + }, + { + "attempt": "earlier resource records and host assertions", + "result": "failed", + "reason": "Stale NVCC 13.0 resource values and a host test that still expected missing values; retained in attempts. Actual compiles refreshed records without changing launch bounds or numerical gates." + } + ], + "status_definition": "Functional experimental format review only. A failed strict cross-engine comparison is retained under the agreed issue gate; it does not establish model equivalence. Performance remains unqualified.", + "standard_configuration": { + "image": "lmsysorg/sglang@sha256:d6e7288627be8b02be88e4bba38e73f6d50e2826869f753c13a4c4385ab3eda9", + "args": [ + "--model-path", + "/model", + "--served-model-name", + "qwen35-bf16", + "--host", + "0.0.0.0", + "--port", + "8091", + "--dtype", + "bfloat16", + "--kv-cache-dtype", + "bfloat16", + "--mamba-ssm-dtype", + "float32", + "--context-length", + "2080", + "--max-running-requests", + "1", + "--max-total-tokens", + "2080", + "--chunked-prefill-size", + "4096", + "--tp-size", + "1", + "--mem-fraction-static", + "0.85", + "--attention-backend", + "triton", + "--disable-radix-cache", + "--mamba-radix-cache-strategy", + "no_buffer", + "--enable-cache-report", + "--cuda-graph-max-bs-decode", + "1" + ], + "cpu_cores": 4, + "ram_limit_gib": 32, + "shm_gib": 1, + "torch_startup_policy": { + "allow_bf16_reduced_precision_reduction": false, + "allow_fp16_reduced_precision_reduction": false, + "allow_tf32": false, + "mechanism": "PYTHONPATH=/policy/sitecustomize.py, inherited by Python workers" + }, + "scope": "Cold 2048-ID case shown; other context/parallel/total-token values are in the linked asset. Short-run context8192/parallel4/total32768/graph4; cold contextN+32/parallel1/totalN+32/graph1." + }, + "physical_footprint_scope": "Per-process Linux high-water, runtime allocator and container charged-memory peaks have distinct accounting scopes. Separate SGLang per-process peaks are not a summed group peak. Unavailable SGLang device/pinned allocator peaks remain unmeasured. All detailed counters are in the linked asset.", + "source_tree_receipt": "Summary only. Full per-request/capture/benchmark/host/CUDA results and exact arrays are in the checksum-pinned linked assets." +} diff --git a/docs/receipts/qwen35-bf16-scoring/test_reproduce_cache.py b/docs/receipts/qwen35-bf16-scoring/test_reproduce_cache.py new file mode 100644 index 00000000000..5236c7b0409 --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/test_reproduce_cache.py @@ -0,0 +1,46 @@ +"""Cache-only success cannot stand in for full token equality or observed retention.""" +import importlib.util +from pathlib import Path +import unittest + +spec = importlib.util.spec_from_file_location('cache_client', Path(__file__).with_name('reproduce-cache.py')) +client = importlib.util.module_from_spec(spec) +spec.loader.exec_module(client) + + +def row(phase, cached, sha='b' * 64): + state = 'unverified' if cached is None else 'reused' if cached else 'cold' + return {'phase': phase, 'cached_tokens': cached, 'cache_state': state, + 'prompt_tokens': 4122, 'tokens': 8, 'complete': True, + 'output_sha256': 'a' * 64, 'token_sha256': sha} + + +class Exactness(unittest.TestCase): + def test_cache_qualification_cannot_replace_full_token_evidence(self): + rows = [row('first', 0, None), row('repeated', 4096, None)] + self.assertTrue(client.bench_cache.qualify(rows, 4122, True, True)) + self.assertFalse(client.qualified(rows, 4122, True, False)) + + def test_real_reuse_requires_positive_edited_first_counter(self): + self.assertFalse(client.qualified([row('first', 0), row('repeated', 4096)], 4122, True, True)) + self.assertTrue(client.qualified([row('first', 4096), row('repeated', 4096)], 4122, True, True)) + + def test_wrong_hash_and_short_fingerprint_cannot_pass(self): + self.assertFalse(client.qualified([row('first', 0), row('repeated', 4096, 'c' * 64)], 4122, True, False)) + self.assertFalse(client.qualified([row('first', 0, 'b' * 12)], 4122, False, False)) + + def test_fresh_control_rejects_retention(self): + self.assertFalse(client.qualified([row('first', 4096)], 4122, False, False)) + self.assertTrue(client.qualified([row('first', 0)], 4122, False, False)) + + def test_early_completion_is_not_an_eight_token_reply(self): + observed = row('first', 0) + observed['tokens'] = 4 + self.assertFalse(client.qualified([observed], 4122, False, False)) + + def test_unknown_edited_first_counter_is_unverified(self): + self.assertFalse(client.qualified([row('first', None), row('repeated', 4096)], 4122, True, True)) + + +if __name__ == '__main__': + unittest.main() diff --git a/docs/receipts/qwen35-bf16-scoring/transformers-comparison.json b/docs/receipts/qwen35-bf16-scoring/transformers-comparison.json new file mode 100644 index 00000000000..cbc5745b572 --- /dev/null +++ b/docs/receipts/qwen35-bf16-scoring/transformers-comparison.json @@ -0,0 +1,315 @@ +{ + "schema": 2, + "scope": "historical native captures against the earlier auto-dtype reference; superseded for stored-value fidelity", + "complete": true, + "native_comparison": { + "fp32_available": true, + "headline": { + "rows": 18, + "prompt_rows": 6, + "decode_rows": 12, + "max_abs_native_minus_tf_bf16": 0.8304557800292969, + "mean_abs_native_minus_tf_bf16": 0.047856648763020836, + "max_abs_native_minus_tf_fp32": 2.3814449310302734, + "mean_abs_native_minus_tf_fp32": 0.13392225901285806, + "max_abs_tf_bf16_minus_tf_fp32": 1.5509891510009766, + "max_bound": 15.82931025909827, + "max_bound_ratio": 0.16945145241883677, + "all_rows_within_bound": true, + "rows_outside_bound": [], + "max_measured_tf_bf16_minus_tf_fp32": 1.5509891510009766, + "max_tf_bf16_vs_fp32_delta_bound": 1.5519912599534182, + "all_deltas_within_their_bound": true, + "delta_rows_outside_their_bound": [], + "all_rows_within_receipt_style_bound": false, + "receipt_style_rows_outside": [ + 13 + ], + "by_phase": { + "prompt": { + "rows": 6, + "max_abs_native_minus_tf_bf16": 0.8304557800292969, + "max_bound": 14.911864323035335, + "max_bound_ratio": 0.16945145241883677, + "all_within_bound": true, + "max_measured_tf_bf16_minus_tf_fp32": 1.5509891510009766, + "max_abs_native_minus_tf_fp32": 2.3814449310302734, + "max_abs_tf_bf16_minus_tf_fp32": 1.5509891510009766, + "max_tf_bf16_vs_fp32_delta_bound": 1.5519912599534182, + "max_delta_bound_ratio": 0.9993543076057839, + "all_deltas_within_their_bound": true + }, + "decode": { + "rows": 12, + "max_abs_native_minus_tf_bf16": 0.017923355102539062, + "max_bound": 15.82931025909827, + "max_bound_ratio": 0.08519922453662859, + "all_within_bound": true, + "max_measured_tf_bf16_minus_tf_fp32": 0.020626068115234375, + "max_abs_native_minus_tf_fp32": 0.0077800750732421875, + "max_abs_tf_bf16_minus_tf_fp32": 0.020626068115234375, + "max_tf_bf16_vs_fp32_delta_bound": 0.02162716564036888, + "max_delta_bound_ratio": 0.95371110843735, + "all_deltas_within_their_bound": true + } + }, + "fp32_available": true + }, + "rows": [ + { + "capture": 0, + "phase": "prompt", + "fixture": 1, + "position": 30, + "token_id": 321, + "native_logprob": -0.0037326812744140625, + "transformers_bf16_logprob": -0.0037021636962890625, + "transformers_fp32_logprob": -0.0037708282470703125, + "bound_terms": { + "native_vs_fp64_box": 0.0004711123773902811, + "rounding_slack": 6.004779606882948e-08 + } + }, + { + "capture": 0, + "phase": "prompt", + "fixture": 1, + "position": 31, + "token_id": 7890, + "native_logprob": -0.0036869049072265625, + "transformers_bf16_logprob": -0.0035533905029296875, + "transformers_fp32_logprob": -0.0035762786865234375, + "bound_terms": { + "native_vs_fp64_box": 0.0005198102673285347, + "rounding_slack": 6.003620001138188e-08 + } + }, + { + "capture": 1, + "phase": "decode", + "fixture": 1, + "position": 33, + "token_id": 271, + "native_logprob": -0.3671150207519531, + "transformers_bf16_logprob": -0.3638191223144531, + "transformers_fp32_logprob": -0.3717536926269531, + "bound_terms": { + "native_vs_fp64_box": 0.0005649988161208885, + "rounding_slack": 1.0317171472706832e-07 + } + }, + { + "capture": 2, + "phase": "decode", + "fixture": 1, + "position": 34, + "token_id": 248068, + "native_logprob": -0.2910041809082031, + "transformers_bf16_logprob": -0.27308082580566406, + "transformers_fp32_logprob": -0.29370689392089844, + "bound_terms": { + "native_vs_fp64_box": 0.0004999397389879573, + "rounding_slack": 9.322673122369451e-08 + } + }, + { + "capture": 3, + "phase": "decode", + "fixture": 1, + "position": 35, + "token_id": 271, + "native_logprob": -0.5642585754394531, + "transformers_bf16_logprob": -0.5612220764160156, + "transformers_fp32_logprob": -0.5684814453125, + "bound_terms": { + "native_vs_fp64_box": 0.000500198467205109, + "rounding_slack": 1.2668851923081093e-07 + } + }, + { + "capture": 4, + "phase": "decode", + "fixture": 1, + "position": 36, + "token_id": 248069, + "native_logprob": -1.71661376953125e-05, + "transformers_bf16_logprob": -1.9073486328125e-05, + "transformers_fp32_logprob": -1.71661376953125e-05, + "bound_terms": { + "native_vs_fp64_box": 0.0006334390847267063, + "rounding_slack": 5.960680482530734e-08 + } + }, + { + "capture": 5, + "phase": "prompt", + "fixture": 2, + "position": 127, + "token_id": 220, + "native_logprob": -7.2479248046875e-05, + "transformers_bf16_logprob": -7.43865966796875e-05, + "transformers_fp32_logprob": -7.43865966796875e-05, + "bound_terms": { + "native_vs_fp64_box": 0.0005855008841151655, + "rounding_slack": 5.961339866189519e-08 + } + }, + { + "capture": 5, + "phase": "prompt", + "fixture": 2, + "position": 128, + "token_id": 15, + "native_logprob": -0.0004425048828125, + "transformers_bf16_logprob": -0.0005092620849609375, + "transformers_fp32_logprob": -0.000499725341796875, + "bound_terms": { + "native_vs_fp64_box": 0.0005433394865248978, + "rounding_slack": 5.966137450741371e-08 + } + }, + { + "capture": 6, + "phase": "decode", + "fixture": 2, + "position": 130, + "token_id": 220, + "native_logprob": -0.000240325927734375, + "transformers_bf16_logprob": -0.0002269744873046875, + "transformers_fp32_logprob": -0.00020599365234375, + "bound_terms": { + "native_vs_fp64_box": 0.0005188825960463048, + "rounding_slack": 5.963249805063242e-08 + } + }, + { + "capture": 7, + "phase": "decode", + "fixture": 2, + "position": 131, + "token_id": 16, + "native_logprob": -4.57763671875e-05, + "transformers_bf16_logprob": -4.38690185546875e-05, + "transformers_fp32_logprob": -5.14984130859375e-05, + "bound_terms": { + "native_vs_fp64_box": 0.0005097849893889542, + "rounding_slack": 5.960998805676354e-08 + } + }, + { + "capture": 8, + "phase": "decode", + "fixture": 2, + "position": 132, + "token_id": 198, + "native_logprob": -0.000560760498046875, + "transformers_bf16_logprob": -0.0005817413330078125, + "transformers_fp32_logprob": -0.0005588531494140625, + "bound_terms": { + "native_vs_fp64_box": 0.000591440425044383, + "rounding_slack": 5.967274319118587e-08 + } + }, + { + "capture": 9, + "phase": "decode", + "fixture": 2, + "position": 133, + "token_id": 262, + "native_logprob": -8.392333984375e-05, + "transformers_bf16_logprob": -8.58306884765625e-05, + "transformers_fp32_logprob": -8.20159912109375e-05, + "bound_terms": { + "native_vs_fp64_box": 0.000520839231402274, + "rounding_slack": 5.961476290394785e-08 + } + }, + { + "capture": 10, + "phase": "prompt", + "fixture": 3, + "position": 255, + "token_id": 814, + "native_logprob": -6.881475448608398, + "transformers_bf16_logprob": -6.051019668579102, + "transformers_fp32_logprob": -4.500030517578125, + "bound_terms": { + "native_vs_fp64_box": 0.0005152899658687074, + "rounding_slack": 8.304414222948253e-07 + } + }, + { + "capture": 10, + "phase": "prompt", + "fixture": 3, + "position": 256, + "token_id": 20139, + "native_logprob": -0.00370025634765625, + "transformers_bf16_logprob": -0.00067901611328125, + "transformers_fp32_logprob": -0.0011138916015625, + "bound_terms": { + "native_vs_fp64_box": 0.0005714226359110744, + "rounding_slack": 5.986566975479946e-08 + } + }, + { + "capture": 11, + "phase": "decode", + "fixture": 3, + "position": 258, + "token_id": 5979, + "native_logprob": -0.0009613037109375, + "transformers_bf16_logprob": -0.0006618499755859375, + "transformers_fp32_logprob": -0.0008258819580078125, + "bound_terms": { + "native_vs_fp64_box": 0.0005581834893530966, + "rounding_slack": 5.970139227429172e-08 + } + }, + { + "capture": 12, + "phase": "decode", + "fixture": 3, + "position": 259, + "token_id": 44896, + "native_logprob": -0.00078582763671875, + "transformers_bf16_logprob": -0.000896453857421875, + "transformers_fp32_logprob": -0.0030651092529296875, + "bound_terms": { + "native_vs_fp64_box": 0.0005770248218731999, + "rounding_slack": 5.970491656626109e-08 + } + }, + { + "capture": 13, + "phase": "decode", + "fixture": 3, + "position": 260, + "token_id": 5533, + "native_logprob": -0.008687973022460938, + "transformers_bf16_logprob": -0.006145477294921875, + "transformers_fp32_logprob": -0.00090789794921875, + "bound_terms": { + "native_vs_fp64_box": 0.0005525972406551837, + "rounding_slack": 6.048878731235163e-08 + } + }, + { + "capture": 14, + "phase": "decode", + "fixture": 3, + "position": 261, + "token_id": 264, + "native_logprob": -0.00661468505859375, + "transformers_bf16_logprob": -0.007076263427734375, + "transformers_fp32_logprob": -0.002056121826171875, + "bound_terms": { + "native_vs_fp64_box": 0.0004898323789205979, + "rounding_slack": 6.042068889655638e-08 + } + } + ] + }, + "superseded_reason": "Transformers auto-dtype downcast96 storedFP32 A_log/norm tensors. The corrected full reference restores their exact storedFP32 values and covers4097 in both arms.", + "full_payload_sha256": "4427fea8e216dc587b7a8f3870ca1718e98e47e238905303c4d1dd4559426085" +} diff --git a/docs/recipes/README.md b/docs/recipes/README.md index ca20b7fed7b..c1624eb8ba1 100644 --- a/docs/recipes/README.md +++ b/docs/recipes/README.md @@ -15,6 +15,7 @@ For agent-assisted contributions, read the [TensorFold contributor skill](SKILL. | Nemotron 3.5 Super VL | [Native CUDA on one or two GB10s, images](nemotron-3.5-super-vl.md) | | Qwen3.8-27B | [MLX, quantization and CUDA](qwen3.8-27b.md) | | Qwen3-Embedding | [Native Metal](qwen3-embedding-metal.md), [HIP](qwen3-embedding-hip.md) | +| Qwen3.5-27B BF16 | [Native CUDA prompt-scoring candidate](qwen35-bf16-scoring.md) | | Qwen3.5-2B | [Native Metal preview and CUDA, tied affine 4-bit](qwen3.5-2b-native.md) | | Qwen3.8 Flash Next | [MLX prefill and CUDA](qwen3.8-flash-next.md), [native CUDA](flash-next-cuda.md), [native HIP](flash-next-hip.md), [CUDA images](flash-next-vision.md), [exact SSD residency on Metal](fluid-subgraph-residency.md) | | Qwen4 dense | [Native preparation, device qualification pending](qwen4-dense.md) | diff --git a/docs/recipes/cuda.md b/docs/recipes/cuda.md index f9e9f23bc0f..a53cf4b8ebe 100644 --- a/docs/recipes/cuda.md +++ b/docs/recipes/cuda.md @@ -108,6 +108,11 @@ format ([prompt precision](#prompt-precision)): ## Native prompt controls +Qwen dense/MoE, Nemotron ModelOpt and Dory BF16 projections use the shared BF16 prompt tile from 1,024 rows. +`TF_CUDA_PROMPT_BF16=0` restores their lane projections; unset or 1 selects the tile; malformed values are refused by name. +The threshold is fixed. The prompt module always binds its required BF16 symbols, including with the switch off. +Flash Next keeps its own prompt selection and controls. + For Nemotron, the native `tensorfold run` command on a CUDA build accepts `--device N` to choose a CUDA ordinal. If the flag is absent, it uses `TF_CUDA_DEVICE`, then device 0. `--segments N` enables staggered prompt work for 1 through 4 whole 2,048-row chunks; without the flag it diff --git a/docs/recipes/qwen35-bf16-scoring.md b/docs/recipes/qwen35-bf16-scoring.md new file mode 100644 index 00000000000..149ced17f40 --- /dev/null +++ b/docs/recipes/qwen35-bf16-scoring.md @@ -0,0 +1,104 @@ +# Qwen3.5-27B: plain BF16 CUDA prompt scores + +This candidate adds a dense, unquantized BF16 format to the existing native Qwen3.5 CUDA engine. +It serves nonstreamed `/v1/completions` requests with `prompt_logprobs: 0..20` through the normal lane scheduler. +It does not introduce a separate inference worker. This remains an experimental text/scoring format. +The [qualification receipt](../receipts/qwen35-bf16-scoring/README.md) retains API, FP64, complete CUDA, +served/cold, cache/cancellation, existing-format and memory results. The complete sm_120 CUDA run passes +with six unchanged known findings and zero launch-limit problems. BF16 prefill and concurrency remain limiting; +model equivalence, production and performance qualification are not established. + +## Checkpoint and precision + +Use `Qwen/Qwen3.5-27B` at revision `fc05daec18b0a78c049392ed2e771dde82bdf654`, including its tokenizer. +Weights stay in their stored format: BF16 projections and embeddings, and the checkpoint's FP32 GDN normalization scales. +The loader applies the existing host-side, BF16-rounded shifted-norm convention to the HF shifted norms. + +Activations and ordinary generation logits retain the engine's BF16 interfaces. Dense dots use the existing fixed-order +FP32 accumulator. The scoring head uses the same row arithmetic with FP32 output, followed by a full-vocabulary FP32 +normalizer, selected-token logit, rank and at most 20 top entries. Row arithmetic is independent of batch width. +The FP32 scoring head does not change the ordinary generation/sampling head's output type. + +FP32 GDN scales use the existing shared FP32-weight RMS operator and BF16 SiLU product. They cannot enter a fused +post operator that expects BF16 weights. Existing quantized formats keep their original operators and admission. +Vision, int8 prompt precision and learning are explicitly refused for the new BF16 format pending separate qualification. +The checkpoint's declared vision tower is not evidence that this text-only path supports images. + +## Build and run + +Use the exact Zig version in `.zig-version`. On an authorized CUDA machine, generate the maintained asset set and build: + +```sh +zig build fatbins kernel-contract-fatbins -Dnvcc=/usr/local/cuda/bin/nvcc -Dsm=80,86,89,120,121 +zig build -Dnvcc=/usr/local/cuda/bin/nvcc -Dsm=80,86,89,120,121 -Dfatbins=zig-out/fatbin -Dcontract-controls=zig-out/fatbin/contract_controls.fatbin -Doptimize=ReleaseFast +zig build native qwen35-score-reference -Dnvcc=/usr/local/cuda/bin/nvcc -Dsm=80,86,89,120,121 -Dfatbins=zig-out/fatbin -Doptimize=ReleaseFast +``` + +Use the native binary's `serve --help` for startup flags. Keep the listener on loopback and run under the existing GPU +lock and admission guard, with one model process per test machine. For cache-off checks use `--prompt-cache-gib 0`. +A `prompt_logprobs` request intentionally recomputes the full prompt and reports zero reused prefix tokens. +The first prompt entry is null; each later entry scores that token from its preceding normalized hidden row. +The 43-word GPU output layout is per row; it remains disjoint at rows 4, 5 and 128. + +## Reproduce the checks + +The standard clients remain the performance and ordinary-token checks: + +```sh +python3 tools/bench_openai.py http://127.0.0.1:8080 local-model --tokens 128 --reps 3 --temperatures 0 --output decode.json +python3 tools/bench_concurrent.py http://127.0.0.1:8080 local-model --tokens 128 --reps 3 --temperatures 0,0.7 --levels 1,4 --alone --serial --output concurrent.json +python3 tools/zig/check_qwen35_prompt_scores.py http://127.0.0.1:8080 local-model fixtures.json --output scores.json +zig-out/bin/tf-cuda-test kernel-contract +zig-out/bin/tf-cuda-test kernel-contract-limits zig-out/fatbin +``` + +`fixtures.json` is an array of public-tokenizer token arrays. Retain its exact bytes and hash with the result. +Use lengths 1, 32, 129, 257 and 4097 for empty-score, batch-boundary and prompt-chunk-seam coverage. +The score client checks drafted/plain tokens, repeatability, concurrent/solo FP32 score hashes, top-k admission and +recovery after refused requests. Its throughput fields describe that scoring workload, not an ordinary decode benchmark. + +The finite capture tool runs production forwards and records normalized BF16 input rows, FP32 head logits and raw stats. +It is a qualification tool, not a server or an alternative inference runtime: + +```sh +zig-out/bin/tf-qwen35-score-reference MODEL reference-fixtures.json captures +python3 tools/zig/qwen35_scores_fp64.py MODEL captures --revision fc05daec18b0a78c049392ed2e771dde82bdf654 --output fp64.json +``` + +The independent reference reads the same stored BF16 weights and computes FP64 head dots and full-vocabulary +logsumexp on identical native normalized rows. It reports prompt and decode separately, worst row/token errors, +bound ratios, exact selected/top/rank fields, and argmax differences with FP64 margins. This is not a full-model FP64 +forward. Additional projection captures exercise each named checkpoint matrix with deterministic synthetic BF16 inputs; +they do not claim that every layer's intermediate activation matches a separate model implementation. + +The head bound uses `gamma(ceil(hidden/2048)*8+13) * sum(abs(x*w))` plus output rounding. The reduction bound uses +`ceil(vocab/256)+8` depth and 12 post-reduction operations. Logprob bounds include per-token and row-max head errors, +reduction error and FP32 subtraction rounding. The script records the formulas and every capture's result. +The stats stress fixture requires both smaller accumulators to miss by at least 100x in all three simulated orders. +Both the omitted-vocabulary-tail and FP16-head-accumulator GPU controls must fail their intended gates. + +## Qualification scope + +The initial device is one RTX PRO 6000 Blackwell Max-Q workstation GPU (sm_120), rank 1, on a 128 GB-class Linux host. +A four-CPU/32 GiB container budget is not evidence of fit on a physical 32 GiB machine. +Compiled images for sm_80/86/89/120/121 do not qualify execution on those other devices. +Metal, HIP, XPU, multiple ranks, image inputs, int8 prompts and learning remain unqualified for this new format. +The receipt retains matched MLX/Qwen3.5 and ModelOpt/Qwen3.8 parent/candidate tokens and descriptive performance. +The public EXL3 export is rejected by both builds because its embeddings are F16; EXL3 inference is unqualified. +FP8 KV and optional grammar/tool generation are also unqualified for this new format. + +The receipt binds exact source/binary identities, complete CUDA SUMMARY and exit status, live and five-SM compile +checks, host/plain builds, zero-new lean findings, public fixture hashes, FP64 reports and served measurements. +Cold 2k/8k/32k/64k arrays and requests are retained. Memory separates Linux RSS, container budgets, CUDA-owned peaks +and sampled pinned maxima. SGLang HTTP cache counters are absent; observed scheduler counts remain separate evidence. + +The [issue gate](https://github.com/ashhart/TensorFold/issues/1136#issuecomment-6553918935) requires same-weight FP64 +worst-row/token evidence and unchanged existing formats; it explicitly allows the other-engine comparison to fail. +The actual served-versus-Transformers experiment reports both measured BF16/FP32 directions without widening a tolerance. +Both precision arms cover the 4097-ID seam, and the reference restores all 96 original FP32 GDN/A_log parameters. +This experimental format's functional review does not establish model equivalence or performance qualification: +BF16 prefill and multi-stream throughput remain slow. Read the current receipt's results and limitations. + +```sh +python3 tools/zig/check_qwen35_served_reference.py http://127.0.0.1:8091 qwen35-bf16 fixtures.json transformers.json --output served-reference.json +``` diff --git a/tools/zig/check_qwen35_prompt_scores.py b/tools/zig/check_qwen35_prompt_scores.py new file mode 100644 index 00000000000..be2320c23b5 --- /dev/null +++ b/tools/zig/check_qwen35_prompt_scores.py @@ -0,0 +1,119 @@ +"""Exercise native prompt_logprobs: solo/concurrent bits, drafted/plain replies, admission and recovery.""" +import argparse +from concurrent.futures import ThreadPoolExecutor +import hashlib +import json +import math +from pathlib import Path +import struct +import time +import urllib.error +import urllib.request + + +def digest_rows(rows): + h = hashlib.sha256() + for row in rows[1:]: + for key, cell in sorted(row.items(), key=lambda item: int(item[0])): + if not math.isfinite(cell["logprob"]): + raise ValueError("nonfinite_prompt_logprob") + h.update(struct.pack(" y for x, y in zip(a, b)), + 'worst_native_row': i // hidden, 'worst_native_column': i % hidden, + 'native_at_worst': native[i], 'fp32_at_worst': fp32[i], 'bf16_at_worst': bf16[i], + 'within_bf16_max_distance': maximum <= own} + + +def compare(native_dir, reference_dir): + native_dir, reference_dir = Path(native_dir), Path(reference_dir) + nm = json.loads((native_dir / 'meta.json').read_text()) + tm = json.loads((reference_dir / 'meta.json').read_text()) + for key in ('rows', 'hidden', 'layers', 'boundaries'): + if type(nm[key]) is not int or nm[key] <= 0 or nm[key] != tm[key]: + raise ValueError('inconsistent capture metadata: ' + key) + if nm['boundaries'] != nm['layers'] + 2 or not nm.get('trace_plain_logits_equal'): + raise ValueError('incomplete or perturbing native trace') + count = nm['rows'] * nm['hidden'] + result, all_rows, tensors = [], [], [] + scored_rows = nm["rows"] - 1 + if scored_rows < 1: + raise ValueError("fixture needs a scored row") + for i in range(nm['boundaries']): + paths = [(native_dir / ('%d.bf16' % i), 'bf16'), + (reference_dir / 'bf16' / ('%d.f32' % i), 'f32'), + (reference_dir / 'fp32' / ('%d.f32' % i), 'f32')] + values = [] + for path, dtype in paths: + values.append(read_values(path, dtype, count)) + tensors.append({'boundary': i, 'arm': ('native' if dtype == 'bf16' else path.parent.name), + 'bytes': path.stat().st_size, 'sha256': hashlib.sha256(path.read_bytes()).hexdigest()}) + full = distance(*values, nm['hidden']) + row = distance(*(v[:scored_rows * nm['hidden']] for v in values), nm['hidden']) + row.update(boundary=i, layer=i-1 if 0 < i <= nm['layers'] else None, + kind='embedding' if i == 0 else 'final_norm' if i > nm['layers'] else 'residual') + full.update(boundary=i, layer=row["layer"], kind=row["kind"]) + all_rows.append(full) + result.append(row) + failures = [r for r in result if not r['within_bf16_max_distance']] + first_layer = next((r['layer'] for r in failures if r['kind'] == 'residual'), None) + return {'rule': 'per boundary, max |native-FP32| <= max |Transformers BF16-FP32|; no added tolerance', + 'status': 'failed' if failures else 'passed', 'first_exceeding_layer_zero_based': first_layer, + 'shape': {k: nm[k] for k in ('rows', 'hidden', 'layers', 'boundaries')}, + 'compared_rows': scored_rows, 'row_scope': 'hidden rows 0..N-2 predict the served prompt IDs 1..N-1', + 'all_input_rows_boundaries': all_rows, + 'boundaries': result, 'tensors': tensors} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--native', required=True) + parser.add_argument('--reference', required=True) + parser.add_argument('--output', required=True) + args = parser.parse_args() + result = compare(args.native, args.reference) + Path(args.output).write_text(json.dumps(result, indent=2, allow_nan=False) + '\n') + print(json.dumps({k: result[k] for k in ('status', 'first_exceeding_layer_zero_based')})) + return 0 if result['status'] == 'passed' else 1 + + +if __name__ == '__main__': + raise SystemExit(main()) diff --git a/tools/zig/qwen35_layer_reference.py b/tools/zig/qwen35_layer_reference.py new file mode 100644 index 00000000000..aa14f7dedb9 --- /dev/null +++ b/tools/zig/qwen35_layer_reference.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 +"""Capture Transformers residuals for the finite public CUDA layer diagnostic.""" +from __future__ import annotations + +import argparse +import hashlib +import json +import platform +from pathlib import Path + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--model', required=True) + parser.add_argument('--ids', required=True) + parser.add_argument('--output', required=True) + args = parser.parse_args() + import torch + import transformers + from qwen35_reference_forward import library_forward, load_model, manual_forward, model_load_report + + torch.set_grad_enabled(False) + ids_bytes = Path(args.ids).read_bytes() + ids = json.loads(ids_bytes) + if not isinstance(ids, list) or not 2 <= len(ids) <= 4096: + raise ValueError('expected one finite fixture of token IDs') + if any(type(i) is not int or i < 0 for i in ids): + raise ValueError('invalid token ID') + out = Path(args.output) + out.mkdir(parents=True, exist_ok=True) + if list(out.iterdir()): + raise ValueError('reference output must be empty') + model, loading = load_model(args.model) + inputs = torch.tensor([ids], dtype=torch.long) + layers = model.model.language_model.config.num_hidden_layers + hidden = model.model.language_model.config.hidden_size + reports = {} + for arm in ('bf16', 'fp32'): + dest = out / arm + dest.mkdir() + seen = [] + + def capture(index, value): + if index != len(seen) or list(value.shape) != [1, len(ids), hidden]: + raise ValueError('incomplete or inconsistent reference boundary') + if not torch.isfinite(value).all(): + raise ValueError('nonfinite reference') + data = value.detach().float().cpu().contiguous().numpy().astype(' fixture / position resolution ------------------------ + capture_map = build_capture_map(fixtures, cont, captures_selected) + for item in capture_map: + c = [x for x in captures_selected if x.index == item["capture"]][0] + item["x2_rows"] = [torch.from_numpy(c.hidden_f32[j]) for j in range(c.rows)] + tf_hidden = {fi: tf_cache[fi]["h_bf16"] for fi in tf_cache if "h_bf16" in tf_cache[fi]} + prompt_len = {fi: tf_cache[fi]["prompt_len"] for fi in tf_hidden} + resolved = resolve_capture_map(capture_map, tf_hidden, prompt_len) + + # ---- flatten to one row per captured scored position ----------------- + flat = [] + for item in resolved: + c = [x for x in captures_selected if x.index == item["capture"]][0] + cache = tf_cache[item["fixture"]] + for j in range(c.rows): + p = int(item["positions"][j]) + pick = int(c.picks[j]) + if p < 1 or p >= len(cache["ext_ids"]): + raise RuntimeError("position %d outside extended ids for capture %d" + % (p, c.index)) + if int(cache["ext_ids"][p]) != pick: + raise RuntimeError("fixture %d position %d token %d != pick %d" + % (item["fixture"], p, int(cache["ext_ids"][p]), pick)) + flat.append({"capture": c.index, "phase": c.phase, "row_in_capture": j, + "fixture": item["fixture"], "position": p, "hidden_index": p - 1, + "token_id": pick, + "x2": torch.from_numpy(c.hidden_f32[j]), + "native_logits": torch.from_numpy(c.logits_f32[j]), + "native_lse": float(c.lse[j]), + "hidden_distance": float(item["match_distance"])}) + if not flat: + raise RuntimeError("no native logprob rows could be resolved to a fixture position") + log("native comparison rows: %d (prompt %d, decode %d)" % ( + len(flat), sum(1 for r in flat if r["phase"] == "prompt"), + sum(1 for r in flat if r["phase"] == "decode"))) + + # ---- transformers rows, scored from the cached hidden states --------- + hidden_bf16 = torch.stack([tf_cache[r["fixture"]]["h_bf16"][r["hidden_index"]] for r in flat]) + hidden_bf16 = hidden_bf16.float() + logits_bf16 = head_logits(hidden_bf16, W, args.head_vocab_chunk) + lse_bf16 = torch.logsumexp(logits_bf16, dim=-1) + fp32_available = all(tf_cache[r["fixture"]].get("h_fp32") is not None for r in flat) + hidden_fp32 = logits_fp32 = lse_fp32 = None + if fp32_available: + hidden_fp32 = torch.stack([tf_cache[r["fixture"]]["h_fp32"][r["hidden_index"]] + for r in flat]).float() + logits_fp32 = head_logits(hidden_fp32, W, args.head_vocab_chunk) + lse_fp32 = torch.logsumexp(logits_fp32, dim=-1) + + native_hidden = torch.stack([r["x2"] for r in flat]).float() + native_logits = torch.stack([r["native_logits"] for r in flat]).float() + native_lse = torch.tensor([r["native_lse"] for r in flat], dtype=torch.float32) + picks = [r["token_id"] for r in flat] + pick_t = torch.tensor(picks, dtype=torch.long) + row_ids = torch.arange(len(flat)) + + prof_x2 = bound_profile(native_hidden, native_logits, native_lse, picks, W, + chunk=args.head_vocab_chunk) + prof_x3 = bound_profile(hidden_bf16, logits_bf16, lse_bf16, picks, W, + chunk=args.head_vocab_chunk) + prof_x3p = None + if fp32_available: + prof_x3p = bound_profile(hidden_fp32, logits_fp32, lse_fp32, picks, W, + chunk=args.head_vocab_chunk) + + # ---- float64 hidden-distance terms ----------------------------------- + def delta_head_logits(xa, xb): + d = xb.to(torch.float64) - xa.to(torch.float64) + out = torch.empty((d.shape[0], V), dtype=torch.float64) + for lo in range(0, V, args.head_vocab_chunk): + hi = min(V, lo + args.head_vocab_chunk) + out[:, lo:hi] = d @ W[lo:hi].to(torch.float64).T + return out + + d_native_bf16 = delta_head_logits(native_hidden, hidden_bf16) + d_native_bf16_pick = d_native_bf16.gather(1, pick_t[:, None]).squeeze(1).abs() + d_native_bf16_rowmax = d_native_bf16.abs().amax(dim=1) + d_pick = d_native_bf16_pick.cpu().tolist() + d_rowmax = d_native_bf16_rowmax.cpu().tolist() + hidden_l2 = ((hidden_bf16.to(torch.float64) - native_hidden.to(torch.float64)) ** 2).sum(1).sqrt() + hidden_l2 = hidden_l2.cpu().tolist() + hidden_max_abs = (hidden_bf16.float() - native_hidden).abs().amax(dim=1).cpu().tolist() + del d_native_bf16 + if fp32_available: + d_bf16_fp32 = delta_head_logits(hidden_bf16, hidden_fp32) + d32_pick = d_bf16_fp32.gather(1, pick_t[:, None]).squeeze(1).abs() + d32_rowmax = d_bf16_fp32.abs().amax(dim=1) + d32 = d32_pick.cpu().tolist() + d32_row = d32_rowmax.cpu().tolist() + del d_bf16_fp32 + else: + d32 = [None] * len(flat) + d32_row = [None] * len(flat) + + # ---- reported arm logprobs (float32 arithmetic, as scored) ---------- + def lp_f32(logits, lse): + return (logits.gather(1, pick_t[:, None]).squeeze(1) - lse).cpu().tolist() + + lp_native = lp_f32(native_logits, native_lse) + lp_bf16 = lp_f32(logits_bf16, lse_bf16) + lp_32 = lp_f32(logits_fp32, lse_fp32) if fp32_available else [None] * len(flat) + lp_ref_native = prof_x2["pick_ref_lp"].tolist() + lp_ref_bf16 = prof_x3["pick_ref_lp"].tolist() + lp_ref_32 = prof_x3p["pick_ref_lp"].tolist() if prof_x3p is not None else [None] * len(flat) + a_box = prof_x2["pick_lp_bound"].tolist() + c_box = prof_x3["pick_lp_bound"].tolist() + c_p_box = prof_x3p["pick_lp_bound"].tolist() if prof_x3p is not None else [None] * len(flat) + native_argmax = prof_x2["clone_checks"]["argmax"] + bf16_argmax = prof_x3["clone_checks"]["argmax"] + fp32_argmax = prof_x3p["clone_checks"]["argmax"] if prof_x3p is not None else [None] * len(flat) + native_rank = prof_x2["clone_checks"]["rank"] + bf16_rank = prof_x3["clone_checks"]["rank"] + fp32_rank = prof_x3p["clone_checks"]["rank"] if prof_x3p is not None else [None] * len(flat) + + out_rows = [] + for i, r in enumerate(flat): + t = picks[i] + obs = abs(lp_native[i] - lp_bf16[i]) + # Compare the picked-token distance and its corresponding FP64 reference distance. + b3p = abs(lp_ref_bf16[i] - lp_ref_32[i]) if fp32_available else None + D = abs(lp_bf16[i] - lp_32[i]) if fp32_available else None + slack = U * (abs(lp_native[i]) + abs(lp_bf16[i]) + 1.0) + 4 * TWO_M150 + rigorous = a_box[i] + c_box[i] + d_pick[i] + d_rowmax[i] + slack + receipt = (a_box[i] + D + slack) if fp32_available else None + d_bound = (c_box[i] + b3p + c_p_box[i] + slack) if fp32_available else None + row = { + "capture": r["capture"], "phase": r["phase"], "row_in_capture": r["row_in_capture"], + "fixture": r["fixture"], "fixture_length": tf_cache[r["fixture"]]["prompt_len"], + "position": r["position"], "hidden_index": r["hidden_index"], "token_id": t, + "native_logprob": lp_native[i], + "native_logprob_fp64_evaluated": lp_ref_native[i], + "transformers_bf16_logprob": lp_bf16[i], + "transformers_bf16_logprob_fp64_evaluated": lp_ref_bf16[i], + "transformers_fp32_logprob": lp_32[i], + "transformers_fp32_logprob_fp64_evaluated": lp_ref_32[i], + "native_argmax": native_argmax[i], + "transformers_bf16_argmax": bf16_argmax[i], + "transformers_fp32_argmax": fp32_argmax[i], + "native_argmax_matches_pick": bool(native_argmax[i] == t), + "transformers_bf16_argmax_matches_pick": bool(bf16_argmax[i] == t), + "native_rank": native_rank[i], + "transformers_bf16_rank": bf16_rank[i], + "transformers_fp32_rank": fp32_rank[i], + "abs_native_minus_tf_bf16": obs, + "abs_native_minus_tf_fp32": (abs(lp_native[i] - lp_32[i]) + if fp32_available else None), + "measured_tf_bf16_minus_tf_fp32": D, + "bound_terms": { + "native_vs_fp64_box": a_box[i], + "tf_bf16_vs_fp64_box": c_box[i], + "tf_fp32_vs_fp64_box": c_p_box[i], + "hidden_bf16_vs_native_at_pick": d_pick[i], + "hidden_bf16_vs_native_row_max": d_rowmax[i], + "rounding_slack": slack, + "rigorous_sum": rigorous, + "receipt_style_sum": receipt, + }, + "bound": rigorous, + "abs_within_bound": bool(obs <= rigorous), + "bound_ratio": obs / rigorous if rigorous else None, + "receipt_style_bound": receipt, + "abs_within_receipt_style_bound": (bool(obs <= receipt) if receipt is not None else None), + "receipt_style_ratio": (obs / receipt if receipt else None), + "tf_bf16_vs_fp32_delta_bound": d_bound, + "measured_delta_within_bound": (bool(D <= d_bound) if d_bound is not None else None), + "delta_bound_ratio": (D / d_bound if d_bound else None), + "hidden_l2_distance": hidden_l2[i], + "hidden_max_abs_distance": hidden_max_abs[i], + "hidden_distance_delta_head_at_pick_fp64": d32[i], + "hidden_distance_delta_head_row_max_fp64": d32_row[i], + } + out_rows.append(row) + + # ---- headline -------------------------------------------------------- + fails = [i for i, r in enumerate(out_rows) if not r["abs_within_bound"]] + ratios = [r["bound_ratio"] for r in out_rows if r["bound_ratio"] is not None] + receipt_fails = [i for i, r in enumerate(out_rows) + if r["abs_within_receipt_style_bound"] is False] + d_fails = [i for i, r in enumerate(out_rows) if r["measured_delta_within_bound"] is False] + offs = [r["abs_native_minus_tf_bf16"] for r in out_rows] + max_ratio = max(ratios) if ratios else None + + def phase_summary(rows): + if not rows: + return None + r_ratios = [r["bound_ratio"] for r in rows if r["bound_ratio"] is not None] + d_ratios = [r["delta_bound_ratio"] for r in rows if r["delta_bound_ratio"] is not None] + return { + "rows": len(rows), + "max_abs_native_minus_tf_bf16": max(r["abs_native_minus_tf_bf16"] for r in rows), + "max_bound": max(r["bound"] for r in rows), + "max_bound_ratio": max(r_ratios) if r_ratios else None, + "all_within_bound": all(r["abs_within_bound"] for r in rows), + "max_measured_tf_bf16_minus_tf_fp32": max( + (r["measured_tf_bf16_minus_tf_fp32"] for r in rows + if r["measured_tf_bf16_minus_tf_fp32"] is not None), default=None), + "max_abs_native_minus_tf_fp32": max( + (r["abs_native_minus_tf_fp32"] for r in rows + if r["abs_native_minus_tf_fp32"] is not None), default=None), + "max_abs_tf_bf16_minus_tf_fp32": max( + (r["measured_tf_bf16_minus_tf_fp32"] for r in rows + if r["measured_tf_bf16_minus_tf_fp32"] is not None), default=None), + "max_tf_bf16_vs_fp32_delta_bound": max( + (r["tf_bf16_vs_fp32_delta_bound"] for r in rows + if r["tf_bf16_vs_fp32_delta_bound"] is not None), default=None), + "max_delta_bound_ratio": max(d_ratios) if d_ratios else None, + "all_deltas_within_their_bound": all( + r["measured_delta_within_bound"] is not False for r in rows), + } + + by_phase = {ph: phase_summary([r for r in out_rows if r["phase"] == ph]) + for ph in ("prompt", "decode")} + + bound_statement = ( + "For every captured row (picked token t) the bound reported here is: " + "|native_logprob - transformers_bf16_logprob| <= " + "native_vs_fp64_box + tf_bf16_vs_fp64_box + |(x_bf16 - x_native) @ W_t| + " + "max_v |(x_bf16 - x_native) @ W_v| + rounding_slack. " + "The two boxes are the same boxed FP64 formulas recorded in the FP64 reference " + "(gamma-series head bound with accumulation depth ceil(H/2048)*8+13, row-max head bound, " + "logsumexp/reduction bound with depth ceil(V/256)+8, and the final FP32 subtraction " + "rounding); they are recomputed here for each arm's own float32 logits. The two " + "hidden-distance terms are the float64 lm_head product of the difference between the " + "transformers BF16 normalized hidden row and the native captured one; they bridge the " + "fact that the two arms are not evaluated on identical hidden states. All %d rows " + "satisfy this bound (max ratio %.6g)." % (len(out_rows), max_ratio)) + + receipt_style_max_ratio = max( + (r["receipt_style_ratio"] for r in out_rows + if r["receipt_style_ratio"] is not None), default=None) + delta_max_ratio = max((r["delta_bound_ratio"] for r in out_rows + if r["delta_bound_ratio"] is not None), default=None) + if receipt_fails: + receipt_verdict = ( + "The receipt-style decomposition " + "|native - transformers_bf16| <= (native vs FP64 bound at the picked token) + " + "(measured |transformers_bf16 - transformers_fp32| at the picked token) + " + "rounding slack does NOT hold on %d of %d rows %s (largest receipt-style ratio " + "%.6g). On those rows the native and transformers BF16 hidden trajectories have " + "separated far enough (see hidden_l2_distance) that the native-vs-FP64 box alone no " + "longer covers the distance; it is a diagnostic decomposition whose middle term is a " + "measured difference, not a bound, so the rigorous two-box-plus-hidden-distance " + "statement above is the valid one." + % (len(receipt_fails), len(out_rows), receipt_fails, receipt_style_max_ratio)) + else: + receipt_verdict = ( + "The receipt-style decomposition " + "|native - transformers_bf16| <= (native vs FP64 bound at the picked token) + " + "(measured |transformers_bf16 - transformers_fp32| at the picked token) + " + "rounding slack holds on all %d rows (largest receipt-style ratio %.6g). It is still " + "a diagnostic decomposition, not a proof: the middle term is a measured difference, " + "not a bound. The rigorous statement is the two-box-plus-hidden-distance one above." + % (len(out_rows), receipt_style_max_ratio)) + receipt_statement = receipt_verdict + ( + " Separately, the measured BF16-vs-FP32 logprob difference is itself within its own " + "boxed bound on all rows (max delta-bound ratio %.6g)." % delta_max_ratio) + + capture_mapping_statement = ( + "Captured rows are mapped to fixture positions by the capture tool's own rule, not by a " + "nearest-hidden search. qwen35_score_reference.zig forwards each captured fixture as one " + "prompt chunk and captures the last min(scored, 2) scored prompt rows, i.e. positions " + "[L-2, L-1] (hidden rows [L-3, L-2]), followed by four one-row decode captures at " + "positions [L+1, L+4] (hidden rows [L, L+3]). Every mapping here is verified by an exact " + "match of the captured picks against ids[L-2:L] and against the four served greedy " + "continuation tokens. The recorded hidden distances explain why a nearest search is not " + "used: fixture 3 repeats its last two tokens at 16 positions and the two serves' BF16 " + "hidden rows diverge there, so the nearest decoy can be far from the true row.") + + recomputed = [] + for c in captures_selected: + prof = dict(native_profiles[c.index]) + prof["capture_name"] = "%d-meta.json" % c.index + prof["phase"] = c.phase + prof["rows"] = c.rows + recomputed.append(prof) + + payload = { + "method": "native captured float32 logits vs a transformers forward of the pinned " + "checkpoint, both compared through the boxed FP64 reference; logprobs are " + "logit - logsumexp(logits) over the full vocabulary in float32", + "rows": out_rows, + "row_count": len(out_rows), + "capture_resolution": [{"capture": it["capture"], "phase": it["phase"], + "rows": it["rows"], "picks": it["picks"], + "fixture": it["fixture"], + "fixture_length": it["candidates"][0]["length"], + "positions": it["positions"], + "hidden_index": it["hidden_index"], + "hidden_distance_l2": it["hidden_distance_l2"], + "hidden_distance_max_abs": it["hidden_distance_max_abs"], + "match_distance": it["match_distance"], + "resolution_basis": it["resolution_basis"], + "candidate_count": len(it["candidates"]), + "candidates": it["candidates"]} + for it in resolved], + "native_metric_recomputation": compare_fp64_records(fp64, recomputed), + "bound_statement": bound_statement, + "capture_mapping_statement": capture_mapping_statement, + "receipt_form_statement": receipt_statement, + "fp32_available": bool(fp32_available), + "fp32_unavailable_reason": None if fp32_available else ( + "no FP32 arm was run for fixture(s) %s (4097-token policy), so no measured " + "BF16-vs-FP32 delta exists for the captured rows that resolve there" + % sorted(set(r["fixture"] for r in flat if tf_cache[r["fixture"]].get("h_fp32") is None))), + "headline": { + "rows": len(out_rows), + "prompt_rows": sum(1 for r in out_rows if r["phase"] == "prompt"), + "decode_rows": sum(1 for r in out_rows if r["phase"] == "decode"), + "max_abs_native_minus_tf_bf16": max(offs) if offs else None, + "mean_abs_native_minus_tf_bf16": (float(sum(offs) / len(offs)) if offs else None), + "max_abs_native_minus_tf_fp32": max( + (r["abs_native_minus_tf_fp32"] for r in out_rows + if r["abs_native_minus_tf_fp32"] is not None), default=None), + "mean_abs_native_minus_tf_fp32": ( + float(sum(r["abs_native_minus_tf_fp32"] for r in out_rows + if r["abs_native_minus_tf_fp32"] is not None)) + / max(1, sum(1 for r in out_rows if r["abs_native_minus_tf_fp32"] is not None))), + "max_abs_tf_bf16_minus_tf_fp32": max( + (r["measured_tf_bf16_minus_tf_fp32"] for r in out_rows + if r["measured_tf_bf16_minus_tf_fp32"] is not None), default=None), + "max_bound": max(r["bound"] for r in out_rows), + "max_bound_ratio": max_ratio, + "all_rows_within_bound": not fails, + "rows_outside_bound": fails, + "max_measured_tf_bf16_minus_tf_fp32": max( + (r["measured_tf_bf16_minus_tf_fp32"] for r in out_rows + if r["measured_tf_bf16_minus_tf_fp32"] is not None), default=None), + "max_tf_bf16_vs_fp32_delta_bound": max( + (r["tf_bf16_vs_fp32_delta_bound"] for r in out_rows + if r["tf_bf16_vs_fp32_delta_bound"] is not None), default=None), + "all_deltas_within_their_bound": not d_fails, + "delta_rows_outside_their_bound": d_fails, + "all_rows_within_receipt_style_bound": not receipt_fails, + "receipt_style_rows_outside": receipt_fails, + "by_phase": by_phase, + "fp32_available": bool(fp32_available), + }, + } + if fails: + log("B: %d rows outside the rigorous bound: %s" % (len(fails), fails)) + if d_fails: + log("B: %d measured deltas outside their own bound: %s" % (len(d_fails), d_fails)) + return payload diff --git a/tools/zig/qwen35_reference_fixture.py b/tools/zig/qwen35_reference_fixture.py new file mode 100644 index 00000000000..62dcc0c105c --- /dev/null +++ b/tools/zig/qwen35_reference_fixture.py @@ -0,0 +1,281 @@ +#!/usr/bin/env python3 +"""Public Qwen BF16 reference: fixture.""" +from __future__ import annotations + +from datetime import datetime, timezone +import hashlib +import json +import os +import torch +from qwen35_reference_inputs import ( + log, + peak_rss_gb, + tensor_bytes_hash, +) +from qwen35_reference_forward import ( + head_logits, + library_forward, + manual_forward, + score_rows, +) + +def run_fixture(model, fixture_index, ids, cont, args, tf_cache, verify_layers): + L = len(ids) + if args.skip_long and L > 1024: + log("fixture %d: length %d skipped by --skip-long" % (fixture_index, L)) + return {"index": fixture_index, "length": L, "skipped": True, + "ids_sha256": hashlib.sha256(json.dumps(list(ids)).encode()).hexdigest(), + "reason": "--skip-long: %d-token fixture not measured in this run" % L, + "bf16": {"rows": []}, "fp32": {"skipped": True}, + "delta": {"stats": {}, "rows": []}} + # Teacher-force the same five continuation tokens; short fixtures verify prompt invariance. + ext = list(ids) + list(cont.get(fixture_index, [])[:5]) + log("fixture %d: prompt length %d, forward length %d (prompt + 5 served continuation tokens)" % ( + fixture_index, L, len(ext))) + t0 = datetime.now(timezone.utc) + ids_t = torch.tensor(ext, dtype=torch.long) + prompt_positions = list(range(1, L)) + W = model.lm_head.weight + + # --- BF16 arm --------------------------------------------------------- + h_bf16, st_bf16 = manual_forward(model, ids_t.view(1, -1), upcast=False) + h_bf16 = h_bf16[0] + rows_bf16, score_info_bf16 = score_rows( + W, h_bf16, ids_t, prompt_positions, + row_chunk=args.row_chunk, vocab_chunk=args.head_vocab_chunk) + + # --- prompt-only re-forward: the extension must be bitwise inert ------ + if len(ext) <= 512: + h_prompt, _ = manual_forward(model, torch.tensor(list(ids), dtype=torch.long).view(1, -1), + upcast=False) + h_prompt = h_prompt[0] + n_cmp = min(h_prompt.shape[0], h_bf16.shape[0]) + ext_invariance = { + "prompt_only_rows": int(h_prompt.shape[0]), + "forward_rows": int(h_bf16.shape[0]), + "compared_rows": int(n_cmp), + "max_abs_diff": float((h_prompt[:n_cmp].float() - h_bf16[:n_cmp].float()).abs().max()), + "exact_equal": bool(torch.equal(h_prompt[:n_cmp], h_bf16[:n_cmp])), + } + del h_prompt + else: + ext_invariance = {"skipped": True, + "reason": "prompt-only re-forward skipped for the %d-token fixture to " + "bound CPU cost; prompt rows are the first %d rows of a causal " + "forward and fixtures 1/32/129/257 verify the 5-token extension " + "is bitwise inert" % (L, L)} + + # --- library-equivalence re-forward (short fixtures only) ------------- + if len(ext) <= 512: + lib_h, lib_logits = library_forward(model, ids_t.view(1, -1), logits_to_keep=0) + f32_first_row = head_logits(h_bf16[:1], W, args.head_vocab_chunk) + bf16_first_row = model.lm_head(h_bf16[:1]) + hidden_equiv = { + "skipped": False, + "hidden_max_abs_diff": float((lib_h[0].float() - h_bf16.float()).abs().max()), + "hidden_exact_equal": bool(torch.equal(lib_h[0], h_bf16)), + "library_logits_rows": int(lib_logits.shape[0]), + "first_row_logits_compare": { + "bf16_module_path_max_abs_diff": float( + (bf16_first_row.float() - lib_logits[0, :1].float()).abs().max()), + "bf16_module_path_exact_equal": bool( + torch.equal(bf16_first_row.float(), lib_logits[0, :1].float())), + "fp32_gemm_path_max_abs_diff": float( + (f32_first_row - lib_logits[0, :1].float()).abs().max()), + "note": "library logits are the BF16 module output; the reported logprobs use the " + "float32 GEMM path", + }, + } + del lib_logits, lib_h, f32_first_row, bf16_first_row + else: + hidden_equiv = {"skipped": True, + "reason": "forward length %d > 512: library-equivalence re-forward skipped " + "to bound CPU cost; bitwise equivalence is verified on fixtures " + "0/1/32/129/257" % len(ext)} + + # --- head-path checks (on the smallest fixture) ----------------------- + head_checks = None + if fixture_index == 0: + bf16_module_head = model.lm_head(h_bf16[:2]) + fp32_gemm_head = head_logits(h_bf16[:2], W, args.head_vocab_chunk) + head_checks = {"bf16_dtype_head_vs_fp32_gemm": { + "rows": int(h_bf16[:2].shape[0]), + "bf16_module_head_max_abs_logit_diff": float( + (bf16_module_head.float() - fp32_gemm_head).abs().max()), + "bf16_module_head_relative": float( + ((bf16_module_head.float() - fp32_gemm_head).abs() + / (bf16_module_head.float().abs() + 1e-30)).max()), + "note": "a BF16 head matmul returns BF16 logits; the reported logprobs use the float32 " + "GEMM over the same promoted BF16-stored weights, so the delta between the two " + "arms isolates activation/accumulation precision rather than logit storage", + }} + del bf16_module_head, fp32_gemm_head + + # --- FP32 arm --------------------------------------------------------- + skip_fp32 = (len(ext) > 512) and args.skip_fp32_4097 + fp32 = {"skipped": False} + h_f32 = None + rows_fp32 = [] + verify_report = [] + if skip_fp32: + fp32 = {"skipped": True, + "reason": "forward length %d > 512 and --skip-fp32-4097 is set (a whole-model " + "float32 arm would require a second resident copy on a host whose RAM is " + "shared with two live GPU serves); the BF16 arm still covers this fixture" + % len(ext)} + log("fixture %d: FP32 arm skipped by policy" % fixture_index) + else: + layer_set = set(verify_layers) + h32, st32 = manual_forward(model, ids_t.view(1, -1), upcast=True, verify_layers=layer_set, + verify_report=verify_report, track_params=True) + h_f32 = h32[0].float() + del h32 + fp32 = { + "skipped": False, + "upcast_layers": st32["layers"], + "params_cast": st32["cast"], + "params_already_float32": st32["kept_f32"], + "parameter_dtypes_after": st32.get("parameter_dtypes_after"), + "layer_float_equivalence": verify_report, + "upcast_semantics": "per-layer streaming promotion: each decoder layer's stored BF16 " + "parameters/buffers are promoted to float32, the layer runs, then the " + "stored BF16 values are restored before the next layer; the final norm " + "is promoted the same way and the BF16-stored lm_head is promoted to " + "float32 for the scoring matmul. BF16->FP32 promotion is exact, so this " + "is float32 arithmetic over the checkpoint's stored values -- it is NOT " + "a trained float32 checkpoint and no claim of exact fp32-partial sums is " + "made for any single fused kernel.", + "params_resident_fp32": "one decoder layer at a time (peak transient ~%.1f GB)" % ( + sum(p.numel() for p in model.model.language_model.layers[0].parameters()) * 2 / 1e9), + } + rows_fp32, score_info_fp32 = score_rows( + W, h_f32, ids_t, prompt_positions, + row_chunk=args.row_chunk, vocab_chunk=args.head_vocab_chunk) + fp32["score_compare"] = score_info_fp32 + fp32["lm_head_dtype_during_scoring"] = str(W.dtype) + if fixture_index == 0 and head_checks is not None: + # Compare one promoted FP32 vocabulary chunk without allocating the full FP32 head. + vchunk = min(int(args.head_vocab_chunk), int(W.shape[0])) + w32_chunk = W.data[:vchunk].to(torch.float32) + ref_chunk = torch.nn.functional.linear(h_f32[:2], w32_chunk) + ours_chunk = head_logits(h_f32[:2], W, vchunk)[:, :vchunk] + head_checks["lm_head_promotion_vs_fp32_gemm"] = { + "rows": int(h_f32[:2].shape[0]), + "vocab_chunk": vchunk, + "max_abs_logit_diff": float((ref_chunk - ours_chunk).abs().max()), + "exact_equal": bool(torch.equal(ref_chunk, ours_chunk)), + "note": "float32 linear over an explicitly promoted vocabulary chunk vs the " + "chunked float32 GEMM path used for the reported logprobs; the full " + "float32 lm_head copy is never materialized", + } + del w32_chunk, ref_chunk, ours_chunk + + # --- per-position delta between the two arms -------------------------- + n = min(len(rows_bf16), len(rows_fp32)) if rows_fp32 else 0 + deltas = [] + for i in range(n): + a, b = rows_bf16[i], rows_fp32[i] + if a["position"] != b["position"]: + raise RuntimeError("row order mismatch in fixture %d" % fixture_index) + deltas.append({"position": a["position"], "token_id": a["token_id"], + "bf16_logprob": a["logprob"], "fp32_logprob": b["logprob"], + "delta": a["logprob"] - b["logprob"], + "logit_delta": a["logit"] - b["logit"], + "lse_delta": a["lse"] - b["lse"], + "argmax_agree": a["top_ids"][0] == b["top_ids"][0], + "rank_agree": a["rank"] == b["rank"]}) + delta_stats = {} + if deltas: + dabs = [abs(d["delta"]) for d in deltas] + dlog = [abs(d["logit_delta"]) for d in deltas] + dlse = [abs(d["lse_delta"]) for d in deltas] + delta_stats = { + "rows": len(deltas), + "max_abs_logprob_delta": max(dabs), + "mean_abs_logprob_delta": float(sum(dabs) / len(dabs)), + "max_abs_logit_delta": max(dlog), + "max_abs_lse_delta": max(dlse), + "argmax_agreement_rows": sum(1 for d in deltas if d["argmax_agree"]), + "rank_agreement_rows": sum(1 for d in deltas if d["rank_agree"]), + } + + # --- cache the normalized hidden rows for the native comparison ------ + hidden_sha = tensor_bytes_hash([h_bf16]) + cache = {"fixture": fixture_index, "prompt_len": L, "ext_ids": ext, + "h_bf16": h_bf16.float().clone()} + if h_f32 is not None: + cache["h_fp32"] = h_f32.clone() + tf_cache[fixture_index] = cache + del h_bf16, h_f32 + + elapsed = (datetime.now(timezone.utc) - t0).total_seconds() + result = { + "index": fixture_index, + "length": L, + "ids_sha256": hashlib.sha256(json.dumps(list(ids)).encode()).hexdigest(), + "forward_ids_length": len(ext), + "forward_ids_sha256": hashlib.sha256(json.dumps(list(ext)).encode()).hexdigest(), + "forward_note": "prompt ids plus the first 5 served greedy continuation tokens (teacher " + "forced, no cache); the prompt rows are the first %d rows of a causal forward" + % L, + "prompt_extension_invariance": ext_invariance, + "rows_note": "rows cover scored prompt positions 1..%d (position p scores token ids[p] from " + "the hidden row at position p-1); position 0 is not scored, matching the served " + "prompt_logprobs row-0 null" % (L - 1), + "bf16": {"hidden_sha256": hidden_sha, + "hidden_rows": int(len(ext)), + "forward_stats": {k: v for k, v in st_bf16.items() if k != "layers"}, + "hidden_equivalence_vs_library_forward": hidden_equiv, + "rows": rows_bf16}, + "fp32": fp32, + "fp32_rows": rows_fp32, + "delta": {"stats": delta_stats, "rows": deltas}, + "head_path_checks": head_checks, + "elapsed_s": elapsed, + "peak_rss_gb": peak_rss_gb(), + } + return result + + +def load_head_from_safetensors(model_dir): + from safetensors import safe_open + index = json.loads(open(os.path.join(model_dir, "model.safetensors.index.json"), "r").read()) + wm = index["weight_map"] + key = "lm_head.weight" if "lm_head.weight" in wm else "model.language_model.embed_tokens.weight" + with safe_open(os.path.join(model_dir, wm[key]), framework="pt", device="cpu") as f: + head = f.get_tensor(key) + return head + + +def compare_fp64_records(fp64, records): + 'Compare locally recomputed FP64 bound metrics with the recorded ones' + by_capture = {} + for rec in fp64.get("records", []): + by_capture[rec["capture"]] = rec + fields = ("finite", "head_bound_passed", "reduction_bound_passed", "logprob_bound_passed", + "argmax_differences") + scalar = ("worst_head_absolute", "worst_head_bound_ratio", "worst_reduction_absolute", + "worst_logprob_absolute", "worst_logprob_bound_ratio") + out = {"records_checked": 0, "missing": [], "boolean_mismatches": [], + "scalar_max_abs_diff": {}, "all_booleans_match": True} + for rec in records: + name = rec.get("capture_name") + if name not in by_capture: + out["missing"].append(name) + continue + ref = by_capture[name] + out["records_checked"] += 1 + for f in fields: + if bool(ref.get(f)) != bool(rec.get(f)): + out["boolean_mismatches"].append({"capture": name, "field": f, + "recorded": ref.get(f), "recomputed": rec.get(f)}) + out["all_booleans_match"] = False + for f in scalar: + a = float(ref.get(f, float("nan"))) + b = float(rec.get(f, float("nan"))) + d = abs(a - b) + prev = out["scalar_max_abs_diff"].get(f, 0.0) + out["scalar_max_abs_diff"][f] = max(prev, d) + out["all_scalars_match_tolerance_1e-12"] = all( + v <= 1e-12 for v in out["scalar_max_abs_diff"].values()) + return out diff --git a/tools/zig/qwen35_reference_forward.py b/tools/zig/qwen35_reference_forward.py new file mode 100644 index 00000000000..20a69af7c34 --- /dev/null +++ b/tools/zig/qwen35_reference_forward.py @@ -0,0 +1,402 @@ +#!/usr/bin/env python3 +"""Public Qwen BF16 reference: forward.""" +from __future__ import annotations + +import copy +import math +import json +import os +import struct +import torch +from qwen35_reference_inputs import ( + TWO_M150, + U, + gamma_series, + json_safe, + log, +) + + +def restore_stored_fp32(model, model_dir): + """Preserve checkpoint FP32 tensors that Transformers auto-dtype would downcast.""" + from safetensors import safe_open + with open(os.path.join(model_dir, "model.safetensors.index.json")) as stream: + weight_map = json.load(stream)["weight_map"] + state = model.state_dict(keep_vars=True) + restored = [] + for shard in sorted(set(weight_map.values())): + path = os.path.join(model_dir, shard) + with open(path, "rb") as stream: + header = json.loads(stream.read(struct.unpack("