pytorch icon indicating copy to clipboard operation
pytorch copied to clipboard

Refactor dtype propagation

Open eellison opened this issue 3 months ago • 1 comments

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 the boolean_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

eellison avatar Nov 07 '24 00:11 eellison