interplane.Get Omega
Read in your language

gpu-head-to-head

aien-dev/gpu-head-to-head

Brought by drakestapleton

branch main Branches Tags History

gpu-head-to-head / q35-9b / ORDERED-WEIGHTS.md

65 lines · 3624 bytes Raw Blame History Rendered
1# Ordered weight verification
2
3The old sorted-value checks remain historical evidence. They cannot establish
4the tensor layout: see `results/WEIGHTS.md.correction.json` and its Wolfram
5counterexample. This check compares named tensors at their expected positions.
6
7The converter reference is llama.cpp
8`7aca0d2ea8d92b56911233b822db01f9fbb1ae50`, particularly
9`conversion/qwen.py` and `gguf-py/gguf/tensor_mapping.py`. The checker validates
10Q/K prefixes, grouped-to-tiled V-head rows, output-projection columns, conv1d
11channels, scalar head parameters, widening and zero-centred norm folding.
12Unknown names, types, shapes, malformed lengths and missing coverage refuse the
13check. Model files are opened read-only.
14
15`tools/weight-files.mjs` and `tools/ordered-weights.mjs` only catalogue and move
16bytes. Arithmetic transformations call existing seeded-Omega `bin`/`sexp` units
17through `weight-numeric-glue.c`. For the exact converter exponential, the final
18check uses the pinned converter's ATen CPU `exp` through `torch-cpu-exp.cpp`.
19This is an independent verification oracle, never an engine/build dependency.
20No Python process or GPU model is started by that helper. The library does link
21libcudart; this is not a claim that its process has no NVIDIA libraries.
22
23The verification dependency is Torch `2.14.0a0+b2c75dd062.nv26.09` in image digest
24`557747337846eecf34486866f3d992383c6f8af869fdb0e365b5093fcaee02c2`.
25Its role is to reproduce the converter's CPU numerical function. No Omega
26replacement is planned for this independent oracle. Production remains outside
27this check. Build logs record the host/container compilers and binary hashes.
28
29The initial Omega exponential reference differs from the converter's values by
30at most one binary32 ULP in the observed inputs, as calculated by the retained
31Wolfram query `exp-oracle-difference.wl`. That attempt remains a mismatch record.
32No tolerance was widened: the final comparison uses exact bytes from the pinned
33converter library. Both numeric helpers also match the retained independent
34Wolfram control vectors and refuse malformed byte inputs.
35
36## Reproduce
37
38Use the same pinned model files and compiler/bridge/backend artifacts recorded
39in `resumption.json`. Build the verifier against that Omega kernel object:
40
41```sh
42sh q35-9b/tools/build-weight-oracles.sh NEW_ORACLE_DIR /absolute/path/omega_ggml_kernels.o
43node --test q35-9b/tools/test-ordered-weights.mjs
44STACK_TORCH_ORACLE_DIR=/absolute/NEW_ORACLE_DIR node q35-9b/tools/ordered-weights.mjs \
45 HF_DIR BF16_GGUF NEW_ORACLE_DIR/weight-numeric-glue NEW_REPORT.json \
46 --negexp-helper="$PWD/q35-9b/tools/torch-cpu-exp.sh"
47```
48
49The build and report refuse existing outputs. The optional `--only=NAME` is a
50partial diagnostic and never returns a whole-model verdict. `--mutant-order`
51deliberately leaves the original head order in the expected buffer; it preserves
52the values but must fail against a genuinely reordered target tensor.
53
54## Observed scope
55
56The source-bound local report `ordered-weight-check-3.json` compares all 427
57named text tensors exactly, with no mismatches. The 15 GGUF MTP tensors are
58explicitly excluded from plain decoding, as in the original protocol; image and
59MTP source tensors are separately listed. The real-tensor wrong-order mutant
60for `blk.0.attn_qkv.weight` fails the intended byte comparison. Synthetic parser,
61mapping and corruption controls pass.
62
63This verifies the named file transformations for the pinned checkpoint. It does
64not prove every inference operation, full backend model qualification, output
65correctness, deployment, or performance. Those gates remain separate.