[RFC] Generate generated_unboxing_wrappers_everything.cpp for unboxing wrappers codegen to aid debugging (#45872)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/45872

`VariableType_N.cpp` is generated in a sharded manner to speed up compilationt time. Same for `generated_unboxing_wrappers_N.cpp`. However, `VariableTypeEverything.cpp` exists, but `generated_unboxing_wrappers_everything.cpp` does not. These files have all the registration/implementation code in them for easier debugging of codegen logic.

This diff adds `generated_unboxing_wrappers_everything.cpp`.

ghstack-source-id: 113606771

Test Plan: Build + CI

Reviewed By: iseeyuan

Differential Revision: D24124405

fbshipit-source-id: 1f6c938105e17cd4b14502978483a1b178c777dd
This commit is contained in:
Dhruv Matani 2020-10-13 15:42:17 -07:00 committed by Facebook GitHub Bot
parent 5c67cc7a9e
commit 6ef41953e6

View File

@ -21,6 +21,7 @@ torch/csrc/jit/generated/
import argparse
import re
from itertools import groupby
from functools import reduce
from ..autograd.gen_autograd import load_aten_declarations
from ..autograd.gen_autograd import RETURNS_VIEWS_OF_INPUT
from ..autograd.utils import CodeTemplate, write, is_out_variant, op_name_without_overload
@ -496,6 +497,15 @@ def gen_unboxing_wrappers(
}
write(out, 'generated_unboxing_wrappers_%d.cpp' % i, GENERATED_UNBOXING_WRAPPERS_CPP, env)
all_shards = reduce(
lambda lhs, rhs: lhs + rhs,
shards,
)
env = {
'constructors': all_shards,
}
write(out, 'generated_unboxing_wrappers_everything.cpp', GENERATED_UNBOXING_WRAPPERS_CPP, env)
default_map = {'{}': 'None', 'nullptr': 'None', 'c10::nullopt': 'None'}