mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-08 20:40:34 +00:00
[Doc] add more doc for ColoTensor. (#1458)
This commit is contained in:
@@ -19,7 +19,7 @@ def close(num: float, other: float, rtol: float = 1e-5, atol: float = 1e-8):
|
||||
|
||||
def shard_param(p: ColoParameter) -> None:
|
||||
pg = p.get_process_group()
|
||||
p._redistribute(distspec.shard([0], [pg.tp_world_size()]))
|
||||
p._redistribute(distspec.ShardSpec([0], [pg.tp_world_size()]))
|
||||
p.grad = p.grad.chunk(pg.tp_world_size(), 0)[pg.tp_local_rank()].clone().detach()
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user