Revert "Revert "Nvfuser code removal (#111093)"" (#111604)

This reverts commit 715dfced72657e5adacd5bef16e3d458cd94851b.

The original PR #111093 is reverted due to broken internal build.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/111604
Approved by: https://github.com/davidberard98
This commit is contained in:
jjsjann123
2023-10-23 18:32:41 +00:00
committed by PyTorch MergeBot
parent ce48d36324
commit 39c09d4da6
12 changed files with 4 additions and 188 deletions

View File

@ -189,9 +189,6 @@
# NCCL_INCLUDE_DIR
# specify where nccl is installed
#
# NVFUSER_SOURCE_DIR
# specify nvfuser root directory
#
# NVTOOLSEXT_PATH (Windows only)
# specify where nvtoolsext is installed
#
@ -632,11 +629,6 @@ class build_ext(setuptools.command.build_ext.build_ext):
else:
report("-- Not using ITT")
if cmake_cache_vars["BUILD_NVFUSER"]:
report("-- Building nvfuser")
else:
report("-- Not Building nvfuser")
# Do not use clang to compile extensions if `-fstack-clash-protection` is defined
# in system CFLAGS
c_flags = str(os.getenv("CFLAGS", ""))
@ -736,22 +728,6 @@ class build_ext(setuptools.command.build_ext.build_ext):
os.makedirs(dst_dir)
self.copy_file(src, dst)
# Copy nvfuser extension
for i, ext in enumerate(self.extensions):
if ext.name != "nvfuser._C":
continue
fullname = self.get_ext_fullname(ext.name)
filename = self.get_ext_filename(fullname)
fileext = os.path.splitext(filename)[1]
src = os.path.join(os.path.dirname(filename), "nvfuser" + fileext)
dst = os.path.join(os.path.realpath(self.build_lib), filename)
if os.path.exists(src):
report(f"Copying {ext.name} from {src} to {dst}")
dst_dir = os.path.dirname(dst)
if not os.path.exists(dst_dir):
os.makedirs(dst_dir)
self.copy_file(src, dst)
setuptools.command.build_ext.build_ext.build_extensions(self)
def get_outputs(self):
@ -1011,8 +987,6 @@ def configure_extension_build():
excludes.extend(["caffe2", "caffe2.*"])
if not cmake_cache_vars["BUILD_FUNCTORCH"]:
excludes.extend(["functorch", "functorch.*"])
if not cmake_cache_vars["BUILD_NVFUSER"]:
excludes.extend(["nvfuser", "nvfuser.*"])
packages = find_packages(exclude=excludes)
C = Extension(
"torch._C",
@ -1046,10 +1020,6 @@ def configure_extension_build():
extensions.append(
Extension(name="functorch._C", sources=[]),
)
if cmake_cache_vars["BUILD_NVFUSER"]:
extensions.append(
Extension(name="nvfuser._C", sources=[]),
)
cmdclass = {
"bdist_wheel": wheel_concatenate,
@ -1312,8 +1282,6 @@ def main():
"include/torch/csrc/jit/tensorexpr/*.h",
"include/torch/csrc/jit/tensorexpr/operators/*.h",
"include/torch/csrc/jit/codegen/cuda/*.h",
"include/torch/csrc/jit/codegen/cuda/ops/*.h",
"include/torch/csrc/jit/codegen/cuda/scheduler/*.h",
"include/torch/csrc/onnx/*.h",
"include/torch/csrc/profiler/*.h",
"include/torch/csrc/profiler/orchestration/*.h",
@ -1355,18 +1323,6 @@ 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(