Replace wordseq detector with Shannon-bit binary CNN ensemble - #13
Closed
staging-devin-ai-integration[bot] wants to merge 1 commit into
Closed
staging-devin-ai-integration[bot] wants to merge 1 commit into
staging-devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Staging-Devin AI <166158716+staging-devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Member
|
Compare size of model |
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.
Summary
Replaces the wordseq/MSQ1 student model and its tokenizer runtime with a fully-binary CNN detector over Shannon-coded raw bytes:
(length, byte)canonical order) into a fixed 16,384-bit stream plus a codeword-boundary bitplane.z' = 2*matches - fan_in), fixed-point basis combine (FIX=65536), integer thresholds (folded BatchNorm), OR-pooling, segmented popcount heads, i16 integer classifier with per-class float scale/bias. All heavy compute is bitwise/integer CPU work on packedu64planes.assets/bnn/source-bnn2.bin(packed "BBN2", 1,165,464 bytes) replacesassets/magika/source-student-q4.bin; the old runtime (tokenizer.rs,runtime.rs,layers.rs,embedded.rs,reader.rs,activation.rs) is removed along with thefearless_simddependency.python_paritytest with embedded fixtures).scripts/bnn/withscripts/bnn/TRAINING.md.Verification
cargo fmt --checkcargo clippy --all-targets --all-features -- -D warningscargo testandcargo test --release(18 tests + 10 doctests pass)BNN_FIXTURES=.../parity_fixtures2.json cargo test --release python_parity(bit-exact Rust/Python parity)cargo bench --bench detect(benchmark precondition asserts the Rust demo classifies as Rust)python eval_export2.py test— exact integer-semantics evaluation of the exported artifact on the held-out test split (numbers above)Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/12e41f6dc16a459e90eae45fc48f336a
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/12e41f6dc16a459e90eae45fc48f336a?variant=devin-insiders
Requested by: @ealmloff