Repository navigation
Drafter follow-up: Codex fixes on #22, engine patch layout, selector control - #40
Conversation
engine/sglang/patches/drafter/0001-dflash-cycle-trace.patch with a drafter section in the shared engine README, as in BRIEF.md. The data-generation driver can keep its first segment's queue place when restarted.
--device and --attention-backend on train_dflash.py and train_selector.py (block_hidden picks SpecForge's dense SDPA mask when the drafter is not on flex attention). A CPU dry run with tiny random models exercised training, evaluation, resume and export for both trainers and all four selector objectives.
build_train_prompts.py: --exclude uses action='extend', so repeating the flag accumulates files instead of keeping only the last group. prompts-v2 was built with a single --exclude listing all 11 files (the committed manifest checks all of them, zero overlap); rebuilding with the flag repeated gives a byte-identical prompt file. compare_outputs.py: outputs of different lengths now diverge where the shorter one ends, even when one is a prefix of the other (no equality result had been computed with the old rule). Tests in tests/test_drafter_tools.py.
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: 0ae85ac2e8
ℹ️ 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".
| 'rng': { | ||
| 'torch': torch.get_rng_state(), | ||
| 'cuda': torch.cuda.get_rng_state(), | ||
| 'cuda': torch.cuda.get_rng_state() if torch.cuda.is_available() else None, |
There was a problem hiding this comment.
Avoid initializing CUDA during CPU-only runs
When --device cpu is used on this CUDA-equipped host, torch.cuda.is_available() remains true, so saving a segment calls torch.cuda.get_rng_state(), which eagerly initializes CUDA. A nominal CPU dry run therefore unexpectedly touches the GPU outside the required GPU-lock workflow and may contend with active jobs; save CUDA state only when trainer.device.type == 'cuda'.
AGENTS.md reference: AGENTS.md:L7-L10
Useful? React with 👍 / 👎.
|
Verdict: REQUEST CHANGES Reviewed head 0ae85ac (6 behind main, no conflicts in the files it touches). Both Codex fixes on #22 are correct, and the prompts-v2 claim reproduces. One blocking item remains: Codex's P2 on this PR, which I agree with. BlockingB1. A CPU dry run of
Checked and correct
Suggestions (not blocking)
|
…moke job A --device cpu dry run no longer creates a CUDA context when it checkpoints (Codex P2 on #40). The rho auxiliary-loss probe is dropped (geometry's engine capture already measures rho for the public drafter), so the smoke job no longer dumps teacher-forced rho pairs.
|
Verdict: APPROVE This re-review covers head aaef760. B1 and Codex's P2 are fixed: The same commit removes the rho-pairs step from |
Follow-up to #22: the two Codex comments on #22, the engine-patch layout from BRIEF.md, a VAT-style control for the selector arm, and CPU dry-run support for the trainers. No GPU results in this PR.
Codex comments on #22
P1,
build_train_prompts.py--excludewithnargs='+'. Correct: with the flag repeated, argparse kept only the last group. It is nowaction='extend', andtests/test_drafter_tools.pypasses--excludetwice and checks that all files accumulate. The data actually used,prompts-v2, was built with a single--excludelisting all 11 files, and its committed manifest (evidence/drafter/data/prompts-v2.manifest.json) checks every one of them with zero overlap. Rebuilding with the flag repeated three times gives a byte-identical prompt file (SHA-25697123d99...9b1) and the same zero counts, so no training data was affected. No generation or training has run yet.compare_outputs.pytreated a prefix as equal. Correct: two greedy outputs of different lengths now diverge where the shorter one ends (first_divergence), with the missing side's token recorded asnull. No equality result had been computed with the old rule, so nothing needs recomputing; the first equality run is still queued.Other changes
engine/sglang/patches/drafter/0001-dflash-cycle-trace.patchreplacesdrafter-0001-...at the top level, with a drafter section inengine/sglang/README.md(the separate README is gone).train_selector.py --objective vat: VAT's weighting (full weight up to the current greedy walk's first rejection, then the decay restarted), the matched control for the P6 selector arm.--deviceand--attention-backendon both trainers, so they can run on CPU with SpecForge's dense SDPA masks. A CPU dry run with tiny random models exercised training, evaluation, resume and export for both trainers and all four selector objectives.run_gen_all.shcan keep its first segment's queue place when restarted (FIRST_ARRIVAL).Tests:
python -m pytest tests/test_drafter_tools.py(4 passed); pre-commit clean.