Repository navigation
Ling-3.0-tiny on ARM CPUs: exact KDA heads in parallel, same tokens (#1247) - #5071
Conversation
|
Thanks @ThinkOffApp. The source keeps each head's row order, reductions and BF16 rounding points. Output, recurrent state and convolution history are disjoint across heads, and the existing pool waits for every callback. The new uneven-head byte comparisons are useful evidence. This is ready for bounded CPU A/B, with no source-order defect found. Before landing, please retain complete exact-head baseline/candidate output on the pinned GGUF, including full-vocabulary per-step logit fingerprints at matching thread counts. The supplied candidate excerpt stops at
|
|
Thanks @ashhart for the source review. Here are the complete bounded CPU A/B outputs requested in the review. PASS: at 1 thread and at 4 threads, all 32 full-vocabulary per-step logit SHA-256 values, chosen IDs and the final aggregate are identical between baseline and this KDA candidate. All four runs also match the saved exact reference. Aggregate:
main, 1 thread(s), complete stdoutExecutable SHA256: candidate, 1 thread(s), complete stdoutExecutable SHA256: main, 4 thread(s), complete stdoutExecutable SHA256: candidate, 4 thread(s), complete stdoutExecutable SHA256: The complete-output check above compares all32 fingerprints, not just token IDs. At each matching thread count the baseline and candidate match; the same equality also holds across the two thread counts. |
|
Thank you @ThinkOffApp. The parallel head bounds retain each head's serial arithmetic and reduction order, workers write disjoint output/state/history slices, and the host tests compare bytes across uneven head claims and worker counts. The comparison runner also fails on missing or malformed output and token mismatches. The patch merges cleanly on current main. The logit receipt is still incomplete in the supplied record. Its baseline one-thread block stops at No source or build change is needed for the missing evidence.
|
|
Thanks @ashhart. These are the same four outputs as in the receipt above, posted as four separate comments so that none is cut off. Nothing was rerun. Receipt 1/4: baseline, 1 thread(s), build Complete, unmodified stdout. Shared pinned model, prompt, commands and source metadata: original receipt. |
|
Receipt 2/4: candidate, 1 thread(s), build Complete, unmodified stdout. Shared pinned model, prompt, commands and source metadata: original receipt. |
|
Receipt 3/4: baseline, 4 thread(s), build Complete, unmodified stdout. Shared pinned model, prompt, commands and source metadata: original receipt. |
|
Receipt 4/4: candidate, 4 thread(s), build Complete, unmodified stdout. Shared pinned model, prompt, commands and source metadata: original receipt. |
|
Thank you @ThinkOffApp. The four complete stdout blocks close the remaining evidence ask. Each has 32 generated IDs and 32 full-vocabulary per-step logit hashes; baseline and candidate match at both one and four threads, and every block has the same aggregate The supplied decode cells are also faster: 18.15 to 16.32 seconds at one thread and 6.05 to 5.54 seconds at four threads. The source still preserves each head's serial arithmetic and reduction order, and the patch merges cleanly. It is ready to land and goes into our next landing train.
|
Workers write disjoint head slices of output, recurrent state and convolution history. Projection inputs, gates, convolution weights, decay rates, bias and normalization weights are shared read-only. Scalar per-head arithmetic and reduction order stay unchanged. Test 5 and 16 heads across 2/3/4/8 workers, including uneven assignments.
2983518 to
1559309
Compare
|
Thank you @ThinkOffApp. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
Thanks @ashhart for #4266 and the 11:53Z invitation to send the exact-path speed work separately.
What this changes
Runs independent Ling CPU KDA heads through the existing persistent worker pool. Each head retains its serial arithmetic and reduction order; workers write disjoint output, recurrent-state and convolution-history slices. Shared inputs, gates and weights stay read-only. No approximate mode, affinity experiment or step-hash code is included. The optimization ledger records this CPU operation, and a portable comparison runner retains stdout/IDs and fails on a token mismatch.
c328b353a1d2ee485a743076d6ff68f313aa515f; one local commit2983518646df236b212c277dd37fefb5c48e6a3f(port ofdbce42e03).atc overlap --json: run after the final rebase againstupstream/main(25 November): 7 changed files; the working-tree overlap with qwen27 Metal prompt attention: threadgroups past the causal edge exit early (#2912) #2926 is clean. The scan is incomplete (otherPullRequestsLimit,pullFilesUnavailable,timeLimit) and reports conflicts with 14 local worktrees. Other reported PR conflicts originate from existing PRs, not this working tree. We do not claim a clean overlap gate: the scan was incomplete, and the 14 local-worktree findings are our own unpublished worktrees, not open pull requests.Checks on this head
2983518646df236b212c277dd37fefb5c48e6a3f(read back from the pushed branch).zig build test-ling-cpu-host test-golden -Dcpu=apple_m1 --summary all: 51/51 CPU host tests pass; fake-server golden groups 69/69 and 327/340 equal with 0 unexpected differences (remaining known cases are inherited). ARM Linux ReleaseSafe cross-builds pass forbaselineandbaseline+dotprod.zig fmt --check build.zig zigandgit diff --checkpass.zig build test/GPU suites,dev-tools, fuzz and full native build. This change is CPU-only, and the Mac is serving an unrelated model; those checks have not been claimed as passing. The new threaded KDA tests exercise 5/16 heads at 2/3/4/8 workers against one-worker byte equality; no before-change red-run receipt was collected. No new dependency is needed.Receipt
4c79cfe34/04c679f9cruntime commits, not fresh measurements of this rebased head. On the rebased base/head above, one fresh confirmation pair was 4.31 → 5.44 tok/s, IDs unchanged; one pair does not establish a new general percentage.aarch64-linux-gnu, baseline and ARM dot-product builds. No GPU. ModelinclusionAI/Ling-3.0-tiny-GGUF,Ling-3.0-tiny-Q4_K_M.gguf, revision01b850e29ed5b44e2b810160ff980a9bb353296f, size 4,823,894,944 bytes, SHA256246d67d45f5b0c7447ca0ce0bdb8b46b8a47b593c5068635dc16422c051d7be9. No drafter.0,3,5,7, identical prompt IDs, fresh process/session, 32 output IDs equal before/after. Head-specific tests compare KDA output/state/history bytes. This CLI has no drafted/resumed/concurrent serving admission, so server concurrency benchmarks are n/a; their contracts are unchanged, not newly verified here.bench_openai.pybecause this executable has no HTTP server. Portable rerun: pin the process and runpython3 tools/zig/ling_cpu_compare.py BASELINE CANDIDATE MODEL.gguf '157151,90827,157152,14136,5381,6350,928,156895,157151,39,116171,157152,102141,1099,11028,7912,11,3212,527,3212,11,296,482,3390,810,8025,4614,13,156895,157151,8469,7342,5468,157152,198,156903,156904' --count 32 --threads 4 --reps 3. It alternates binaries, prints JSON rows with raw output and exits nonzero if generated IDs change.Fresh base/head raw CLI output
main (
ec6f254a3d382c478cb5546c6693f75e39c1e46735ac21c6e66953a92b1e7ec4):candidate (
01b6584cb75e80de61250950450802caa0ce1af34be3457a8136ad4cc503b924):Checklist