Convert scalar to tensor before quantizer annoate
:link: Helpful Links
:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/2958
- :page_facing_up: Preview Python docs built from this PR
Note: Links to docs will display an error until the docs builds have been completed.
:x: 2 New Failures, 1 Unrelated Failure
As of commit de04834d9e8b8ab9bc7c5847368f16a3b16a3eca with merge base e733f2db37fba68f61211a942d9cf272f67f2f83 ():
NEW FAILURES - The following jobs have failed:
-
pull / test-pybind-build-linux (cmake) / linux-job (gh)
RuntimeError: Command docker exec -t e553befb8743e641428c952266a7e1ad03a1b5f79bb487d23a4eef4c3c6721fb /exec failed with exit code 1 -
pull / unittest / macos (buck2) / macos-job (gh)
RuntimeError: Command bash /Users/ec2-user/runner/_work/_temp/exec_script failed with exit code 1
BROKEN TRUNK - The following job failed but were present on the merge base:
👉 Rebase onto the `viable/strict` branch to avoid these failures
-
Lint / lintrunner / linux-job (gh)
>>> Lint for backends/vulkan/test/op_tests/utils/codegen.py:
This comment was automatically generated by Dr. CI and updates every 15 minutes.
This pull request was exported from Phabricator. Differential Revision: D55946527
@shewu-quic @haowhsu-quic
This pull request was exported from Phabricator. Differential Revision: D55946527
It seems to convert the scalar node of the binary op into a tensor node and allow the node to be quantized. Maybe the following two passes are also to achieve this thing. https://github.com/pytorch/executorch/blob/d761f99f6fc952975835f4807a12319c121c4b90/backends/qualcomm/passes/annotate_and_quant_scalar.py#L19 https://github.com/pytorch/executorch/blob/d761f99f6fc952975835f4807a12319c121c4b90/backends/qualcomm/passes/convert_binary_op_with_scalar.py#L15
It seems to convert the scalar node of the binary op into a tensor node and allow the node to be quantized. Maybe the following two passes are also to achieve this thing.
https://github.com/pytorch/executorch/blob/d761f99f6fc952975835f4807a12319c121c4b90/backends/qualcomm/passes/annotate_and_quant_scalar.py#L19
https://github.com/pytorch/executorch/blob/d761f99f6fc952975835f4807a12319c121c4b90/backends/qualcomm/passes/convert_binary_op_with_scalar.py#L15
Oh I see what's going. The convert_binary_op_with_scalar pass runs after quantization process, however we need to run this pass before the quantizer starts annotating, otherwise the scalar may not have an accurate quantization params.