mirror of https://github.com/hpcaitech/ColossalAI
Jiarui Fang
2 years ago
committed by
GitHub
20 changed files with 87 additions and 77 deletions
@ -1,14 +1,14 @@
|
||||
from .spec import ComputePattern, ParallelAction, TensorSpec |
||||
|
||||
from .tensor_spec import TensorSpec |
||||
from .compute_spec import ComputeSpec, ComputePattern |
||||
from .colo_tensor import ColoTensor |
||||
from .colo_parameter import ColoParameter |
||||
from .utils import convert_parameter, named_params_with_colotensor |
||||
from . import distspec |
||||
from .dist_spec_mgr import DistSpecManager |
||||
from .param_op_hook import ParamOpHook, ParamOpHookManager |
||||
from .chunk import ChunkManager, TensorState |
||||
from . import distspec |
||||
|
||||
__all__ = [ |
||||
'ColoTensor', 'convert_parameter', 'ComputePattern', 'TensorSpec', 'ParallelAction', 'named_params_with_colotensor', |
||||
'ColoTensor', 'convert_parameter', 'ComputePattern', 'TensorSpec', 'ComputeSpec', 'named_params_with_colotensor', |
||||
'ColoParameter', 'distspec', 'DistSpecManager', 'ParamOpHook', 'ParamOpHookManager', 'ChunkManager', 'TensorState' |
||||
] |
||||
|
@ -0,0 +1,23 @@
|
||||
from enum import Enum |
||||
|
||||
|
||||
class ComputePattern(Enum): |
||||
TP1D = 0 |
||||
TP2D = 1 |
||||
TP2P5D = 2 |
||||
TP3D = 3 |
||||
|
||||
|
||||
class ComputeSpec(object): |
||||
"""ComputeSpec |
||||
The Specification for compuattion pattern |
||||
Args: |
||||
compute_pattern (ComputePattern): an Enum instance for compute pattern. |
||||
""" |
||||
|
||||
def __init__(self, compute_pattern: ComputePattern) -> None: |
||||
assert isinstance(compute_pattern, ComputePattern) |
||||
self.compute_pattern = compute_pattern |
||||
|
||||
def __repr__(self): |
||||
return f'compute pattern: {self.compute_pattern}' |
Loading…
Reference in new issue