Skip to content

Fix NativeFunctions.h for c10-full ops#46090

Closed
smessmer wants to merge 5 commits intogh/smessmer/259/basefrom
gh/smessmer/259/head
Closed

Fix NativeFunctions.h for c10-full ops#46090
smessmer wants to merge 5 commits intogh/smessmer/259/basefrom
gh/smessmer/259/head

Conversation

@smessmer
Copy link
Copy Markdown
Contributor

@smessmer smessmer commented Oct 9, 2020

Stack from ghstack:

Differential Revision: D24219942

@dr-ci
Copy link
Copy Markdown

dr-ci bot commented Oct 9, 2020

💊 CI failures summary and remediations

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


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

Extra GitHub checks: 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 on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 13 times.

@smessmer smessmer requested review from bhosmer and ezyang October 9, 2020 15:34
else:
assert local.use_c10_dispatcher() is UseC10Dispatcher.with_codegenerated_unboxing_wrapper
la = legacy_dispatcher.argument(a)
assert len(la) == 1, "TensorOptions arguments not supported"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IIUC, the real invariant here is that when local.use_c10_dispatcher() is UseC10Dispatcher.with_codegenerated_unboxing_wrapper then legacy_dispatcher.argument(a) is guaranteed to return a single element; it has nothing to do with TensorOptions arguments not being supported.

Although this is ok to leave up to personal preference, I think a better way to handle the problem here is to split legacy_dispatcher.argument into two functions: one that is guaranteed to return only a single LegacyDispatcherArgument (but is only valid for with_codegenerated_unboxing_wrapper), and then another one which is valid in all cases but might return a sequence.

name='pin_memory',
default='{}',
argument=a,
)]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

And now we pray that this doesn't need to be packed (in the same way CppArguments need it)......

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 9, 2020

Codecov Report

❗ No coverage uploaded for pull request base (gh/smessmer/259/base@cdde1f3). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                   Coverage Diff                   @@
##             gh/smessmer/259/base   #46090   +/-   ##
=======================================================
  Coverage                        ?   68.24%           
=======================================================
  Files                           ?      410           
  Lines                           ?    53639           
  Branches                        ?        0           
=======================================================
  Hits                            ?    36607           
  Misses                          ?    17032           
  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 cdde1f3...e15b09d. Read the comment docs.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 4534bf5.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 4534bf5.

@gchanan
Copy link
Copy Markdown
Contributor

gchanan commented Oct 14, 2020

"Fix" -- what's broken?

@facebook-github-bot facebook-github-bot deleted the gh/smessmer/259/head branch October 17, 2020 14:15
EmilioRivera pushed a commit to EmilioRivera/pytorch-bugs that referenced this pull request Oct 18, 2020
Pull Request resolved: pytorch/pytorch#46090


ghstack-source-id: 114269272

Differential Revision: [D24219942](https://our.internmc.facebook.com/intern/diff/D24219942/)
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.

4 participants