With fixes, Back out "Back out "Selective meta programming preparation for prim ops""
Summary: Original commit changeset: b2c712a512a2
Test Plan: CI
Reviewed By: jiatongzhou
Differential Revision: D23477710
fbshipit-source-id: 177ee56a82234376b7a5c3fc33441f8acfd59fea