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
3a54e1c9
Unverified
Commit
3a54e1c9
authored
Aug 19, 2022
by
Frank Lee
Committed by
GitHub
Aug 19, 2022
Browse files
[autoparallel] standardize the code structure (#1469)
parent
26a37b5c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
15 deletions
+13
-15
colossalai/auto_parallel/__init__.py
colossalai/auto_parallel/__init__.py
+0
-0
colossalai/auto_parallel/solver/__init__.py
colossalai/auto_parallel/solver/__init__.py
+0
-0
colossalai/auto_parallel/solver/sharding_strategy.py
colossalai/auto_parallel/solver/sharding_strategy.py
+13
-15
No files found.
colossalai/auto_parallel/__init__.py
0 → 100644
View file @
3a54e1c9
colossalai/auto_parallel/solver/__init__.py
0 → 100644
View file @
3a54e1c9
colossalai/auto_parallel/solver/sharding_strategy.py
View file @
3a54e1c9
from
dataclasses
import
dataclass
from
colossalai.tensor.sharding_spec
import
ShardingSpec
from
typing
import
Dict
,
List
@
dataclass
class
ShardingStrategy
:
'''
ShardingStrategy is a structure containing sharding strategies of inputs and output of this node
...
...
@@ -15,21 +21,13 @@ class ShardingStrategy:
input_shardings(List(ShardingSpec)): The ShardingSpecs of the input nodes.
'''
def
__init__
(
self
,
name
,
output_sharding_spec
,
compute_cost
=
0
,
communication_cost
=
0
,
memory_cost
=
0
,
resharding_costs
=
None
,
input_shardings
=
None
):
self
.
name
=
name
self
.
output_sharding_spec
=
output_sharding_spec
self
.
compute_cost
=
compute_cost
self
.
communication_cost
=
communication_cost
self
.
memory_cost
=
memory_cost
self
.
resharding_costs
=
resharding_costs
self
.
input_shardings
=
input_shardings
name
:
str
output_sharding_spec
:
ShardingSpec
compute_cost
:
float
=
0.
communication_cost
:
float
=
0.
memory_cost
:
float
=
0.
resharding_costs
:
Dict
[
int
,
List
[
float
]]
=
None
input_shardings
:
ShardingSpec
=
None
class
StrategiesVector
:
...
...
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