Skip to content

Conversation

@neginraoof
Copy link
Contributor

@neginraoof neginraoof commented Sep 20, 2019

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

@neginraoof neginraoof requested a review from apaszke as a code owner September 20, 2019 17:26
@pytorchbot pytorchbot added oncall: jit Add this issue/PR to JIT oncall triage queue module: autograd Related to torch.autograd, and the autograd engine in general module: onnx Related to torch.onnx module: pybind Related to our Python bindings / interactions with other Python libraries labels Sep 20, 2019
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);
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, updated this

@neginraoof neginraoof changed the title Neraoof/trace slice Fix tracing slice/select with dynamic inputs Sep 22, 2019
@neginraoof
Copy link
Contributor Author

cc @houseroad for review

@yf225 yf225 added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Sep 25, 2019
Copy link
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.

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

@neginraoof
Copy link
Contributor Author

@pytorchbot rebase this please

@houseroad
Copy link
Member

@pytorchbot seems not working, @neginraoof could you manually rebase this PR?

@neginraoof
Copy link
Contributor Author

@houseroad this is rebased.

@houseroad
Copy link
Member

I am wondering why still so many test cases failing... Did you rebase to the current master? Our monitor shows all CI passing.

@neginraoof
Copy link
Contributor Author

neginraoof commented Oct 17, 2019

@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)

@neginraoof
Copy link
Contributor Author

@pytorchbot retest this please

Copy link
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.

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

@neginraoof
Copy link
Contributor Author

@pytorchbot retest this please

@neginraoof
Copy link
Contributor Author

Failure for data_workers_test.py does not look relevant. Will look into that.

Copy link
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.

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

Copy link
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.

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

@facebook-github-bot
Copy link
Contributor

@houseroad merged this pull request in d2eb08d.

thiagocrepaldi pushed a commit to thiagocrepaldi/pytorch that referenced this pull request Feb 4, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: autograd Related to torch.autograd, and the autograd engine in general module: onnx Related to torch.onnx module: pybind Related to our Python bindings / interactions with other Python libraries module: third_party oncall: jit Add this issue/PR to JIT oncall triage queue 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.

9 participants