pytorch
pytorch copied to clipboard
Refactor dtype propagation
Stack from ghstack (oldest at bottom):
- #140057
- -> #139945
- #139944
A couple changes.
-
Tries to reuse dtype propagation rules that were already registered in inductor. These were present both with
pointwise_overrides_data
and theboolean_ops
list. Additionally, the registration of pointwise ops already specified dtype propagation rules. Saves those registrations and reuses them later. -
Factors out
get_promoted_dtype
which uses functools.lru_cache to take in non - CSEVariable args because those will not work with the functools cache.
Tests get added later in the stack when everything is implemented.
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang @aakhundov