| 16 | |
| 17 | @dataclass |
| 18 | class DSGraphParam: |
| 19 | name: str |
| 20 | shape: torch.Size |
| 21 | dtype: torch.dtype |
| 22 | device: torch.device |
| 23 | node: Node |
| 24 | allgather_node: Node |
| 25 | release_node: Node |
| 26 | param: torch.Tensor |
| 27 | numel: int = field(init=False) |
| 28 | |
| 29 | def __post_init__(self): |
| 30 | self.numel = reduce(lambda x, y: x * y, self.shape) |
| 31 | |
| 32 | |
| 33 | class DSGraphParamManager: |