[Infra] Tier 1 follow-up: code-reviewer concerns + honesty fixes
kind: infra
track:Highlight text on any card (body, plan, or an event) to anchor a comment, or leave a whole-task comment here. Mention @claude to summon a reply.
No comments yet.
Context
Code-reviewer verdict on issue #36 (https://github.com/superkaiba/explore-persona-space/issues/36#issuecomment-4271309947) was CONCERNS, merge-with-follow-up. No blocking bugs landed. This issue tracks the cleanup commit.
Scope
MAJOR (documentation / honesty — not code bugs)
-
Downgrade / reword Liger log message in
src/explore_persona_space/train/trainer.pyandsft.py.- Current: module-level log tells users to install Liger-Kernel for speedup
- Problem: Liger is disabled on every in-process path (always LoRA→PeftModel) — install instruction is misleading
- Fix: downgrade to DEBUG OR rewrite to say "Liger-Kernel available but disabled on LoRA paths due to PEFT incompatibility (see b8dd473). Only useful for full-FT runs on distributed path."
-
Add DPO precompute memory warning in
trainer.pyDPO path (around:545-563).- When
precompute_ref_log_probs=True, log a one-time INFO stating the +63% peak memory tradeoff (measured: 19.08 → 31.09 GB on Qwen-7B LoRA) - Helps users running memory-tight setups
- When
-
Fix benchmark harness metric in
scripts/benchmark_tier1.pyandscripts/benchmark_lora_perf.py.- Current: reports
samples_per_secondfor packed runs → collapses to 1/K when K examples pack into one sequence - Fix: add
train_tokens_per_secondcolumn for packed comparisons; document that samples/sec is misleading when packing=True
- Current: reports
MINOR (7 items from reviewer)
- Declare
packaginginpyproject.toml(used for version parsing in tokenizer shim attrainer.py:32-53) - Fix outdated docstring in
sft.py(code-reviewer flagged a specific inaccuracy — check the review for details) - Remove dead helper
_num_training_steps_from_trainer_state(if still unused after cleanup) - Fix potential IndexError in
prepare_dpo_jsonl— add bounds check on empty prompt/chosen/rejected - Change CPU-only probe to raise
TypeErrornotValueError(check code-reviewer's context) - Make
install_benchmark_callbackactually idempotent (or remove the claim from docstring) - Document (or revert) the scope-creep refactors in commits
c57ab0cand52d6d2bthat bundled_init_phase/_finalize_phase/_resolve_warmupextractions andTrainLoraConfigdataclass migration — violated "one commit per change"
Verdict post
Post <!-- epm:note v1 --> marker on issue #36 recording honestly:
- SFT ≈ 0% on LoRA (target NOT met, documented reasons: short seq, Liger-PEFT incompat)
- DPO +20% confirmed (clean win)
- Memory: DPO +63% (precompute tradeoff)
- Nothing to revert
Success criteria
- Single cleanup commit batching all 10 items (or 2-3 if grouped logically)
ruff check . && ruff format .clean- Existing tests pass
- Commit message:
chore(tier1-cleanup): address code-reviewer concerns [refs #36] - Posts
<!-- epm:cleanup-done v1 -->marker on THIS issue
Budget
≤1 hr, no GPU needed.
Activity