Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
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.
Add a self-contained example in
examples/train-a-router/for training, evaluating and serving a difficulty router. The walkthrough introduces the dataset and metrics first, then provides a numbered progression with accuracy in each heading and executable instructions for every stage.The README defines training terms where readers first encounter them and explains what each command produces. Every command block starts with a purpose comment. Setup separates dependency installation, verified downloads and input preparation; Cloud/local server addresses are explicit.
The main path calibrates, trains and evaluates native models on an Apple Silicon GPU or a local/VM CUDA GPU, then trains the embedding classifiers on CPU. Readers serve their trained Laya checkpoint through local SIE and use the learned embedding classifier with SIE Cloud or a local Qwen server. Cached vectors make classifier training independent of an API key; a separate collection flow supports fresh development embeddings, retraining, freezing and test evaluation. Cloud credits cover inference, not the training machine.
The target is human-rated difficulty within a named mathematics competition. Inputs exclude ratings, answers and solutions. Chronological partitions separate duplicate families and isolate validation from calibration. The benchmark has 247 validation, 246 calibration and 479 test problems, with nested training sets. All stages use the same public test, reused as an exposed regression benchmark. Different model sizes and training budgets make this a comparison of practical designs. Classification accuracy does not establish downstream solver quality or monetary savings.
The LoRA study screens six recipes across three declared seeds, then expands the validation-selected recipe. Rank-16 attention adapters plus the trained native head improve from 57.34% to 65.00% mean accuracy with more examples: 17.9% fewer errors, with a paired 95% gain interval of +3.20 to +12.04 points. All seeds improve; the unchanged epoch count also increases optimizer updates. Qwen plus ridge is the strongest measured classifier. Its 64-to-512 gain has an interval that includes zero. All candidates, learning curves, calibration, checkpoint hashes and export/runtime checks are retained.
Apple Silicon support uses FP32, micro-batch one with accumulation 16, and evaluation batches of four. Gradient checkpointing is disabled because a Torch 2.9.1 MPS probe reproduced identical forward outputs but different dropout gradients during recomputation. The CUDA profile and selection/export guards remain unchanged. Mac validation records a complete 512-example, eight-epoch run on an M3 Max with 128 GiB unified memory: 10.3 minutes, 9.1 GiB sampled peak MPS allocation, and 57.62% accuracy versus 53.65% for base Laya. This is a separate single-seed result; the full 2,581-example Mac run and smaller-memory Macs have not been measured.
A matched local serving check makes the accuracy/operations tradeoff visible: expanded Laya takes 48.77 ms median / 63.43 ms p95, while Qwen4B plus ridge takes 171.51 ms / 246.43 ms, on the same M3 Max with FP32 computation. Both use fresh sequential SIE 0.10.0 servers, 20 warmups, the same 32 requests and persistent SDK clients; both match all 32 frozen reference decisions. The embedding classifier's local work takes 0.87 ms median, including normalization and policy checks. Qwen is about 9.55 times larger and has different pretraining; this is not a size-controlled experiment. Timings include local HTTP, exclude loading/startup, and do not establish concurrent throughput, Cloud latency or downstream monetary savings.
benchmark_serving.pyreproduces the protocol and preserves incomplete receipts on failures.Code, pinned dependencies and configuration live in the example. Larger data and evidence are immutable Hugging Face downloads:
Validation: