Repository navigation
Measure structural sharing after FP16/INT8 on trained n-gram tables - #40
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Existing FP32 structural ablations do not establish whether DATrie prefix/suffix sharing adds value after ordinary weight quantization. This adds frozen CPU FP16 and scale-aware per-row INT8 storage, preserving original IDs and complete encoded representative bytes through the native mark-compact path.
The same 18 cached trained SGNS/GRU tables now have 486 matched storage variants: raw mmap, native identity/layout, exact encoded-byte dedup, and structural sharing at five cosine thresholds. Results count scales, maps, metadata and actual key artifacts; whole GRU bundle costs and source hashes are retained. Selection is locked on validation before testing.
At the fixed 0.99 cosine/norm guard, INT8 still leaves an additional 20–28% saving on SGNS and 11%/15% on order-8/12 GRU versus the best same-encoding control. Order-4 GRU INT8 compaction increases storage. These are approximate row changes on small public-text trained references, not official trained Engram or general LLM evidence; numeric gathers remain slower than raw encoded mmap.
Seven of 27 primary validation choices exceed the held-out KL budget and remain failures. A separately labeled post-main-run fixed-0.99 audit passes all 27 tests without replacing the primary choices. Rate–distortion plots, per-seed data, commands, environment, build/test logs and the initial launcher failure are inspectable in
docs/quantized_structural_evidence_20261031/.Validation: 137 local unit tests pass (26 platform/optional skips); 24 pinned Linux codec/DATrie/causal tests pass; every encoded row and original-ID forwarding result is verified in the main run. The subsequent max-float32 INT8 overflow guard passes extreme-value checks and preserves all 54 trained encodings byte-for-byte.