mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-01 01:06:00 +00:00
[misc] update pre-commit and run all files (#4752)
* [misc] update pre-commit * [misc] run pre-commit * [misc] remove useless configuration files * [misc] ignore cuda for clang-format
This commit is contained in:
@@ -6,15 +6,17 @@ from colossalai.legacy.global_variables import tensor_parallel_env as env
|
||||
def get_summa_dim_from_env() -> int:
|
||||
try:
|
||||
summa_dim = env.summa_dim
|
||||
assert summa_dim > 0, 'SUMMA_DIM must be larger than zero'
|
||||
assert summa_dim > 0, "SUMMA_DIM must be larger than zero"
|
||||
return summa_dim
|
||||
|
||||
except KeyError as e:
|
||||
raise EnvironmentError('SUMMA_DIM is not found in the current environment, '
|
||||
'please make sure that you have used the correct process group initializer')
|
||||
except KeyError:
|
||||
raise EnvironmentError(
|
||||
"SUMMA_DIM is not found in the current environment, "
|
||||
"please make sure that you have used the correct process group initializer"
|
||||
)
|
||||
|
||||
|
||||
def assert_summa_initialization():
|
||||
assert gpc.is_initialized(ParallelMode.PARALLEL_2D_COL) and \
|
||||
gpc.is_initialized(ParallelMode.PARALLEL_2D_ROW), \
|
||||
'Both TWO_DIMENSION_COL and TWO_DIMENSION_ROW must be initialized by the process group initializer'
|
||||
assert gpc.is_initialized(ParallelMode.PARALLEL_2D_COL) and gpc.is_initialized(
|
||||
ParallelMode.PARALLEL_2D_ROW
|
||||
), "Both TWO_DIMENSION_COL and TWO_DIMENSION_ROW must be initialized by the process group initializer"
|
||||
|
Reference in New Issue
Block a user