pytorch/torch/csrc/jit/python
jjsjann123 c11b301bcd [NVFUSER] refactor nvfuser build (#89621)
This PR is the first step towards refactors the build for nvfuser in order to have the coegen being a standalone library.

Contents inside this PR:
1. nvfuser code base has been moved to `./nvfuser`, from `./torch/csrc/jit/codegen/cuda/`, except for registration code for integration (interface.h/interface.cpp)
2. splits the build system so nvfuser is generating its own `.so` files. Currently there are:
    - `libnvfuser_codegen.so`, which contains the integration, codegen and runtime system of nvfuser
    - `nvfuser.so`, which is nvfuser's python API via pybind. Python frontend is now exposed via `nvfuser._C.XXX` instead of `torch._C._nvfuser`
3. nvfuser cpp tests is currently being compiled into `nvfuser_tests`
4. cmake is refactored so that:
    - nvfuser now has its own `CMakeLists.txt`, which is under `torch/csrc/jit/codegen/cuda/`.
    - nvfuser backend code is not compiled inside `libtorch_cuda_xxx` any more
    - nvfuser is added as a subdirectory under `./CMakeLists.txt` at the very end after torch is built.
    - since nvfuser has dependency on torch, the registration of nvfuser at runtime is done via dlopen (`at::DynamicLibrary`). This avoids circular dependency in cmake, which will be a nightmare to handle. For details, look at `torch/csrc/jit/codegen/cuda/interface.cpp::LoadingNvfuserLibrary`

Future work that's scoped in following PR:
- Currently since nvfuser codegen has dependency on torch, we need to refactor that out so we can move nvfuser into a submodule and not rely on dlopen to load the library. @malfet
- Since we moved nvfuser into a cmake build, we effectively disabled bazel build for nvfuser. This could impact internal workload at Meta, so we need to put support back. cc'ing @vors

Pull Request resolved: https://github.com/pytorch/pytorch/pull/89621
Approved by: https://github.com/davidberard98
2023-01-26 02:50:44 +00:00
..
init.cpp [NVFUSER] refactor nvfuser build (#89621) 2023-01-26 02:50:44 +00:00
init.h
module_python.h Improve torch::jit::as_{module,object} performance (#84399) 2022-09-07 16:58:28 +00:00
pybind_utils.cpp [BE] Use nested namespaces in .cpp/.cu files (#92100) 2023-01-13 16:32:34 +00:00
pybind_utils.h Python Script Object to IValue (#91776) 2023-01-11 23:06:57 +00:00
pybind.h
python_arg_flatten.cpp [BE] Use nested namespaces in .cpp/.cu files (#92100) 2023-01-13 16:32:34 +00:00
python_arg_flatten.h
python_custom_class.cpp [BE] Use nested namespaces in .cpp/.cu files (#92100) 2023-01-13 16:32:34 +00:00
python_custom_class.h
python_dict.cpp [BE] Use nested namespaces in .cpp/.cu files (#92100) 2023-01-13 16:32:34 +00:00
python_dict.h
python_interpreter.cpp [BE] Use nested namespaces in .cpp/.cu files (#92100) 2023-01-13 16:32:34 +00:00
python_ir.cpp [BE] Use nested namespaces in .cpp/.cu files (#92100) 2023-01-13 16:32:34 +00:00
python_ir.h
python_ivalue.h Revert "Revert "Add a lint rule for torch/csrc/util/pybind.h include (#82552)"" (#82599) 2022-08-02 19:37:02 +00:00
python_list.cpp [BE] Use nested namespaces in .cpp/.cu files (#92100) 2023-01-13 16:32:34 +00:00
python_list.h Fix sign-compare violations in python_list.h 2022-04-01 19:15:51 +00:00
python_sugared_value.cpp [BE]: Replace string compares with more efficient cpp comparisons (#92765) 2023-01-22 21:40:19 +00:00
python_sugared_value.h Fixup torch jit with some initializers and moves (#92037) 2023-01-12 17:29:24 +00:00
python_tracer.cpp [BE] Use nested namespaces in .cpp/.cu files (#92100) 2023-01-13 16:32:34 +00:00
python_tracer.h Support unpacking python dictionary in torch.jit.trace() (#81623) 2022-10-15 05:33:09 +00:00
python_tree_views.cpp [BE] Use nested namespaces in .cpp/.cu files (#92100) 2023-01-13 16:32:34 +00:00
python_tree_views.h
script_init.cpp [BE] Use nested namespaces in .cpp/.cu files (#92100) 2023-01-13 16:32:34 +00:00
script_init.h
update_graph_executor_opt.cpp [BE] Use nested namespaces in .cpp/.cu files (#92100) 2023-01-13 16:32:34 +00:00
update_graph_executor_opt.h