fix: Bugfix in convNd_to_convolution lowering pass by gs-olive · Pull Request #1693 · pytorch/TensorRT (original) (raw)
Description
- Lowering pass did not respect
prim::If
block boundaries - Refactor convNd implementation to use more precise guard-insert paradigm instead of subgraph rewriting
- Write general function to apply for all convolution replacements
- When replacing a subgraph that occurs within an "If" block, the rewriter places the actual logic of the code outside of the block, so the rewrite makes the code execute both the "if" and the "else" path regardless of what the condition is
- Add regression test case to validate refactoring on
aten::conv1d
Addresses first bug in #1597
Type of change
- Bug fix (non-breaking change which fixes an issue)
Checklist:
- [ x ] My code follows the style guidelines of this project (You can use the linters)
- [ x ] I have performed a self-review of my own code
- [ x ] I have commented my code, particularly in hard-to-understand areas and hacks
- [ x ] I have made corresponding changes to the documentation
- [ x ] I have added tests to verify my fix or my feature
- [ x ] New and existing unit tests pass locally with my changes
- [ x ] I have added the relevant labels to my PR in so that relevant reviewers are notified
- Lowering pass did not respect
prim::If
block boundaries - Refactor convNd implementation to use more precise guard-insert paradigm instead of subgraph rewriting
- Write general function to apply for all convolution replacements
- When replacing a subgraph that occurs within an "If" block, the rewriter places the actual logic of the code outside of the block, so the rewrite makes the code execute both the "if" and the "else" path regardless of what the condition is
- Add a test case to validate refactoring on conv1d
- Partitioning test incorrectly expected 1 conditional engine, but got 2
since
log_sigmoid
operator is not currently supported