Skip to content

Add a wrapper to wrap all optimization for mobile. #35227

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

Closed
wants to merge 4 commits into from

Conversation

kimishpatel
Copy link
Contributor

@kimishpatel kimishpatel commented Mar 23, 2020

Stack from ghstack:

Summary:
This wraps.

  1. Conv BN folding (not mobile specific)
  2. insert XNNPACK conv2d/Linear ops
  3. Remove prepacking ops.

Test Plan:
Checked via model transformation of one of the internal model.

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: D20603562

Summary:
This wraps.
1. Conv BN folding (not mobile specific)
2. insert XNNPACK conv2d/Linear ops
3. Remove prepacking ops.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

[ghstack-poisoned]
@kimishpatel kimishpatel requested a review from apaszke as a code owner March 23, 2020 19:42
kimishpatel added a commit that referenced this pull request Mar 23, 2020
Summary:
This wraps.
1. Conv BN folding (not mobile specific)
2. insert XNNPACK conv2d/Linear ops
3. Remove prepacking ops.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: bcb2048
Pull Request resolved: #35227
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Mar 23, 2020
@dr-ci
Copy link

dr-ci bot commented Mar 23, 2020

💊 CircleCI build failures summary and remediations

As of commit 4188eac (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no CircleCI failures 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.

See how this bot performed.

This comment has been revised 19 times.

@kimishpatel kimishpatel requested a review from dreiss March 23, 2020 20:30
@dreiss
Copy link
Contributor

dreiss commented Mar 23, 2020

Is there a strong reason to write this wrapper in C++? Putting it in Python would make it easier to experiment with.

@kimishpatel
Copy link
Contributor Author

Is there a strong reason to write this wrapper in C++? Putting it in Python would make it easier to experiment with.

So each individual step of the wrapper pass is also available as a python binding. BatchNormConv2d fusion, freezing, insertPrePackedOp, FoldPrePackedOps.

This is just sugar around it.

@dreiss
Copy link
Contributor

dreiss commented Mar 23, 2020

My vote, then, would be to just do the wrapper in Python as well, to make further work on it easier.

@kimishpatel
Copy link
Contributor Author

My vote, then, would be to just do the wrapper in Python as well, to make further work on it easier.

My preference is to keep in the _jit_pass_* space, since it is a JIT pass, wrapper around JIT passes to be precise, and should bleong there. If you want to keep it in python, I need to find an appropriate place for it (maybe torch.nn.utils..?), but in what ways, keeping it in python makes further work on it easier (not having to recompile)?

Summary:
This wraps.
1. Conv BN folding (not mobile specific)
2. insert XNNPACK conv2d/Linear ops
3. Remove prepacking ops.

Test Plan:
Checked via model transformation of one of the internal model.

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
kimishpatel added a commit that referenced this pull request Mar 24, 2020
Summary:
This wraps.
1. Conv BN folding (not mobile specific)
2. insert XNNPACK conv2d/Linear ops
3. Remove prepacking ops.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: fcccfd6
Pull Request resolved: #35227
Summary:
This wraps.
1. Conv BN folding (not mobile specific)
2. insert XNNPACK conv2d/Linear ops
3. Remove prepacking ops.

Test Plan:
Checked via model transformation of one of the internal model.

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
kimishpatel added a commit that referenced this pull request Mar 24, 2020
Summary:
This wraps.
1. Conv BN folding (not mobile specific)
2. insert XNNPACK conv2d/Linear ops
3. Remove prepacking ops.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 6d87bc3
Pull Request resolved: #35227
Summary:
This wraps.
1. Conv BN folding (not mobile specific)
2. insert XNNPACK conv2d/Linear ops
3. Remove prepacking ops.

Test Plan:
Checked via model transformation of one of the internal model.

Reviewers:

Subscribers:

Tasks:

Tags:

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

[ghstack-poisoned]
kimishpatel added a commit that referenced this pull request Mar 25, 2020
Summary:
This wraps.
1. Conv BN folding (not mobile specific)
2. insert XNNPACK conv2d/Linear ops
3. Remove prepacking ops.

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: 1487183
Pull Request resolved: #35227
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in dc2c4d0.

@facebook-github-bot facebook-github-bot deleted the gh/kimishpatel/7/head branch March 29, 2020 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merged oncall: jit Add this issue/PR to JIT oncall triage queue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants