[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:
Hongxin Liu
2023-09-19 14:20:26 +08:00
committed by GitHub
parent 3c6b831c26
commit 079bf3cb26
1268 changed files with 50037 additions and 38444 deletions

View File

@@ -1,13 +1,12 @@
from colossalai.legacy.tensor import ComputePattern, ProcessGroup, ShardSpec, distspec
from colossalai.legacy.tensor import ComputePattern, ProcessGroup, ShardSpec
from .colo_module import ColoModule
class ColoEmbedding(ColoModule):
def __init__(self):
super(ColoEmbedding, self).__init__()
self._register_shard_params(['weight'])
self._register_shard_params(["weight"])
def register(self, compute_pattern, pg: ProcessGroup):
if not compute_pattern in self._allowed_patterns:
@@ -20,18 +19,18 @@ class ColoEmbedding(ColoModule):
self._register_allowed_patterns(
compute_pattern=_compute_pattern,
dist_specs={
'weight': ShardSpec([0], [pg.tp_world_size()]),
"weight": ShardSpec([0], [pg.tp_world_size()]),
},
mode='row',
mode="row",
)
# TP1D Col Linear
self._register_allowed_patterns(
compute_pattern=_compute_pattern,
dist_specs={
'weight': ShardSpec([-1], [pg.tp_world_size()]),
"weight": ShardSpec([-1], [pg.tp_world_size()]),
},
mode='col',
mode="col",
)
self._set_default(compute_pattern=_compute_pattern, target_mode='row')
self._set_default(compute_pattern=_compute_pattern, target_mode="row")