-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow passing in lbl_process_group directly (#1298)
- Loading branch information
Showing
2 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2024 MosaicML LLM Foundry authors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from typing import Any | ||
|
||
import pytest | ||
|
||
from llmfoundry.models.utils.config_moe_args import ( | ||
config_megablocks_moe_args, | ||
get_megablocks_device_mesh, | ||
) | ||
|
||
|
||
@pytest.mark.gpu | ||
def test_config_megablocks_moe_args_error(): | ||
ffn_config_base: dict[str, Any] = { | ||
'moe_world_size': 1, | ||
'lbl_process_group': 'not_real', | ||
'ffn_type': 'mb_moe', | ||
'fc_type': 'torch', | ||
} | ||
|
||
with pytest.raises(ValueError): | ||
config_megablocks_moe_args( | ||
ffn_config=ffn_config_base, | ||
d_model=128, | ||
expansion_ratio=4, | ||
n_layers=2, | ||
get_device_mesh=get_megablocks_device_mesh, | ||
) |