mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Summary: This diff adds a way to: - clone previously observed method - Add calls to observer's calculate_qparams methods - Extract the scale and zero point - Use them to insert quant dequant nodes Now for forward method we have - observe_forward - quantize_forward observe_forward is used post training to observer statistics. In the case of dynamic PTQ this requires just running that method once to update weight observer statistics. quantize_forward method will be used to use the observer statistics to calculate quantization parameters and apply that to quant dequant op. Subsequent diffs will replace dequant + op with their quantized op counter parts and replace quantize ops with relevant packed params class where possible Test Plan: To be written Reviewers: Subscribers: Tasks: Tags: Differential Revision: [D38771419](https://our.internmc.facebook.com/intern/diff/D38771419) Pull Request resolved: https://github.com/pytorch/pytorch/pull/83570 Approved by: https://github.com/jerryzh168 |
||
|---|---|---|
| .. | ||
| 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 | ||