Skip to content

[PyTorch] check isValidUnboxed() in the dispatcher#51247

Closed
swolchok wants to merge 4 commits intogh/swolchok/96/basefrom
gh/swolchok/96/head
Closed

[PyTorch] check isValidUnboxed() in the dispatcher#51247
swolchok wants to merge 4 commits intogh/swolchok/96/basefrom
gh/swolchok/96/head

Conversation

@swolchok
Copy link
Copy Markdown
Contributor

@swolchok swolchok commented Jan 27, 2021

Stack from ghstack:

See code comment for explanation.

This measures neutral compared to the previous diff with perf stat when running on a
benchmark that calls empty in a loop. I think that we should commit it
anyway because:

  1. I have previously seen it make a difference when applied earlier in
    the stack.
  2. This makes sense both on principle and via inspecting output
    assembly: we avoid having to touch the boxed kernel at all (usually)
    and instead use the unboxed kernel for both the validity check in
    OperatorEntry::lookup and the actual KernelFunction::call.

Differential Revision: D26113650

See code comment for explanation.

This measures neutral compared to the previous diff with `perf stat` when running on a
benchmark that calls empty in a loop. I think that we should commit it
anyway because:
1) I have previously seen it make a difference when applied earlier in
the stack.
2) This makes sense both on principle and via inspecting output
assembly: we avoid having to touch the boxed kernel at all (usually)
and instead use the unboxed kernel for both the validity check in
`OperatorEntry::lookup` and the actual `KernelFunction::call`.

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

[ghstack-poisoned]
@facebook-github-bot
Copy link
Copy Markdown
Contributor

facebook-github-bot commented Jan 27, 2021

💊 CI failures summary and remediations

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


  • 1/1 failures possibly* introduced in this PR
    • 1/1 non-CircleCI failure(s)

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.

… the dispatcher"

See code comment for explanation.

This measures neutral compared to the previous diff with `perf stat` when running on a
benchmark that calls empty in a loop. I think that we should commit it
anyway because:
1) I have previously seen it make a difference when applied earlier in
the stack.
2) This makes sense both on principle and via inspecting output
assembly: we avoid having to touch the boxed kernel at all (usually)
and instead use the unboxed kernel for both the validity check in
`OperatorEntry::lookup` and the actual `KernelFunction::call`.

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

[ghstack-poisoned]
swolchok added a commit that referenced this pull request Jan 27, 2021
Pull Request resolved: #51247

See code comment for explanation.

This measures neutral compared to the previous diff with `perf stat` when running on a
benchmark that calls empty in a loop. I think that we should commit it
anyway because:
1) I have previously seen it make a difference when applied earlier in
the stack.
2) This makes sense both on principle and via inspecting output
assembly: we avoid having to touch the boxed kernel at all (usually)
and instead use the unboxed kernel for both the validity check in
`OperatorEntry::lookup` and the actual `KernelFunction::call`.
ghstack-source-id: 120526484

Differential Revision: [D26113650](https://our.internmc.facebook.com/intern/diff/D26113650/)
Copy link
Copy Markdown
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

This is fine. But @smessmer, now that everything is c10 full, don't we guarantee boxed is valid everywhere? So we ought to tighten the invariants here.

See code comment for explanation.

This measures neutral compared to the previous diff with `perf stat` when running on a
benchmark that calls empty in a loop. I think that we should commit it
anyway because:
1) I have previously seen it make a difference when applied earlier in
the stack.
2) This makes sense both on principle and via inspecting output
assembly: we avoid having to touch the boxed kernel at all (usually)
and instead use the unboxed kernel for both the validity check in
`OperatorEntry::lookup` and the actual `KernelFunction::call`.

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

[ghstack-poisoned]
See code comment for explanation.

This measures neutral compared to the previous diff with `perf stat` when running on a
benchmark that calls empty in a loop. I think that we should commit it
anyway because:
1) I have previously seen it make a difference when applied earlier in
the stack.
2) This makes sense both on principle and via inspecting output
assembly: we avoid having to touch the boxed kernel at all (usually)
and instead use the unboxed kernel for both the validity check in
`OperatorEntry::lookup` and the actual `KernelFunction::call`.

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

[ghstack-poisoned]
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 30, 2021

Codecov Report

Merging #51247 (0f52fcf) into gh/swolchok/96/base (6eccd63) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@                 Coverage Diff                  @@
##           gh/swolchok/96/base   #51247   +/-   ##
====================================================
  Coverage                80.84%   80.85%           
====================================================
  Files                     1938     1938           
  Lines                   211170   211171    +1     
====================================================
+ Hits                    170725   170738   +13     
+ Misses                   40445    40433   -12     

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 9877777.

@facebook-github-bot facebook-github-bot deleted the gh/swolchok/96/head branch February 5, 2021 15:22
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Pull Request resolved: pytorch#51247

See code comment for explanation.

This measures neutral compared to the previous diff with `perf stat` when running on a
benchmark that calls empty in a loop. I think that we should commit it
anyway because:
1) I have previously seen it make a difference when applied earlier in
the stack.
2) This makes sense both on principle and via inspecting output
assembly: we avoid having to touch the boxed kernel at all (usually)
and instead use the unboxed kernel for both the validity check in
`OperatorEntry::lookup` and the actual `KernelFunction::call`.
ghstack-source-id: 120697497

Test Plan: Aforementioned perf measurement

Reviewed By: ezyang

Differential Revision: D26113650

fbshipit-source-id: 8448c4ed764d477f63eb7c0f6dd87b1fc0228b73
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants