Repository navigation
[config] Split shared configs into dedicated modules - #4907
Open
acisseJZhong wants to merge 2 commits into
Open
acisseJZhong wants to merge 2 commits into
acisseJZhong wants to merge 2 commits into
Conversation
acisseJZhong
force-pushed
the
reorder_config
branch
from
September 27, 2026 00:51
5a53957 to
f204eb6
Compare
acisseJZhong
marked this pull request as ready for review
September 27, 2026 00:52
acisseJZhong
requested review from
IvanKobzarev,
SherlockNoMad,
aditvenk,
fegin,
sanketpurandare,
tianyu-l,
wconstab and
wwwjn
as code owners
September 27, 2026 00:52
tianyu-l
reviewed
Sep 27, 2026
Contributor
There was a problem hiding this comment.
After seeing the change, I found it to be somewhat confusing -- e.g. we have config/validation.py which is about validating the config, not the config of validator.
I wonder if we should have a separate torchtitan/configs/ folder which is separated from this torchtitan/config/ folder.
acisseJZhong
marked this pull request as draft
September 27, 2026 06:50
acisseJZhong
marked this pull request as ready for review
September 27, 2026 06:53
tianyu-l
reviewed
Sep 27, 2026
Comment on lines
28
to
+29
| from torchtitan.config import CompileConfig, TrainingConfig | ||
| from torchtitan.config.parallelism import ParallelismConfig | ||
| from torchtitan.config.configs.parallelism import ParallelismConfig |
Contributor
There was a problem hiding this comment.
the difference doesn't make much sense -- I'll think about it
3 tasks
tianyu-l
pushed a commit
that referenced
this pull request
Oct 2, 2026
`GarbageCollection.__init__` rejected a non-positive `gc_freq` with `assert`. `training.gc_freq` is user config. That assert disappears under `python -O`, and `gc_freq=0` then dies as `ZeroDivisionError` on `step_count % self.gc_freq` during training. A negative value still collects. Raise `ValueError` in the constructor instead. The message includes the bad value and says `training.gc_freq` must be a positive integer. The default stays 1000, and when GC runs is unchanged. The check stays in the constructor (not `TrainingEngine` or `configs.py`) because #4907 rewrites the config layout. ## Test plan - [ ] `pytest tests/unit_tests/cpu/test_gc_freq.py -q` - [ ] `GarbageCollection(0)` and `GarbageCollection(-1)` raise `ValueError` whose message mentions `gc_freq` - [ ] `GarbageCollection(1)` and `GarbageCollection(1000)` still construct, and periodic collection still runs only when `step_count > 1` and `step_count % gc_freq == 0`
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.
Summary
TrainingConfig,CompileConfig,CommConfig, andDebugConfiginto dedicated modules undertorchtitan/configconfigs.pymodule and update internal importstorchtitan.configexports and the shared configuration guidance in the package docstringTesting
pre-commit run ufmt --files <changed files>pre-commit run flake8 --files <changed files>pytest -q tests/unit_tests/cpu/test_config_manager.py tests/unit_tests/cpu/test_compile_config.py tests/unit_tests/cpu/test_config_converter.py tests/unit_tests/cpu/test_configurable.py tests/unit_tests/cpu/test_trainer.py tests/unit_tests/rl/test_trainer.py torchtitan/experiments/graph_trainer/tests/test_simple_fsdp.py(106 passed, 7 subtests passed)