Repository navigation
Conversation
|
Independent Linux verification at head
Every reported count reproduces on a second Linux machine, and both declared gap cells are green. — eXsoR65's AI agent (DeepSeek Harness): this verification was run by eXsoR65's AI coding agent at their direction; eXsoR65 authorized this comment before posting. |
|
Reworked to #4125's arithmetic, as asked in #3476. The page, the host model and the tests now write down what |
…ith its bound and probes
… for the table's worst rounding
…alsification table
09c48a1 to
64d6ddf
Compare
|
Re-verified the rework at head
CI at this head is still queued (10 queued / 2 nightlies skipped, none completed) — everything above is independent of CI. Full receipt with the per-claim evidence table and logs available on request. — eXsoR65's AI agent (DeepSeek Harness): independent read-only re-verification on eXsoR65's Linux machine; eXsoR65 authorized this comment before posting. |
What this changes
The page
docs/inkling2-attention-reference.md, the host model and the host tests described Transformers' eager rounding points; after #3476's request they now write down #4125's arithmetic, the onemainruns. The page, a new fp32 host model in the kernels' order and the host tests state the three bf16 roundings of the kernels (bias table, P, output), the fp32 score and sums, the order of every sum (8 chained k16 mma, 64-key tiles, 1024-key sub-chunks, 256- and 16384-key chunks, the sink at the merge), what NaN and infinity do, and a float64 bound derived for that order, with probes against it. The comparison with Transformers eager stays as a reported fidelity number.docs/inkling2-attention-reference.md: the page, with the same sections and one more, "Fidelity against Transformers eager (reported)"; every statement about a kernel carries file:line at6dbb32f048a6.zig/src/families/inkling2/attn_order.zig: the fp32 model in the kernels' order. It takes any number of keys; inside an mma it adds in ascending order and at the plain*and+sites it rounds the product and the sum separately, both written on the page as the model's choice.zig/src/families/inkling2/attn_bound.zig,attn_bound_test.zig: the bound as code, with its domain (finite inputs,gate >= -87,nk <= 2^20, products and sums below2^120;error.AttnDomainoutside it), an infinite bound whereexp(L)overflows, and the tests that evaluate it: the fixture, rows across 64, 1024 and 16384 keys (global) and the 256-key chunks (sliding), a case per term, an output below the normal range, the ends of the domain, and a case for the table's worst rounding that reaches 0.96 of the bound.zig/src/families/inkling2/attn_order_hand_test.zig: one test per rounding point and per seam with expected values written by hand in float64, and the NaN and infinity cases.zig/src/families/inkling2/attn.zig,attn_test.zig: the float64 formula stays; the eager-point fp32 model stays only as the fidelity check, with the fidelity numbers printed.oracle/attn.pyandfixtures/attn_tiny.binare unchanged sincef387faf49(the page now says how the fixture is made);host_test.ziggains the new imports.attn_bound.zigis its own count, nottolofzig/tests/cuda/contract_inkling2_attn_ref.zig, and this change does not touch that file. Where they differ: the page's float64 formula takes the exact tap sum as the bias and counts the table's bf16 rounding, where the contract's reference takes the table as an input (:70,:120-121); a rescale counts as gamma(6) here and as 2^-22 there (:88-92,:161); P'sexp2fcounts as gamma(5) here and 2^-22 there (:166); a 1,024-key sub-chunk or 256-key chunk of T tiles has T - 1 in-tile rescales here and T there (:80-92); the quotient of the two sums is bounded with exp(L) - 1 here and to first order there (:186).Not part of this change: the pin move to the current revision (8192), and the masked non-finite V entry in docs/kernel-contract.md, which needs a GPU run; the page states the host rule for it under NaN and infinity.
No kernel, no
zig/tests/cudafile, nodocs/kernel-contract.md, no pin (tools/zig/inkling2_fixtures.py,fixtures/config.json) and nolog_scaling_n_flooris touched or read; no file of this change contains CUDA code.462f5eca3). This pull request holds ten commits: the earlier two (501aca8f8,f387faf49) and eight more:381c6d34e(the host model in the kernels' order, the bound and the tests),4cd632869(the page),d9f2d192c,7ab82358eand5323a8f3d(the bound's live keys, its comments, the infinite bound and the table test),714d351f1(the page's wording, sources, domain and falsification table),1fb3517e1(a test comment) and64d6ddf53(corrections to five passages of the page).atc overlap --json: run on 2026-11-22 at 18:52 UTC against base462f5eca3after the final rebase; incomplete (limitations: otherPullRequestsLimit, pullFilesUnavailable, pullRequestsLimit, timeLimit); this run lists no overlap with another pull request. Inkling 2 Mini on CUDA and Metal #4387 is still open and still changeszig/src/families/inkling2/host_test.zig(1 shared file); its import lines and this pull request's are disjoint. The run also reports two local checkouts of this branch from before the rebase: the previous head09c48a1d5(10 shared files,clean) and its fourth commit509bc4df1(10 shared files, 4 conflicting files, each changed again by later commits of this branch); no other overlaps.Checks on this head
64d6ddf53python3 tools/pr_check.py --base origin/main --pr 4367, which runs it): 0 errors, 0 new Lean findings (165 vs 165); 2 advisory warnings, below.zig build test-inkling2-host --summary all: 81 passed, 0 failed, 4 skipped (checkpoint-dependent tests).zig build test-inkling2-cuda-host: 10 passed.zig fmt --check build.zig zigandgit diff --check origin/main HEAD: clean.pr_check: two advisory warnings, no Unreleased bullet naming this PR, and the NVIDIA section number 5.6.7.2 on the page read as an address.zig build test test-golden: not run on the machine used (disk space).oracle/attn.py check: not run, the tiny-random checkpoint is not available there (FileNotFoundError formodel.safetensors); the oracle and fixture are unchanged.A device probe, outside this change
Not in the diff and not reproducible from it: a local probe launched
tf_ink2_rel_table,tf_ink2_attn,tf_ink2_attn_foldandtf_ink2_mergeon one RTX 5090 (driver 610.43.02, nvcc 13.3.73,-Dsm=120; the attention kernel sources and their build line as at6dbb32f048a6) on 223 decode cases with random inputs from fixed seeds: one sequence per call,hd128, 16 taps, 1024 bias columns, 1 to 70 rows, key counts around the seams at 64, 256, 1024, 1280 (sliding) and 16384, and at 20000 and 40000.limitOut: the largest |device - float64| /limitOutis 0.340, and the fp32 host model reaches the same 0.340 on the same cases. No case was outside the domain and no bound was infinite. A second launch of the global cases with at most 64 rows, in the split mode oftf_ink2_attn, gave 2,153,472 more outputs, all insidelimitOut(largest ratio 0.288).u_mmatimes the sum of the 17 operands' absolute values (the bound takes 17), and on 5,034,152 argumentsexp2fandexpfwere within 2 ULP of the float64 result rounded to fp32 (twoexpfarguments whose result overflows left out).The probe has no NaN or infinite input, does not launch the prompt kernel and has one sequence per call. We can open it as its own pull request if it is wanted.
Receipt
n/a: the change cannot reach inference. Nothing in the engine imports
attn.zigorattn_order.zig; only the family's host tests do.Checklist