Dramatically improve op_clamp build time (#5784)
Summary: Pull Request resolved: https://github.com/pytorch/executorch/pull/5784 Instead of building `O(|CTYPE_IN| * |CTYPE_MIN| * |CTYPE_MAX| * |CTYPE_OUT|)` kernel code (where |T| means the number of possibilities for type T), we build `O((|CTYPE_IN| + |CTYPE_MIN| + |CTYPE_MAX| + |CTYPE_COMMON|) * |CTYPE_OUT|)` kernel code. (Concretely, `ET_SWITCH_REALHB_TYPES` has 9 possibilities, so I estimate that we went from 9**4 = 6561 template instantiations to 9 * 4 * 9 = 324 instantiations, or a 20x reduction.) ghstack-source-id: 246132260 Reviewed By: manuelcandales Differential Revision: D63681034 fbshipit-source-id: 41891b8fbdfa0d6f6126342febf59e6aae5b4876
S
Scott Wolchok committed
aa8a93c3353eef99010f20b26dd1d0ce4c5222dc
Parent: 9c3ebfe
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 10/3/2024, 11:54:20 PM