forked from NVIDIA/Megatron-LM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move layers from mpu to core.tensor_parallel.
- Loading branch information
1 parent
209f91c
commit c2ea914
Showing
22 changed files
with
508 additions
and
326 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
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 |
---|---|---|
@@ -1,7 +1,13 @@ | ||
from .parallel_state import ( | ||
initialize_model_parallel, | ||
get_tensor_model_parallel_world_size, | ||
get_tensor_model_parallel_rank, | ||
get_pipeline_model_parallel_world_size, | ||
get_pipeline_model_parallel_rank, | ||
get_virtual_pipeline_model_parallel_rank, set_virtual_pipeline_model_parallel_rank, | ||
get_data_parallel_world_size, | ||
get_data_parallel_rank, | ||
get_global_memory_buffer, | ||
get_num_layers, | ||
) | ||
from megatron.core import tensor_parallel |
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 |
---|---|---|
@@ -1,9 +1,57 @@ | ||
from .cross_entropy import vocab_parallel_cross_entropy | ||
from .data import broadcast_data | ||
|
||
from .layers import ( | ||
ColumnParallelLinear, | ||
RowParallelLinear, | ||
VocabParallelEmbedding, | ||
set_defaults_if_not_set_tensor_model_parallel_attributes, | ||
copy_tensor_model_parallel_attributes, | ||
param_is_not_tensor_parallel_duplicate, | ||
linear_with_grad_accumulation_and_async_allreduce | ||
|
||
) | ||
|
||
from .mappings import ( | ||
copy_to_tensor_model_parallel_region, | ||
gather_from_tensor_model_parallel_region, | ||
gather_from_sequence_parallel_region, | ||
scatter_to_tensor_model_parallel_region, | ||
scatter_to_sequence_parallel_region, | ||
) | ||
|
||
from .random import ( | ||
checkpoint, | ||
get_cuda_rng_tracker, | ||
model_parallel_cuda_manual_seed | ||
) | ||
|
||
from .utils import split_tensor_along_last_dim | ||
|
||
__all__ = [ | ||
# cross_entropy.py | ||
"vocab_parallel_cross_entropy", | ||
# data.py | ||
"broadcast_data", | ||
#layers.py | ||
"ColumnParallelLinear", | ||
"RowParallelLinear", | ||
"VocabParallelEmbedding", | ||
"set_defaults_if_not_set_tensor_model_parallel_attributes", | ||
"copy_tensor_model_parallel_attributes", | ||
"param_is_not_tensor_parallel_duplicate", | ||
"linear_with_grad_accumulation_and_async_allreduce", | ||
# mappings.py | ||
"copy_to_tensor_model_parallel_region", | ||
"gather_from_tensor_model_parallel_region", | ||
"gather_from_sequence_parallel_region", | ||
# "reduce_from_tensor_model_parallel_region", | ||
"scatter_to_tensor_model_parallel_region", | ||
"scatter_to_sequence_parallel_region", | ||
# random.py | ||
"checkpoint", | ||
"get_cuda_rng_tracker", | ||
"model_parallel_cuda_manual_seed", | ||
# utils.py | ||
"split_tensor_along_last_dim", | ||
] |
Oops, something went wrong.