Repository navigation
Drafter: public DFlash-4B on GH200, acceptance by position, fine-tuning tools - #22
Conversation
serve_run.py starts one SGLang server per arm (plain, MTP, public DFlash-4B) and records the launch; accept_probe.py measures acceptance by block position from SGLang's per-request histograms; build_panel.py fixes the panel shared with the repair workstream; build_train_prompts.py and gen_targets.py build target-generated training data disjoint from every bench split; train_dflash.py fine-tunes a DFlash or DFlash 2 drafter with SpecForge's objective in resumable segments.
transformers 5.12 returns a BatchEncoding (not a dict) from apply_chat_template(tokenize=True), so the probe and generator sent the key names instead of token ids and the prompt-length filter never fired. Probe requests now carry the row id as SGLang rid so the DFlash trace can name them. Adds run_equality.sh (plain-decoding reference and comparison).
First served run of the public z-lab drafter on this GH200 (blocks 16 and 8, concurrency 1, greedy thinking): tokens per verify cycle 6.18 and 5.04, with chat at 3.98 against 6.7-7.6 for code and maths, and alpha_2 below alpha_1 in every domain. Adds the trace analysis (thinking versus answer text, offset buckets, first-rejection classes), rho_pairs.py for teacher-forced head-input pairs, the card-reproduction gate, and the shared-slot job scripts.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c592fe9b22
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| def main() -> None: | ||
| parser = argparse.ArgumentParser(description=__doc__.split('\n\n')[0]) | ||
| parser.add_argument('--per-domain', type=int, default=6000) | ||
| parser.add_argument('--exclude', type=Path, nargs='+', default=[]) |
There was a problem hiding this comment.
Preserve every repeated exclusion group
The documented command supplies --exclude twice, but an argparse option with nargs='+' and no accumulating action retains only the final occurrence. Consequently the bench warmup/tune/confirm paths expanded for the first occurrence are discarded and only panel-v1.jsonl is excluded, so generated training data can overlap evaluation splits and invalidate downstream fine-tuning measurements. Use an accumulating action such as extend, or document a single --exclude followed by all paths.
Useful? React with 👍 / 👎.
| if index is None: | ||
| compared += n | ||
| continue |
There was a problem hiding this comment.
Treat unequal output lengths as divergence
When two greedy outputs share all tokens up to the shorter length but one stops while the other continues, index remains None and this branch records the sequence as equal. This understates sequences_diverged and the divergence rate precisely for termination differences, which are part of output equality; after comparing the shared prefix, unequal lengths need to be recorded as a divergence at the end-of-sequence boundary.
Useful? React with 👍 / 👎.
support_screen.py recomputes the drafter's top-K candidates at every traced verify cycle and reports the support bound U_K (the longest prefix of the realized greedy continuation inside the candidate sets), an upper bound on any selector over frozen candidates, next to the engine's accepted length. train_selector.py trains a DFlash 2 candidate selector on the frozen public backbone with the exact expected-accepted-length objective or the matched position-weighted cross-entropy and D-PACE controls, and exports a DFlash2DraftModel checkpoint.
|
Verdict: REQUEST CHANGES Reviewed at What I checked
Blocking1. The built training set contains bench evaluation prompts.
2. Accept length is pooled, not per turn as the card computes it.
3. The panel is built from a workload that is no longer on
Suggestions (non-blocking)
|
The prompt builder now excludes both bench workload versions (mixed-v2 draws its maths prompts from GSM8K train, one of our sources), both panels, the MT-Bench gate prompts, GSM8K test and MATH-500, and fails the build unless no training prompt matches any of them by id or by the hash of its normalised text; the counts (all zero) are committed with the data manifest. Adds panel-v2 from mixed-v2's confirm split as the evaluation panel, reports the card's per-request accept length next to pooled tau, documents the panel's provenance (acceptance only, never quality), and serializes server start-up with other jobs.
|
Verdict: APPROVE Re-reviewed at
The branch merges into |
Drafter follow-up: Codex fixes on #22, engine patch layout, selector control
Moonshot M3 (drafter): serve the public DFlash drafter for Qwen3.5-4B on this GH200, measure where it is limited, and fine-tune it only against measured limitations. Work in progress; this PR will grow as results land, and the description will be updated.
What is here so far
experiments/drafter/: a launcher that records every server's command and resolved settings (serve_run.py), a greedy acceptance probe that turns SGLang's per-request histograms into acceptance by block position (accept_probe.py,summarize_acceptance.py), a trace analysis, an output-equality comparison, the panel shared with the repair workstream, a training-prompt builder disjoint from every bench split, a target-response generator, and a SpecForge-based fine-tuner for DFlash and DFlash 2 (warm start from the public checkpoint) with an optional auxiliary loss on the drift ratio rho.engine/sglang/patches/drafter-0001-dflash-cycle-trace.patch: an opt-in per-cycle trace of DFlash verification (off unlessSGLANG_DFLASH_TRACE_PATHis set). Timed runs use the stock engine.evidence/drafter/: acceptance by block position forz-lab/Qwen3.5-4B-DFlash@9a1996cat blocks 16 and 8 on the panel (correctness runs, no timings).First measurements
Block 16, concurrency 1, greedy, thinking on, natural stop at up to 2,048 tokens: 6.18 tokens per verify cycle overall; chat 3.98, code 7.63, GSM8K 6.72, MATH-500 7.55. Conditional acceptance is 0.86 at position 1 and 0.80 at position 2, rising to about 0.90 by position 12. Block 8: 5.04.
--cuda-graph-backend-prefill tc_piecewisefrom the model card crashes prefill graph capture for this target at the pin and is dropped.Still to come
Card-reproduction gate on MT-Bench, output equality against plain decoding, MTP on the same panel, the fine-tuned arms (data-only and DFlash 2 selector), and end-to-end speed against tuned MTP and the public drafter through the bench harness.
Installed outside the repository
fla-core==0.5.2andflash-linear-attention==0.5.2into~/vp-data/drafter/pylib(pip --target, not the venv), SpecForge at3cb0510cloned to~/vp-data/drafter/src/; both only onPYTHONPATHfor training.