Skip to content

[quantization] Add some support for 3d operations#50003

Closed
dmenig wants to merge 3 commits intopytorch:masterfrom
dmenig:3d_quantization
Closed

[quantization] Add some support for 3d operations#50003
dmenig wants to merge 3 commits intopytorch:masterfrom
dmenig:3d_quantization

Conversation

@dmenig
Copy link
Copy Markdown
Collaborator

@dmenig dmenig commented Jan 2, 2021

Fixes #50002

The last commit adds tests for 3d conv with the SubModelFusion and SubModelWithoutFusion classes.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

Hi @hyperfraise!

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.

In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link
Copy Markdown
Contributor

facebook-github-bot commented Jan 2, 2021

💊 CI failures summary and remediations

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


  • 1/2 failures possibly* introduced in this PR
    • 1/1 non-scanned failure(s)
  • 1/2 broken upstream at merge base d90d724 from Mar 02 until Mar 03

🚧 1 fixed upstream failure:

These were probably caused by upstream breakages that were already fixed.

Please rebase on the viable/strict branch (expand for instructions)

If your commit is older than viable/strict, run these commands:

git fetch https://github.com/pytorch/pytorch viable/strict
git rebase FETCH_HEAD

ci.pytorch.org: 1 failed


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 to the (internal) Dr. CI Users group.

@dmenig dmenig force-pushed the 3d_quantization branch 2 times, most recently from 57b6b3e to 39ad9a4 Compare January 2, 2021 18:59
@dmenig dmenig changed the title [quantization] Add some support for 3d operations [WIP][quantization] Add some support for 3d operations Jan 2, 2021
@dmenig dmenig force-pushed the 3d_quantization branch 9 times, most recently from 3f03c28 to 5b7543f Compare January 3, 2021 16:42
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 3, 2021

Codecov Report

Merging #50003 (68579f6) into master (0c45533) will decrease coverage by 0.21%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master   #50003      +/-   ##
==========================================
- Coverage   80.80%   80.59%   -0.22%     
==========================================
  Files        1972     1957      -15     
  Lines      216286   214523    -1763     
==========================================
- Hits       174774   172888    -1886     
- Misses      41512    41635     +123     

@dmenig dmenig changed the title [WIP][quantization] Add some support for 3d operations [quantization] Add some support for 3d operations Jan 4, 2021
@ezyang ezyang requested a review from jerryzh168 January 5, 2021 14:31
@ezyang ezyang added oncall: quantization Quantization support in PyTorch triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Jan 5, 2021
@jerryzh168
Copy link
Copy Markdown
Contributor

Could you separate the formatting changes and the feature?

@jerryzh168
Copy link
Copy Markdown
Contributor

can you update the test here: https://github.com/pytorch/pytorch/blob/master/test/quantization/test_quantize_fx.py#L397 (add a 3 to the list)

@dmenig
Copy link
Copy Markdown
Collaborator Author

dmenig commented Jan 5, 2021

Could you separate the formatting changes and the feature?

Thanks for the review ! They are separated in different commits; Do you mean opening a new PR ?

@dmenig
Copy link
Copy Markdown
Collaborator Author

dmenig commented Jan 5, 2021

can you update the test here: https://github.com/pytorch/pytorch/blob/master/test/quantization/test_quantize_fx.py#L397 (add a 3 to the list)

I will.

@jerryzh168
Copy link
Copy Markdown
Contributor

Could you separate the formatting changes and the feature?

Thanks for the review ! They are separated in different commits; Do you mean opening a new PR ?

I see. ideally it should be a new PR I think, but separate commits probably works as well.

Copy link
Copy Markdown
Contributor

@jerryzh168 jerryzh168 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for adding this!

@dmenig
Copy link
Copy Markdown
Collaborator Author

dmenig commented Jan 5, 2021

Looks good, thanks for adding this!

Wait there's the rocm test I can't pass, do you see why ? I can't figure why

Copy link
Copy Markdown
Contributor

@jerryzh168 jerryzh168 left a comment

Choose a reason for hiding this comment

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

you will need to update L337

"call_function", torch.nn.functional.conv2d, args, kwargs

of torch/quantization/fx/quantization_patterns.py as well I think.
could you also add a test for conv3d in https://github.com/pytorch/pytorch/blob/master/test/quantization/test_quantize_fx.py#L233?

@dmenig
Copy link
Copy Markdown
Collaborator Author

dmenig commented Feb 2, 2021

@albanD @mingzhe09088 @mrshenli @pritamdamania87 @rohan-varma @zhaojuanmao @jerryzh168 @ezyang @fmassa @glaringlee @soumith
It'd be great if you could review this, please, I'm having to solve conflicts quite often.

Comment thread torch/quantization/fx/quantization_patterns.py Outdated
Copy link
Copy Markdown
Contributor

@jerryzh168 jerryzh168 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@jerryzh168 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Comment thread aten/src/ATen/native/metal/MetalPrepackOpRegister.cpp Outdated
Comment thread aten/src/ATen/native/metal/MetalPrepackOpRegister.cpp Outdated
@dmenig dmenig force-pushed the 3d_quantization branch 4 times, most recently from 0ae48a8 to e431ba5 Compare February 10, 2021 14:35
Comment thread aten/src/ATen/native/metal/MetalPrepackOpRegister.cpp Outdated
Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@jerryzh168 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@dmenig dmenig force-pushed the 3d_quantization branch 2 times, most recently from 0b42d0f to 1f1d4f4 Compare February 12, 2021 13:09
@raghuramank100
Copy link
Copy Markdown
Contributor

cc @jerryzh168 Is this PR ready to land?

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@jerryzh168 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@jerryzh168
Copy link
Copy Markdown
Contributor

Sorry @hyperfraise for the late response, there were still some internal errors (in phabricator) in aten/src/ATen/native/metal/MetalPrepackOpRegister.cpp:

unknown type name 'Conv3dOpContext'; did you mean 'Conv2dOpContext'?
fbcode/caffe2/aten/src/ATen/native/metal/MetalPrepackOpContext.h:20:7: 'Conv2dOpContext' declared here
class Conv2dOpContext : public torch::jit::CustomClassHolder {


Linter (CLANGTIDY)raised a clang-diagnostic-error error online 120-
no member named 'prod_intlist' in namespace 'at'

cc @xta0 is there a way that we can compile metal in OSS to make sure it works?

@jerryzh168
Copy link
Copy Markdown
Contributor

Hi @hyperfraise could you revert the metal changes? we can add it internal if it's needed. the ci/clang errors are only visible internally so it's hard to figure out what to do in oss.

@dmenig
Copy link
Copy Markdown
Collaborator Author

dmenig commented Mar 3, 2021

Hi @hyperfraise could you revert the metal changes? we can add it internal if it's needed. the ci/clang errors are only visible internally so it's hard to figure out what to do in oss.

Ofc ! Let's drop them.

@dmenig
Copy link
Copy Markdown
Collaborator Author

dmenig commented Mar 3, 2021

I rebased with your suggestions. It seems there's an unrelated failure in the CI, so you can still review.

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@jerryzh168 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@jerryzh168 merged this pull request in f918597.

@jerryzh168
Copy link
Copy Markdown
Contributor

@hyperfraise sorry for the long delay, it's finally landed!

@dmenig
Copy link
Copy Markdown
Collaborator Author

dmenig commented Mar 11, 2021

@hyperfraise sorry for the long delay, it's finally landed!

Nothing undeserved ^^ Glad to open the next PR if the issue mandates one.

Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed Merged oncall: quantization Quantization support in PyTorch open source triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for fusing ConvBnReLU3d

7 participants