Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[autoparallel] added compute resharding costs for node handler #1662

Conversation

FrankLeeeee
Copy link
Contributor

@FrankLeeeee FrankLeeeee commented Sep 27, 2022

This PR added the method update_resharding_cost to node handler and the node handler can support generating the sharding while registering sharding strategies. This PR cannot be tested at this moment, I have added a TODO note to add it back when other handlers are finished.

# by the current node handler
for prev_sharding_spec in prev_sharding_specs:
fwd_cost = shape_consistency_manager.shape_consistency(prev_sharding_spec, current_sharding_spec)
bwd_cost = shape_consistency_manager.shape_consistency(current_sharding_spec, prev_sharding_spec)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ShapeConsistencyManager will distinguish the mission type(training or inference) by a forward_only label, and returns a option related cost. Therefore, we don't have to compute fwd cost and bwd cost separately here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I notice that ShapeConsistencyManager only returns a total cost. How to get the fwd and bwd cost then?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean I want to store this cost as a TrainCycleItem so that solver can choose whether to consider the bwd cost.

@YuliangLiu0306 YuliangLiu0306 merged commit 50f16a2 into hpcaitech:main Sep 28, 2022
@FrankLeeeee FrankLeeeee deleted the feature/node-handler-resharding-cost branch January 26, 2023 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants