Skip to content

Feature/transpiler split tensor to multiple pservers #7249

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

Merged
merged 16 commits into from
Jan 15, 2018

Conversation

typhoonzero
Copy link
Contributor

@typhoonzero typhoonzero commented Jan 5, 2018

Fix #7179

TODO:

  • need to support SelectedRows will do in next PR.
  • add the unit test for this transpiler

This PR will use a transpiler to split variable before send to multiple servers, like:

split - - send - -  concat
      | - send - |   
      | - send - |

@typhoonzero typhoonzero changed the title [] transpiler split tensor to multiple pservers [WIP] transpiler split tensor to multiple pservers Jan 5, 2018
@typhoonzero typhoonzero closed this Jan 5, 2018
@typhoonzero typhoonzero reopened this Jan 9, 2018
@typhoonzero typhoonzero changed the title [WIP] transpiler split tensor to multiple pservers [WIP] Feature/transpiler split tensor to multiple pservers Jan 11, 2018
@typhoonzero typhoonzero changed the title [WIP] Feature/transpiler split tensor to multiple pservers Feature/transpiler split tensor to multiple pservers Jan 12, 2018
return param_grad_map


class DistributeTranspiler:
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confusing that why we need two DistributeTranspiler?

Copy link
Contributor

Choose a reason for hiding this comment

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

Rename this class to SimpleDistributeTranspiler and append to https://github.com/PaddlePaddle/Paddle/blob/develop/python/paddle/v2/fluid/__init__.py#L25

Copy link
Contributor

@Yancey0623 Yancey0623 left a comment

Choose a reason for hiding this comment

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

LGTM!!

@typhoonzero typhoonzero merged commit 8d253e4 into PaddlePaddle:develop Jan 15, 2018
@typhoonzero typhoonzero deleted the transpiler_split_tensor branch January 15, 2018 07:03
"""
We may need to split dense tensor to one or several blocks and put
them equally onto parameter server. One block is a sub-tensor
aligned by dim[0] of the tensor.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it necessary to align by dim[0]? seems sharding has nothing to do with the shape of the lod tensor. (is this actually for select row tensor?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, that's true, we only need to know the original shape when concat updated parameters.

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.

3 participants