mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/71230 DBR quantization uses `torch.Tensor.as_subclass` frequently. When the quantized model is traced with `torch.jit.trace`, these calls appear in the resulting graph as `aten::alias`. This PR adds a pass to remove these calls from the graph, for two reasons: 1. ease of debugging (these calls do nothing) 2. less work for downstream passes (for example, converting to ONNX currently breaks if these alias calls are present) For now, we have to inline the graph in order for `aliasDb` to determine safety properly. In the future, we may choose to relax this if there is a need for it. Test Plan: Test plan is pretty basic for now, it can be improved in future PRs. ``` python test/test_quantization.py TestQuantizeDBR.test_jit_tracing_removes_aliases ``` Reviewed By: eellison Differential Revision: D33552387 Pulled By: vkuzo fbshipit-source-id: 681a33ddfff394a91e971263ac593afd93c5ea78 (cherry picked from commit 0f8412725d0c6fd9ef1072a50d4203465aa5d1f9) |
||
|---|---|---|
| .. | ||
| init.cpp | ||
| init.h | ||
| module_python.h | ||
| pybind_utils.cpp | ||
| pybind_utils.h | ||
| pybind.h | ||
| python_arg_flatten.cpp | ||
| python_arg_flatten.h | ||
| python_custom_class.cpp | ||
| python_custom_class.h | ||
| python_dict.cpp | ||
| python_dict.h | ||
| python_interpreter.cpp | ||
| python_ir.cpp | ||
| python_ir.h | ||
| python_ivalue.h | ||
| python_list.cpp | ||
| python_list.h | ||
| python_sugared_value.cpp | ||
| python_sugared_value.h | ||
| python_tracer.cpp | ||
| python_tracer.h | ||
| python_tree_views.cpp | ||
| python_tree_views.h | ||
| script_init.cpp | ||
| script_init.h | ||
| update_graph_executor_opt.cpp | ||
| update_graph_executor_opt.h | ||