-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Fix tracing slice/select with dynamic inputs #26549
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
Conversation
| static Variable applySelect(const Variable& self, int64_t dim, int64_t index, int64_t real_dim=0) { | ||
| if (index == 0 && dim == 0 && self.dim() == 0) { | ||
| static Variable applySelect(const Variable& self, int64_t dim, PyObject* index, int64_t real_dim=0) { | ||
| auto& var = THPVariable_Unpack(index); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think index is necessarily a Variable (Tensor) here. It might be a Python number for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, updated this
|
cc @houseroad for review |
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@pytorchbot rebase this please |
|
@pytorchbot seems not working, @neginraoof could you manually rebase this PR? |
|
@houseroad this is rebased. |
|
I am wondering why still so many test cases failing... Did you rebase to the current master? Our monitor shows all CI passing. |
|
@houseroad This is ready. There was a related failure in test_jit that I missed. I updated the jit test to skip opset 9 tests for DynamicSlice. (This is the op that's no longer supported with any backends) |
|
@pytorchbot retest this please |
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@pytorchbot retest this please |
|
Failure for data_workers_test.py does not look relevant. Will look into that. |
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
…torch into neraoof/traceSlice # Conflicts: # torch/onnx/symbolic_opset9.py
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@houseroad merged this pull request in d2eb08d. |
Summary: Fix Slice/Select trace arguments. This PR stashes arguments to functions in order to avoid tracing them as constants. This PR depends on a fix for select op in PR: pytorch#25273 Pull Request resolved: pytorch#26549 Reviewed By: hl475 Differential Revision: D17623851 Pulled By: houseroad fbshipit-source-id: ae314004266688d2c25c5bada2dcedbfc4f39c5b
Fix Slice/Select trace arguments. This PR stashes arguments to functions in order to avoid tracing them as constants.
This PR depends on a fix for select op in PR:
#25273