mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-06 19:40:28 +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:
@@ -13,7 +13,6 @@ from colossalai.testing import clear_cache_before_run, rerun_if_address_is_in_us
|
||||
|
||||
|
||||
class MLP(torch.nn.Module):
|
||||
|
||||
def __init__(self, dim: int):
|
||||
super().__init__()
|
||||
self.linear1 = torch.nn.Linear(dim, dim)
|
||||
@@ -29,12 +28,12 @@ class MLP(torch.nn.Module):
|
||||
return x
|
||||
|
||||
|
||||
CONFIG = dict(parallel=dict(tensor=dict(mode='1d', size=2)))
|
||||
CONFIG = dict(parallel=dict(tensor=dict(mode="1d", size=2)))
|
||||
|
||||
|
||||
def check_layer(rank, world_size, port):
|
||||
disable_existing_loggers()
|
||||
launch(config=CONFIG, rank=rank, world_size=world_size, host='localhost', port=port, backend='nccl')
|
||||
launch(config=CONFIG, rank=rank, world_size=world_size, host="localhost", port=port, backend="nccl")
|
||||
input_tensor = torch.rand(2, 16).cuda()
|
||||
model = MLP(16).cuda()
|
||||
symbolic_traced = symbolic_trace(model)
|
||||
@@ -55,5 +54,5 @@ def test_1d():
|
||||
spawn(check_layer, 2)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
test_1d()
|
||||
|
Reference in New Issue
Block a user