Skip to content

fix: Map llama models to correct script #5159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sagemaker/modules/train/sm_recipes/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def _get_trainining_recipe_gpu_model_name_and_script(model_type: str):
"""Get the model base name and script for the training recipe."""

model_type_to_script = {
"llama_v3": ("llama", "llama_pretrain.py"),
"llama": ("llama", "llama_pretrain.py"),
"mistral": ("mistral", "mistral_pretrain.py"),
"mixtral": ("mixtral", "mixtral_pretrain.py"),
"deepseek": ("deepseek", "deepseek_pretrain.py"),
Expand Down
66 changes: 33 additions & 33 deletions tests/unit/sagemaker/modules/train/sm_recipes/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,36 +180,36 @@ def test_get_args_from_recipe_compute(
assert mock_trainium_args.call_count == 0
assert args is None

@pytest.mark.parametrize(
"test_case",
[
{
"model_type": "llama_v3",
"script": "llama_pretrain.py",
"model_base_name": "llama_v3",
},
{
"model_type": "mistral",
"script": "mistral_pretrain.py",
"model_base_name": "mistral",
},
{
"model_type": "deepseek_llamav3",
"script": "deepseek_pretrain.py",
"model_base_name": "deepseek",
},
{
"model_type": "deepseek_qwenv2",
"script": "deepseek_pretrain.py",
"model_base_name": "deepseek",
},
],
)
def test_get_trainining_recipe_gpu_model_name_and_script(test_case):
model_type = test_case["model_type"]
script = test_case["script"]
model_base_name, script = _get_trainining_recipe_gpu_model_name_and_script(
model_type, script
)
assert model_base_name == test_case["model_base_name"]
assert script == test_case["script"]

@pytest.mark.parametrize(
"test_case",
[
{"model_type": "llama_v4", "script": "llama_pretrain.py", "model_base_name": "llama"},
{
"model_type": "llama_v3",
"script": "llama_pretrain.py",
"model_base_name": "llama",
},
{
"model_type": "mistral",
"script": "mistral_pretrain.py",
"model_base_name": "mistral",
},
{
"model_type": "deepseek_llamav3",
"script": "deepseek_pretrain.py",
"model_base_name": "deepseek",
},
{
"model_type": "deepseek_qwenv2",
"script": "deepseek_pretrain.py",
"model_base_name": "deepseek",
},
],
)
def test_get_trainining_recipe_gpu_model_name_and_script(test_case):
model_type = test_case["model_type"]
script = test_case["script"]
model_base_name, script = _get_trainining_recipe_gpu_model_name_and_script(model_type)
assert model_base_name == test_case["model_base_name"]
assert script == test_case["script"]