File tree Expand file tree Collapse file tree
examples/models/bert/megatron-bert
tests/unit_tests/doc_consistency Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,11 +23,11 @@ MODEL_NAME=megatron-bert-uncased-345m
2323# Hub repo. See README.md for how to obtain one.
2424HF_MODEL_PATH=${HF_MODEL_PATH:- " ${WORKSPACE} /models/${MODEL_NAME} -hf" }
2525
26- uv run python examples/ conversion/convert_checkpoints.py import \
26+ ./scripts/ conversion/convert.sh import \
2727 --hf-model " $HF_MODEL_PATH " \
2828 --megatron-path " ${WORKSPACE} /models/${MODEL_NAME} "
2929
30- uv run python examples/ conversion/convert_checkpoints.py export \
30+ ./scripts/ conversion/convert.sh export \
3131 --hf-model " $HF_MODEL_PATH " \
3232 --megatron-path " ${WORKSPACE} /models/${MODEL_NAME} /iter_0000000" \
3333 --hf-path " ${WORKSPACE} /models/${MODEL_NAME} -hf-export"
Original file line number Diff line number Diff line change @@ -204,6 +204,17 @@ def test_shell_conversion_launcher_is_not_run_through_python():
204204 assert not offenders , f"convert.sh is invoked through Python or torchrun: { offenders } "
205205
206206
207+ def test_model_example_scripts_reference_existing_conversion_scripts ():
208+ """Every examples/conversion/*.py path in a model example shell script exists in the repo."""
209+ offenders : list [str ] = []
210+ for path in sorted ((REPO_ROOT / "examples" / "models" ).rglob ("*.sh" )):
211+ for ref in sorted (set (re .findall (r"examples/conversion/[\w./-]+\.py" , _read (path )))):
212+ if not (REPO_ROOT / ref ).is_file ():
213+ offenders .append (f"{ path .relative_to (REPO_ROOT )} : { ref } " )
214+
215+ assert not offenders , f"model example scripts reference missing conversion scripts: { offenders } "
216+
217+
207218def test_llama_readme_gptdataset_field_name ():
208219 """The GPTDatasetConfig YAML block uses the canonical field name (bug 4)."""
209220 # Bridge exposes seq_length and copies it to MCore's internal sequence_length during finalization.
You can’t perform that action at this time.
0 commit comments