Skip to content

Conversation

@rohan-varma
Copy link
Contributor

@rohan-varma rohan-varma commented Sep 9, 2020

Stack from ghstack:

Closes #39969

This PR adds support for propagation of input shapes over the wire when the profiler is invoked with record_shapes=True over RPC. Previously, we did not respect this argument.

This is done by saving the shapes as an ivalue list and recovering it as the type expected (std::vector<std::vector<int>> on the client). Test is added to ensure that remote ops have the same input_shapes as if the op were run locally.

Remote ops profiler output before (run with group_by_input_shapes=True):

rpc_sync#aten::add(worker1 -> worker2)#remote_op: aten::add        0.18%            67.229us         0.21%            76.449us         76.449us         1                2                []
rpc_sync#aten::add(worker1 -> worker2)#remote_op: aten::empty      0.03%            9.220us          0.03%            9.220us          9.220us          1                2                []

After:

rpc_sync#aten::add(worker1 -> worker2)#remote_op: aten::add        0.14%            91.001us         0.16%            102.094us        102.094us        1                2                [[100], [100], []]
rpc_sync#aten::add(worker1 -> worker2)#remote_op: aten::empty      0.02%            11.093us         0.02%            11.093us         11.093us         1                2                [[], [], [], [], [], []]

Differential Revision: D23591274

NOTE FOR REVIEWERS: This PR has internal Facebook specific changes or comments, please review them on Phabricator!

Closes #39969

This PR adds support for propagation of input shapes over the wire when the profiler is invoked with `record_shapes=True` over RPC. Previously, we did not respect this argument.

This is done by saving the shapes as an ivalue list and recovering it as the type expected (`std::vector<std::vector<int>>` on the client). Test is added to ensure that remote ops have the same `input_shapes` as if the op were run locally.

Differential Revision: [D23591274](https://our.internmc.facebook.com/intern/diff/D23591274/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D23591274/)!

[ghstack-poisoned]
rohan-varma added a commit that referenced this pull request Sep 9, 2020
Closes #39969

This PR adds support for propagation of input shapes over the wire when the profiler is invoked with `record_shapes=True` over RPC. Previously, we did not respect this argument.

This is done by saving the shapes as an ivalue list and recovering it as the type expected (`std::vector<std::vector<int>>` on the client). Test is added to ensure that remote ops have the same `input_shapes` as if the op were run locally.

Differential Revision: [D23591274](https://our.internmc.facebook.com/intern/diff/D23591274/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D23591274/)!

ghstack-source-id: 111702390
Pull Request resolved: #44419
@dr-ci
Copy link

dr-ci bot commented Sep 9, 2020

💊 CI failures summary and remediations

As of commit 8772f81 (more details on the Dr. CI page):


None of the CI failures appear to be your fault 💚



🚧 2 ongoing upstream failures:

These were probably caused by upstream breakages that are not fixed yet:


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 40 times.

Closes #39969

This PR adds support for propagation of input shapes over the wire when the profiler is invoked with `record_shapes=True` over RPC. Previously, we did not respect this argument.

This is done by saving the shapes as an ivalue list and recovering it as the type expected (`std::vector<std::vector<int>>` on the client). Test is added to ensure that remote ops have the same `input_shapes` as if the op were run locally.

Differential Revision: [D23591274](https://our.internmc.facebook.com/intern/diff/D23591274/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D23591274/)!

[ghstack-poisoned]
Closes #39969

This PR adds support for propagation of input shapes over the wire when the profiler is invoked with `record_shapes=True` over RPC. Previously, we did not respect this argument.

This is done by saving the shapes as an ivalue list and recovering it as the type expected (`std::vector<std::vector<int>>` on the client). Test is added to ensure that remote ops have the same `input_shapes` as if the op were run locally.

Differential Revision: [D23591274](https://our.internmc.facebook.com/intern/diff/D23591274/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D23591274/)!

[ghstack-poisoned]
rohan-varma added a commit that referenced this pull request Sep 12, 2020
Pull Request resolved: #44419

Closes #39969

This PR adds support for propagation of input shapes over the wire when the profiler is invoked with `record_shapes=True` over RPC. Previously, we did not respect this argument.

This is done by saving the shapes as an ivalue list and recovering it as the type expected (`std::vector<std::vector<int>>` on the client). Test is added to ensure that remote ops have the same `input_shapes` as if the op were run locally.
ghstack-source-id: 111932779

Differential Revision: [D23591274](https://our.internmc.facebook.com/intern/diff/D23591274/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D23591274/)!
Closes #39969

This PR adds support for propagation of input shapes over the wire when the profiler is invoked with `record_shapes=True` over RPC. Previously, we did not respect this argument.

This is done by saving the shapes as an ivalue list and recovering it as the type expected (`std::vector<std::vector<int>>` on the client). Test is added to ensure that remote ops have the same `input_shapes` as if the op were run locally.

Differential Revision: [D23591274](https://our.internmc.facebook.com/intern/diff/D23591274/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D23591274/)!

[ghstack-poisoned]
rohan-varma added a commit that referenced this pull request Sep 14, 2020
Pull Request resolved: #44419

Closes #39969

This PR adds support for propagation of input shapes over the wire when the profiler is invoked with `record_shapes=True` over RPC. Previously, we did not respect this argument.

This is done by saving the shapes as an ivalue list and recovering it as the type expected (`std::vector<std::vector<int>>` on the client). Test is added to ensure that remote ops have the same `input_shapes` as if the op were run locally.
ghstack-source-id: 111996895

Differential Revision: [D23591274](https://our.internmc.facebook.com/intern/diff/D23591274/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D23591274/)!
Closes #39969

This PR adds support for propagation of input shapes over the wire when the profiler is invoked with `record_shapes=True` over RPC. Previously, we did not respect this argument.

This is done by saving the shapes as an ivalue list and recovering it as the type expected (`std::vector<std::vector<int>>` on the client). Test is added to ensure that remote ops have the same `input_shapes` as if the op were run locally.

Differential Revision: [D23591274](https://our.internmc.facebook.com/intern/diff/D23591274/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D23591274/)!

[ghstack-poisoned]
rohan-varma added a commit that referenced this pull request Sep 16, 2020
Pull Request resolved: #44419

Closes #39969

This PR adds support for propagation of input shapes over the wire when the profiler is invoked with `record_shapes=True` over RPC. Previously, we did not respect this argument.

This is done by saving the shapes as an ivalue list and recovering it as the type expected (`std::vector<std::vector<int>>` on the client). Test is added to ensure that remote ops have the same `input_shapes` as if the op were run locally.
ghstack-source-id: 112200516

Differential Revision: [D23591274](https://our.internmc.facebook.com/intern/diff/D23591274/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D23591274/)!
Closes #39969

This PR adds support for propagation of input shapes over the wire when the profiler is invoked with `record_shapes=True` over RPC. Previously, we did not respect this argument.

This is done by saving the shapes as an ivalue list and recovering it as the type expected (`std::vector<std::vector<int>>` on the client). Test is added to ensure that remote ops have the same `input_shapes` as if the op were run locally.

Differential Revision: [D23591274](https://our.internmc.facebook.com/intern/diff/D23591274/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D23591274/)!

[ghstack-poisoned]
rohan-varma added a commit that referenced this pull request Sep 17, 2020
Pull Request resolved: #44419

Closes #39969

This PR adds support for propagation of input shapes over the wire when the profiler is invoked with `record_shapes=True` over RPC. Previously, we did not respect this argument.

This is done by saving the shapes as an ivalue list and recovering it as the type expected (`std::vector<std::vector<int>>` on the client). Test is added to ensure that remote ops have the same `input_shapes` as if the op were run locally.
ghstack-source-id: 112320646

Differential Revision: [D23591274](https://our.internmc.facebook.com/intern/diff/D23591274/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D23591274/)!
@codecov
Copy link

codecov bot commented Sep 18, 2020

Codecov Report

❗ No coverage uploaded for pull request base (gh/rohan-varma/166/base@0c75e4b). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                    Coverage Diff                     @@
##             gh/rohan-varma/166/base   #44419   +/-   ##
==========================================================
  Coverage                           ?   68.04%           
==========================================================
  Files                              ?      393           
  Lines                              ?    50937           
  Branches                           ?        0           
==========================================================
  Hits                               ?    34659           
  Misses                             ?    16278           
  Partials                           ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0c75e4b...8772f81. Read the comment docs.

@pritamdamania87
Copy link
Contributor

Could you paste the before and after autograd profiler results to the PR summary so its easy to see the appropriate changes in the profiler output?

Copy link
Contributor

@pritamdamania87 pritamdamania87 left a comment

Choose a reason for hiding this comment

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

Unit test looks good to me, will let @ilia-cher sign off on the profiler.cpp changes.

@rohan-varma
Copy link
Contributor Author

Could you paste the before and after autograd profiler results to the PR summary so its easy to see the appropriate changes in the profiler output?

@pritamdamania87 The before/after of the RPC remote events are in the summary now.

Closes #39969

This PR adds support for propagation of input shapes over the wire when the profiler is invoked with `record_shapes=True` over RPC. Previously, we did not respect this argument.

This is done by saving the shapes as an ivalue list and recovering it as the type expected (`std::vector<std::vector<int>>` on the client). Test is added to ensure that remote ops have the same `input_shapes` as if the op were run locally.

Remote ops profiler output before (run with `group_by_input_shapes=True`):

```
rpc_sync#aten::add(worker1 -> worker2)#remote_op: aten::add        0.18%            67.229us         0.21%            76.449us         76.449us         1                2                []
rpc_sync#aten::add(worker1 -> worker2)#remote_op: aten::empty      0.03%            9.220us          0.03%            9.220us          9.220us          1                2                []
```

After:
```
rpc_sync#aten::add(worker1 -> worker2)#remote_op: aten::add        0.14%            91.001us         0.16%            102.094us        102.094us        1                2                [[100], [100], []]
rpc_sync#aten::add(worker1 -> worker2)#remote_op: aten::empty      0.02%            11.093us         0.02%            11.093us         11.093us         1                2                [[], [], [], [], [], []]
```

Differential Revision: [D23591274](https://our.internmc.facebook.com/intern/diff/D23591274/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D23591274/)!

[ghstack-poisoned]
rohan-varma added a commit that referenced this pull request Sep 18, 2020
Pull Request resolved: #44419

Closes #39969

This PR adds support for propagation of input shapes over the wire when the profiler is invoked with `record_shapes=True` over RPC. Previously, we did not respect this argument.

This is done by saving the shapes as an ivalue list and recovering it as the type expected (`std::vector<std::vector<int>>` on the client). Test is added to ensure that remote ops have the same `input_shapes` as if the op were run locally.
ghstack-source-id: 112390206

Differential Revision: [D23591274](https://our.internmc.facebook.com/intern/diff/D23591274/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D23591274/)!
shapesFromServer.reserve(shapeList.size());
for (size_t i = 0 ; i < shapeList.size(); ++i) {
std::vector<int64_t> s;
auto curShapesList = shapeList.get(i).toList();
Copy link
Contributor

Choose a reason for hiding this comment

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

should we also check isList here?

" elements to reconstruct Event.");

// Reconstruct input shapes from ivalues.
auto shapeListFromServer = ivalues.get(EventIValueIdx::SHAPES);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: could you remove mentions of server?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed all of the mentions.

Closes #39969

This PR adds support for propagation of input shapes over the wire when the profiler is invoked with `record_shapes=True` over RPC. Previously, we did not respect this argument.

This is done by saving the shapes as an ivalue list and recovering it as the type expected (`std::vector<std::vector<int>>` on the client). Test is added to ensure that remote ops have the same `input_shapes` as if the op were run locally.

Remote ops profiler output before (run with `group_by_input_shapes=True`):

```
rpc_sync#aten::add(worker1 -> worker2)#remote_op: aten::add        0.18%            67.229us         0.21%            76.449us         76.449us         1                2                []
rpc_sync#aten::add(worker1 -> worker2)#remote_op: aten::empty      0.03%            9.220us          0.03%            9.220us          9.220us          1                2                []
```

After:
```
rpc_sync#aten::add(worker1 -> worker2)#remote_op: aten::add        0.14%            91.001us         0.16%            102.094us        102.094us        1                2                [[100], [100], []]
rpc_sync#aten::add(worker1 -> worker2)#remote_op: aten::empty      0.02%            11.093us         0.02%            11.093us         11.093us         1                2                [[], [], [], [], [], []]
```

Differential Revision: [D23591274](https://our.internmc.facebook.com/intern/diff/D23591274/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D23591274/)!

[ghstack-poisoned]
rohan-varma added a commit that referenced this pull request Sep 24, 2020
Pull Request resolved: #44419

Closes #39969

This PR adds support for propagation of input shapes over the wire when the profiler is invoked with `record_shapes=True` over RPC. Previously, we did not respect this argument.

This is done by saving the shapes as an ivalue list and recovering it as the type expected (`std::vector<std::vector<int>>` on the client). Test is added to ensure that remote ops have the same `input_shapes` as if the op were run locally.
ghstack-source-id: 112822760

Differential Revision: [D23591274](https://our.internmc.facebook.com/intern/diff/D23591274/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D23591274/)!
Copy link
Contributor

@ilia-cher ilia-cher left a comment

Choose a reason for hiding this comment

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

LG!

Closes #39969

This PR adds support for propagation of input shapes over the wire when the profiler is invoked with `record_shapes=True` over RPC. Previously, we did not respect this argument.

This is done by saving the shapes as an ivalue list and recovering it as the type expected (`std::vector<std::vector<int>>` on the client). Test is added to ensure that remote ops have the same `input_shapes` as if the op were run locally.

Remote ops profiler output before (run with `group_by_input_shapes=True`):

```
rpc_sync#aten::add(worker1 -> worker2)#remote_op: aten::add        0.18%            67.229us         0.21%            76.449us         76.449us         1                2                []
rpc_sync#aten::add(worker1 -> worker2)#remote_op: aten::empty      0.03%            9.220us          0.03%            9.220us          9.220us          1                2                []
```

After:
```
rpc_sync#aten::add(worker1 -> worker2)#remote_op: aten::add        0.14%            91.001us         0.16%            102.094us        102.094us        1                2                [[100], [100], []]
rpc_sync#aten::add(worker1 -> worker2)#remote_op: aten::empty      0.02%            11.093us         0.02%            11.093us         11.093us         1                2                [[], [], [], [], [], []]
```

Differential Revision: [D23591274](https://our.internmc.facebook.com/intern/diff/D23591274/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D23591274/)!

[ghstack-poisoned]
rohan-varma added a commit that referenced this pull request Sep 26, 2020
Pull Request resolved: #44419

Closes #39969

This PR adds support for propagation of input shapes over the wire when the profiler is invoked with `record_shapes=True` over RPC. Previously, we did not respect this argument.

This is done by saving the shapes as an ivalue list and recovering it as the type expected (`std::vector<std::vector<int>>` on the client). Test is added to ensure that remote ops have the same `input_shapes` as if the op were run locally.
ghstack-source-id: 112977899

Differential Revision: [D23591274](https://our.internmc.facebook.com/intern/diff/D23591274/)

**NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D23591274/)!
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 23dfca8.

@facebook-github-bot facebook-github-bot deleted the gh/rohan-varma/166/head branch September 30, 2020 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants