mirror of https://github.com/hpcaitech/ColossalAI
YuliangLiu0306
2 years ago
committed by
GitHub
15 changed files with 176 additions and 104 deletions
@ -1,17 +0,0 @@
|
||||
from enum import Enum |
||||
|
||||
__all__ = ['ShardOption'] |
||||
|
||||
|
||||
class ShardOption(Enum): |
||||
""" |
||||
This enum class is to define the shard level required in node strategies. |
||||
|
||||
Notes: |
||||
STANDARD: We do not add any extra shard requirements. |
||||
SHARD: We require the node to be shard using at least one device mesh axis. |
||||
FULL_SHARD: We require the node to be shard using all device mesh axes. |
||||
""" |
||||
STANDARD = 0 |
||||
SHARD = 1 |
||||
FULL_SHARD = 2 |
@ -0,0 +1,49 @@
|
||||
from dataclasses import dataclass |
||||
from enum import Enum |
||||
|
||||
__all__ = ['SolverOptions', 'SolverPerference', 'DataloaderOption', 'ShardOption'] |
||||
|
||||
|
||||
class SolverPerference(Enum): |
||||
""" |
||||
This enum class is to define the solver preference. |
||||
""" |
||||
STANDARD = 0 |
||||
DP = 1 |
||||
TP = 2 |
||||
|
||||
|
||||
class ShardOption(Enum): |
||||
""" |
||||
This enum class is to define the shard level required in node strategies. |
||||
|
||||
Notes: |
||||
STANDARD: We do not add any extra shard requirements. |
||||
SHARD: We require the node to be shard using at least one device mesh axis. |
||||
SHARD_ONE_AXIS: We require the node to be shard using the last device mesh axis. |
||||
FULL_SHARD: We require the node to be shard using all device mesh axes. |
||||
TP_SHARD: We require the node to be shard using tensor parallel strategies on last device mesh axis. |
||||
TP_FULL_SHARD: We require the node to be shard using tensor parallel strategies on all device mesh axes. |
||||
""" |
||||
STANDARD = 0 |
||||
SHARD = 1 |
||||
SHARD_LAST_AXIS = 2 |
||||
FULL_SHARD = 3 |
||||
|
||||
|
||||
class DataloaderOption(Enum): |
||||
""" |
||||
This enum class is to define the dataloader option. |
||||
""" |
||||
REPLICATED = 0 |
||||
DISTRIBUTED = 1 |
||||
|
||||
|
||||
@dataclass |
||||
class SolverOptions: |
||||
""" |
||||
SolverOptions is a dataclass used to configure the preferences for the parallel execution plan search. |
||||
""" |
||||
solver_perference: SolverPerference = SolverPerference.STANDARD |
||||
dataloader_option: DataloaderOption = DataloaderOption.REPLICATED |
||||
shard_option: ShardOption = ShardOption.STANDARD |
@ -1,7 +1,6 @@
|
||||
from .cost_graph import CostGraph |
||||
from .graph_analysis import GraphAnalyser |
||||
from .options import SolverOptions |
||||
from .solver import Solver |
||||
from .strategies_constructor import StrategiesConstructor |
||||
|
||||
__all__ = ['GraphAnalyser', 'Solver', 'StrategiesConstructor', 'CostGraph', 'SolverOptions'] |
||||
__all__ = ['GraphAnalyser', 'Solver', 'StrategiesConstructor', 'CostGraph'] |
||||
|
@ -1,30 +0,0 @@
|
||||
from dataclasses import dataclass |
||||
from enum import Enum |
||||
|
||||
__all__ = ['SolverOptions'] |
||||
|
||||
|
||||
class SolverPerference(Enum): |
||||
""" |
||||
This enum class is to define the solver preference. |
||||
""" |
||||
STANDARD = 0 |
||||
DP = 1 |
||||
TP = 2 |
||||
|
||||
|
||||
class DataloaderOption(Enum): |
||||
""" |
||||
This enum class is to define the dataloader option. |
||||
""" |
||||
REPLICATED = 0 |
||||
DISTRIBUTED = 1 |
||||
|
||||
|
||||
@dataclass |
||||
class SolverOptions: |
||||
""" |
||||
SolverOptions is a dataclass used to configure the preferences for the parallel execution plan search. |
||||
""" |
||||
solver_perference: SolverPerference = SolverPerference.STANDARD |
||||
dataloader_option: DataloaderOption = DataloaderOption.REPLICATED |
Loading…
Reference in new issue