mirror of https://github.com/hpcaitech/ColossalAI
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
697 B
21 lines
697 B
2 years ago
|
from dataclasses import dataclass
|
||
2 years ago
|
from typing import Optional
|
||
2 years ago
|
|
||
1 year ago
|
from colossalai.legacy.tensor.distspec import DistPlacementPattern, _DistSpec
|
||
|
from colossalai.legacy.tensor.process_group import ProcessGroup
|
||
2 years ago
|
|
||
2 years ago
|
from .compute_spec import ComputeSpec
|
||
2 years ago
|
|
||
3 years ago
|
|
||
2 years ago
|
@dataclass
|
||
|
class ColoTensorSpec:
|
||
2 years ago
|
""" ColoTensorSpec
|
||
2 years ago
|
|
||
2 years ago
|
A data class for specifications of the `ColoTensor`.
|
||
|
It contains attributes of `ProcessGroup`, `_DistSpec`, `ComputeSpec`.
|
||
|
The latter two attributes are optional. If not set, they are default value is `Replicate()` and `None`.
|
||
|
"""
|
||
2 years ago
|
pg: ProcessGroup
|
||
|
dist_attr: Optional[_DistSpec] = _DistSpec(DistPlacementPattern.REPLICATE)
|
||
|
compute_attr: Optional[ComputeSpec] = None
|