Fix tracing slice/select with dynamic inputs#26549
Fix tracing slice/select with dynamic inputs#26549neginraoof wants to merge 50 commits intopytorch:masterfrom
Conversation
…oof/traceSlice
…d by ORT anymore.
| 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.
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.
Yes, updated this
|
cc @houseroad for review |
…oof/traceSlice
facebook-github-bot
left a comment
There was a problem hiding this comment.
@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? |
…torch into neraoof/traceSlice
…oof/traceSlice
|
@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.
@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.
@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
…oof/traceSlice
facebook-github-bot
left a comment
There was a problem hiding this comment.
@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