[pytorch] move force schema registration output into a separate file (#36284)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/36284
ATen/gen.py's `force_schema_registration` flag was added in #34622 to unblock c10 boxing for custom build,
as full-JIT frontend expects certain op schemas are always registered (the actual op implementation can be
skipped if it's not used).
The flag didn't work together with `per_op_registration` flag, which was added for FB BUCK selective build.
This PR made it work with `per_op_registration` flag, by moving schema registrations to a separate file.
This way, internal full-JIT can include the new source file while lite-JIT can ignore it. OSS custom build
should still work as before.
Updated table of codegen flags and 5 build configurations that are related to mobile:
```
+--------------------------------------+-----------------------------------------------------------------------------+--------------------------------------------+
| | Open Source | FB BUCK |
+--------------------------------------+---------------------+---------------------------+---------------------------+---------------+----------------------------+
| | Default Build | Custom Build w/ Stat-Disp | Custom Build w/ Dyna-Disp | Full-JIT | Lite-JIT |
+--------------------------------------+---------------------+---------------------------+---------------------------+---------------+----------------------------+
| Dispatch Type | Static | Static | Dynamic | Dynamic | Dynamic |
+--------------------------------------+---------------------+---------------------------+---------------------------+---------------+----------------------------+
| ATen/gen.py | | | | | |
+--------------------------------------+---------------------+---------------------------+---------------------------+---------------+----------------------------+
| --op_registration_whitelist | unset | used root ops | closure(used root ops) | unset | closure(possibly used ops) |
| --backend_whitelist | CPU Q-CPU | CPU Q-CPU | CPU Q-CPU | CPU Q-CPU | CPU Q-CPU |
| --per_op_registration | false | false | false | true | true |
| --force_schema_registration | false | true | true | true | true (output unused) |
+--------------------------------------+---------------------+---------------------------+---------------------------+---------------+----------------------------+
| tools/setup_helpers/generate_code.py | | | | | |
+--------------------------------------+---------------------+---------------------------+---------------------------+---------------+----------------------------+
| --disable-autograd | true | true | true | false | WIP |
| --selected-op-list-path | file(used root ops) | file(used root ops) | file(used root ops) | unset | unset |
| --selected-op-list (WIP) | unset | unset | unset | unset | used root ops |
| --force_schema_registration (WIP) | false | true | true | true | false |
+--------------------------------------+---------------------+---------------------------+---------------------------+---------------+----------------------------+
```
ghstack-source-id: 101840182
Test Plan:
- check OSS CI;
- patch D20577433 on top of this change to make sure test passes on it;
- check mobile build size bot;
Differential Revision: D20932484
fbshipit-source-id: 5028a6f90f2c7ee66fc70c562643b536a32b4d33