Repository navigation
[training] fix: support MCore tokenizer padding fields - #4075
Conversation
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
Light Code ReviewClean, focused change. The three new fields ( No bugs, typos, or missing coverage found. One minor observation: the test at Suggested test casesNo perf tests impacted. |
|
/ok to test edfcc3e |
Summary
Add the MCore tokenizer padding fields that Bridge's
TokenizerConfigneeds when it is passed throughmegatron.core.tokenizers.utils.build_tokenizer:make_vocab_size_divisible_bytensor_model_parallel_sizerankThe defaults are neutral for Bridge checkpoint conversion because Bridge applies model vocab padding separately.
Testing
uv run --active --no-sync pre-commit run --all-filesuv run --active --no-sync ruff check src/megatron/bridge/training/tokenizers/config.py tests/unit_tests/training/test_model_load_save.pyuv run --active --no-sync ruff format --check src/megatron/bridge/training/tokenizers/config.py tests/unit_tests/training/test_model_load_save.pyuv run --active --no-sync python -m py_compile src/megatron/bridge/training/tokenizers/config.py tests/unit_tests/training/test_model_load_save.pyTargeted pytest was attempted locally, but this workstation Python environment is missing Transformer Engine, which prevents importing the full
megatron.bridgepackage before the selected test starts.