pytorch
b7d58745 - dbr quant overhead[6/x]: remove unneeded isinstance checks in `op_convert_before_hook` (#68371)

Commit
3 years ago
dbr quant overhead[6/x]: remove unneeded isinstance checks in `op_convert_before_hook` (#68371) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/68371 `isinstance` has some overhead, changing the code in `op_convert_before_hook` to use the information calculate during tracing instead which is cheaper. Test Plan: ``` python test/test_quantization.py TestQuantizeDBR ``` function level benchmarking ``` // MobileNetV2, 1x3x224x224 input, % of time spent by function during DBR convert // before op_convert_before_hook = 3.55% isinstance = 1.62% // after op_convert_before_hook = 2.89% ``` Reviewed By: jerryzh168 Differential Revision: D32463757 Pulled By: vkuzo fbshipit-source-id: 129efe9c279a41f55b8bfd09132e21c0066298a6
Author
Parents
Loading