Patch for nvfuser build (#97404)

1. Packaging nvfuser header for support c++ build against nvfuser;
2. Moving `#include <torch/csrc/jit/codegen/fuser/interface.h>` from `torch/csrc/jit/runtime/register_ops_utils.h` to `torch/csrc/jit/runtime/register_prim_ops_fulljit.cpp` to avoid missing header, since pytorch doesn't package `interface.h`;
3. Patching DynamicLibrary load of nvfuser to leak the handle, this avoids double de-allocation of `libnvfuser_codegen.so`.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/97404
Approved by: https://github.com/davidberard98
This commit is contained in:
jjsjann123
2023-03-28 23:36:08 +00:00
committed by PyTorch MergeBot
parent e0a647d8b5
commit 7282be3d91
4 changed files with 16 additions and 2 deletions

View File

@ -1207,6 +1207,16 @@ def main():
'utils/model_dump/code.js',
'utils/model_dump/*.mjs',
]
if get_cmake_cache_vars()['BUILD_NVFUSER']:
torch_package_data.extend([
'share/cmake/nvfuser/*.cmake',
'include/nvfuser/*.h',
'include/nvfuser/kernel_db/*.h',
'include/nvfuser/multidevice/*.h',
'include/nvfuser/ops/*.h',
'include/nvfuser/python_frontend/*.h',
'include/nvfuser/scheduler/*.h',
])
if get_cmake_cache_vars()['BUILD_CAFFE2']:
torch_package_data.extend([