Cleanup QAT api
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/190 Currently there is some fragmentation in export for how to apply convert logic in various mode. `prepare_for_quant_convert` is only called in non eager modes and the logic in eager mode is not customizable. This diff unify the `prepare_for_quant_convert` code path for all quantization modes. Also in this diff we rename `_non_qat_to_qat_state_dict_map`, that is use in qat checkpointer to be publish var `non_qat_to_qat_state_dict_map` and allow models to populate it with custom mapping. This is useful in cases where the param mapping between the non qat model and the qat model cannot be inferred definitely (see note in https://fburl.com/code/9rx172ht) and have some ambiguity that can only be resolved by the model logic. Reviewed By: wat3rBro Differential Revision: D34741217 fbshipit-source-id: 38edfec64200ec986ffe4f3d47f527cb6a3fb5e9
Showing
Please register or sign in to comment