pytorch
4cb6add4 - [PT2][Quant] Use module partition for fused patterns (#102394)

Commit
1 year ago
[PT2][Quant] Use module partition for fused patterns (#102394) This diff introduces utility `find_sequential_partitions`. This utility allows one to specify sequential pattern of nn.Module/nn.functional and returns a list. Each item in the list contains a List[SourcePartition] that represents sequentially connected partitions that are of the pattern requested. For example `find_sequential_partitions(model, [nn.Conv2d, nn.ReLU])` will find all nn.Conv2d and nn.ReLU partitions that are sequentially connected. Furthmore, move to using `find_sequential_partitions` for conv_bn/conv_bn_relu for QAT. Differential Revision: [D45948057](https://our.internmc.facebook.com/intern/diff/D45948057/) **NOTE FOR REVIEWERS**: This PR has internal Meta-specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D45948057/)! Pull Request resolved: https://github.com/pytorch/pytorch/pull/102394 Approved by: https://github.com/jerryzh168
Author
Committer
Parents
Loading