Remove duplicate val_split_ratio from DatasetConfig#224
Conversation
The per-dataset DatasetConfig.val_split_ratio was always overwritten by DatasetMixtureConfig.val_split_ratio in the mixture's __post_init__, so it was dead config surface that misled readers into thinking it was tunable per-dataset. Drop it and have factory.make_dataset read the ratio from train_cfg.dataset_mixture.val_split_ratio directly.
|
[claude-review] summary for commit 16d86ba No blocking issues found.
|
|
@claude fix the nit. |
|
[claude-fix] Addressed the nit by updating the PR description with a No code changes were needed — the review comment itself flagged this as documentation-only ("worth calling out in the PR / release notes"). No new commit was made; tests skipped — PR-description-only update, no runtime impact. |
|
Will open a new one with backward compatibility baked in. |
What this does
val_split_ratiowas declared on bothDatasetConfigandDatasetMixtureConfig, but in practice the per-dataset value was always overwritten by the mixture-level value insideDatasetMixtureConfig.__post_init__:So setting
val_split_ratioon aDatasetConfigdid nothing — it was dead config surface that misled readers into thinking the split could be tuned per-dataset.This PR:
val_split_ratiofromDatasetConfig.DatasetMixtureConfig.__post_init__.factory.make_datasetto readtrain_cfg.dataset_mixture.val_split_ratiodirectly (instead of the per-datasetcfg.val_split_ratio).The mixture-level field — which is what the docs (
docs/source/tutorials/evaluation.rst) already document as the public knob — and its[0, 1]range validation are unchanged.Any external draccus JSON config that set
val_split_ratioinside adatasets[i]entry (rather than at the mixture level) will now fail to parse with an "unknown field" error. Runtime behavior does not change — the per-dataset value was previously overwritten unconditionally by the mixture-level value, so it had no effect. Affected users should moveval_split_ratioup to the mixture level:No JSON config under
configs/, no test undertests/, and no notebook in this repo uses the per-dataset field, so nothing in-tree breaks.Tag: 🧹 Cleanup / 📝 Documentation
How it was tested
git grep val_split_ratioconfirms the only remaining references are the mixture-level field, its validator, and the factory site that reads it.configs/, no test undertests/, and no notebook references the per-dataset field, so no caller breaks.python -c "import ast; ast.parse(...)") on both edited files.uvvenv / nopre-commitbinary available); please re-run locally before merging:pre-commit run --all-files pytest -m "not gpu" -n autoHow to checkout & try? (for the reviewer)
git fetch origin claude/remove-duplicate-val-split-kGsSo git checkout claude/remove-duplicate-val-split-kGsSo pre-commit run --all-files pytest -m "not gpu" -n autoChecklist
Note: Before submitting this PR, please read the contributor guideline.
Generated by Claude Code