Repository navigation
Conversation
Signed-off-by: psv666 <2693925048@qq.com>
This branch has not been deployed
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.
Purpose
Kev-4B has no preparation or native readout in this repository. Add the first independent slice of #27: a hash-pinned CPU exporter that merges every language LoRA projection, plus a Rust FP32 bilinear pointer head checked against the released head and the official reference class.
The export preserves the base tokenizer's delimiter IDs and the trained head/calibration. This PR does not add a worker or claim full-model parity; #27 remains open for prompt/row processing, shared Qwen execution and serving. #129 already carries selected-position readouts, so this slice does not introduce a competing shared API.
Summary
The exporter includes all five GDN projection types. Tests and small reference outputs live under root
tests/kev/; a CPU-only CI job runs exporter checks, and the Rust tests join the workspace suite. Recipes and model status explicitly identify the preparation-only scope.Required human contributor answers
The contributor supplied these answers in the task on 2026-10-25 (translated):
Is a PR needed? The contributor explicitly requested implementation PRs where appropriate. This scoped repository change provides the preparation/readout prerequisite for #27; no tracking-only or empty worker PR is proposed.
Bug-fix evidence: N/A; new model preparation, not a bug fix.
Test plan and results
Base
cd302b6e3d7723ebfc33bba9698da2c1e881f203; head4be35df43514b57636ab2926c63a52782f62b8c1. Local Linux x86_64, Python 3.12.13, Torch 2.8.0+cpu, safetensors 0.8.0, Rust 1.99.1. CPU checks only; no GPU inference or performance campaign.Passed:
cargo fmt --all --checkcargo clippy --workspace --locked --all-targets --features omni-laya/serve -- -D warningscargo test --workspace --locked --features omni-laya/serve: 350 passed, 66 ignored, zero failures. The first attempt hit an existing CLM test's fixed temporary-directory permissions; rerunning with a fresh task-specificTMPDIRpassed without changing CLM.cargo build --workspace --release --locked --features omni-laya/servecargo test --locked -p omni-kev-native -- --list: both ordinary tests and the opt-in released-head test discovered.python -m unittest discover -s tests/kev -p 'test_*.py' -v: 6 passed; no weights or GPU required.ruff check recipe/kev/export.py tests/kev --select E9,F,I,mkdocs build --strict, andgit diff --check.jaredpalmer/kev-4b@139fdd94f1b6a6ad80cc15e08fcb99cac885a101withQwen/Qwen3.5-4B-Base@1001bb4d826a52d1f399e183466143f4da7b741b: 248 merged targets, including 24 of each of the five GDN projections. Independently rechecked all seven output hashes, all four head tensors exactly, and all five delimiter IDs through the exported tokenizer.KEV_HEAD=<export>/head.safetensors cargo test --release --locked -p omni-kev-native --test head -- --ignored --nocapture: 1 passed against the pinned upstream class for 1/2/7/31/255 options. Maximum absolute logit error 3.12924385e-7, probability error 2.98023224e-8. Predeclared gates: logits1e-4 + 1e-5*abs(reference); probabilities1e-5absolute.Current-head GitHub CI also passed: Rust, benchmark tooling, the new Kev exporter tests, CUDA contract checks and CUDA compilation (CI run), plus the strict Docs build. Deployment was skipped as configured for pull requests. CUDA compilation is not GPU inference validation.
Demo / evidence
Before: no Kev export, head or registered tests.
After: real pinned artifacts export successfully and the Rust head reproduces the official class on deterministic hidden inputs.
tests/kev/data/head.jsonis the maintained expected-output fixture with source/head hashes and generation provenance;tests/kev/generate_head_fixture.pyexecutes the hash-verified officialPointerHeadclass. The recipe contains all reproduction commands. Model weights and local execution logs are not committed.Video and performance charts: N/A. Full-backbone BF16-merge decision parity, prompt/token fixtures, GPU execution, readiness and worker/frontend inference remain unverified/not implemented, not passing. No speed or model-quality claim is made.
Merge Danger
Door: two-way. Additive, model-local preparation and head code; no shared runtime/backend changes.
Blast Radius: Kev. The CPU export CI job adds a Torch CPU installation; existing workers are unchanged. The manifest is a preparation format, not yet a serving-loader contract.
Self-review
Full diff, ownership, hash gates, head arithmetic, fixture provenance/consumers and documentation reviewed locally. 711 changed authored Python/Rust lines; 1765 total changed lines including the small expected-output fixture, license, docs and wiring. Human review remains pending; this PR stays draft and does not close #27.