Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ColossalAI
Commits
0dcc410f
Unverified
Commit
0dcc410f
authored
Jan 06, 2023
by
Jiarui Fang
Committed by
GitHub
Jan 06, 2023
Browse files
[NFC] polish code format
parents
d634eae0
d42aecdd
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
27 deletions
+30
-27
colossalai/auto_parallel/tensor_shard/deprecated/constants.py
...ssalai/auto_parallel/tensor_shard/deprecated/constants.py
+2
-1
colossalai/auto_parallel/tensor_shard/deprecated/graph_analysis.py
...i/auto_parallel/tensor_shard/deprecated/graph_analysis.py
+5
-3
colossalai/auto_parallel/tensor_shard/deprecated/op_handler/batch_norm_handler.py
.../tensor_shard/deprecated/op_handler/batch_norm_handler.py
+8
-8
colossalai/auto_parallel/tensor_shard/deprecated/op_handler/embedding_handler.py
...l/tensor_shard/deprecated/op_handler/embedding_handler.py
+7
-7
colossalai/auto_parallel/tensor_shard/deprecated/op_handler/unary_elementwise_handler.py
..._shard/deprecated/op_handler/unary_elementwise_handler.py
+4
-5
colossalai/auto_parallel/tensor_shard/utils/factory.py
colossalai/auto_parallel/tensor_shard/utils/factory.py
+4
-3
No files found.
colossalai/auto_parallel/tensor_shard/deprecated/constants.py
View file @
0dcc410f
import
torch
import
operator
import
operator
import
torch
__all__
=
[
__all__
=
[
'ELEMENTWISE_MODULE_OP'
,
'ELEMENTWISE_FUNC_OP'
,
'RESHAPE_FUNC_OP'
,
'CONV_MODULE_OP'
,
'CONV_FUNC_OP'
,
'ELEMENTWISE_MODULE_OP'
,
'ELEMENTWISE_FUNC_OP'
,
'RESHAPE_FUNC_OP'
,
'CONV_MODULE_OP'
,
'CONV_FUNC_OP'
,
'LINEAR_MODULE_OP'
,
'LINEAR_FUNC_OP'
,
'BATCHNORM_MODULE_OP'
,
'POOL_MODULE_OP'
,
'NON_PARAM_FUNC_OP'
,
'BCAST_FUNC_OP'
,
'LINEAR_MODULE_OP'
,
'LINEAR_FUNC_OP'
,
'BATCHNORM_MODULE_OP'
,
'POOL_MODULE_OP'
,
'NON_PARAM_FUNC_OP'
,
'BCAST_FUNC_OP'
,
...
...
colossalai/auto_parallel/tensor_shard/deprecated/graph_analysis.py
View file @
0dcc410f
from
collections
import
OrderedDict
as
ODict
from
dataclasses
import
dataclass
from
dataclasses
import
dataclass
from
torch.fx.node
import
Node
from
typing
import
Any
,
List
,
OrderedDict
,
Union
from
torch.fx.graph
import
Graph
from
torch.fx.graph
import
Graph
from
torch.fx.graph_module
import
GraphModule
from
torch.fx.graph_module
import
GraphModule
from
collections
import
OrderedDict
as
ODict
from
torch.fx.node
import
Node
from
typing
import
List
,
OrderedDict
,
Union
,
Any
from
colossalai.fx.passes.utils
import
get_node_module
from
colossalai.fx.passes.utils
import
get_node_module
__all__
=
[
'LiveVariable'
,
'LiveVariableVector'
,
'LiveStage'
,
'GraphAnalyser'
]
__all__
=
[
'LiveVariable'
,
'LiveVariableVector'
,
'LiveStage'
,
'GraphAnalyser'
]
...
...
colossalai/auto_parallel/tensor_shard/deprecated/op_handler/batch_norm_handler.py
View file @
0dcc410f
...
@@ -2,9 +2,9 @@ import operator
...
@@ -2,9 +2,9 @@ import operator
from
functools
import
reduce
from
functools
import
reduce
import
torch
import
torch
from
colossalai.auto_parallel.tensor_shard.deprecated._utils
import
\
ignore_sharding_exception
from
colossalai.auto_parallel.tensor_shard.deprecated._utils
import
ignore_sharding_exception
from
colossalai.auto_parallel.tensor_shard.deprecated.sharding_strategy
import
(
ShardingStrategy
,
StrategiesVector
)
from
colossalai.auto_parallel.tensor_shard.deprecated.sharding_strategy
import
ShardingStrategy
,
StrategiesVector
from
.operator_handler
import
OperatorHandler
from
.operator_handler
import
OperatorHandler
...
...
colossalai/auto_parallel/tensor_shard/deprecated/op_handler/embedding_handler.py
View file @
0dcc410f
...
@@ -5,9 +5,9 @@ from functools import reduce
...
@@ -5,9 +5,9 @@ from functools import reduce
from
typing
import
Dict
,
List
from
typing
import
Dict
,
List
import
torch
import
torch
from
colossalai.auto_parallel.tensor_shard.deprecated._utils
import
\
ignore_sharding_exception
from
colossalai.auto_parallel.tensor_shard.deprecated._utils
import
ignore_sharding_exception
from
colossalai.auto_parallel.tensor_shard.deprecated.sharding_strategy
import
(
ShardingStrategy
,
StrategiesVector
)
from
colossalai.auto_parallel.tensor_shard.deprecated.sharding_strategy
import
ShardingStrategy
,
StrategiesVector
from
colossalai.tensor.shape_consistency
import
ShapeConsistencyManager
from
colossalai.tensor.shape_consistency
import
ShapeConsistencyManager
from
colossalai.tensor.sharding_spec
import
ShardingSpec
from
colossalai.tensor.sharding_spec
import
ShardingSpec
...
...
colossalai/auto_parallel/tensor_shard/deprecated/op_handler/unary_elementwise_handler.py
View file @
0dcc410f
...
@@ -6,11 +6,10 @@ from functools import reduce
...
@@ -6,11 +6,10 @@ from functools import reduce
from
typing
import
Dict
,
List
from
typing
import
Dict
,
List
import
torch
import
torch
from
colossalai.auto_parallel.tensor_shard.deprecated._utils
import
\
ignore_sharding_exception
from
colossalai.auto_parallel.tensor_shard.deprecated._utils
import
ignore_sharding_exception
from
colossalai.auto_parallel.tensor_shard.deprecated.constants
import
\
from
colossalai.auto_parallel.tensor_shard.deprecated.constants
import
INFINITY_COST
INFINITY_COST
from
colossalai.auto_parallel.tensor_shard.deprecated.sharding_strategy
import
ShardingStrategy
,
StrategiesVector
from
colossalai.auto_parallel.tensor_shard.deprecated.sharding_strategy
import
(
ShardingStrategy
,
StrategiesVector
)
from
colossalai.tensor.shape_consistency
import
ShapeConsistencyManager
from
colossalai.tensor.shape_consistency
import
ShapeConsistencyManager
from
colossalai.tensor.sharding_spec
import
ShardingSpec
from
colossalai.tensor.sharding_spec
import
ShardingSpec
...
...
colossalai/auto_parallel/tensor_shard/utils/factory.py
View file @
0dcc410f
...
@@ -4,10 +4,11 @@ from functools import reduce
...
@@ -4,10 +4,11 @@ from functools import reduce
from
typing
import
Dict
,
List
,
Optional
,
Union
from
typing
import
Dict
,
List
,
Optional
,
Union
import
torch
import
torch
from
torch.fx.node
import
Node
from
colossalai.device.device_mesh
import
DeviceMesh
from
colossalai.device.device_mesh
import
DeviceMesh
from
colossalai.tensor.shape_consistency
import
ShapeConsistencyManager
from
colossalai.tensor.shape_consistency
import
ShapeConsistencyManager
from
colossalai.tensor.sharding_spec
import
ShardingSpec
from
colossalai.tensor.sharding_spec
import
ShardingSpec
from
torch.fx.node
import
Node
from
..constants
import
INFINITY_COST
from
..constants
import
INFINITY_COST
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment