已合并
[v2.12.0-26.1.0][bugfix]cann and pta header mixing bulid bugfix #45000
Dring创建于 10 天前
[v2.12.0-26.1.0][bugfix]cann and pta header mixing bulid bugfix #45000
已合并
共 79 个文件变更+210-148
| @@ -243,8 +243,6 @@ def copy_hpp(): | |||
| 243 | "torch_npu/csrc/inductor/**/*.h", | 243 | "torch_npu/csrc/inductor/**/*.h", |
| 244 | "torch_npu/csrc/distributed/*.h", | 244 | "torch_npu/csrc/distributed/*.h", |
| 245 | "torch_npu/csrc/distributed/*.hpp", | 245 | "torch_npu/csrc/distributed/*.hpp", |
| 246 | - "third_party/acl/inc/*/*.h", | ||
| 247 | - "third_party/acl/inc/*/*/*.h", | ||
| 248 | "third_party/hccl/inc/*/*.h", | 246 | "third_party/hccl/inc/*/*.h", |
| 249 | ] | 247 | ] |
| 250 | glob_header_files = [] | 248 | glob_header_files = [] |
| @@ -258,6 +256,37 @@ def copy_hpp(): | |||
| 258 | os.makedirs(os.path.dirname(dst), exist_ok=True) | 256 | os.makedirs(os.path.dirname(dst), exist_ok=True) |
| 259 | ret.append((src, dst)) | 257 | ret.append((src, dst)) |
| 260 | 258 | ||
| 259 | + acl_include_root = os.path.join(BASE_DIR, "third_party", "acl", "inc") | ||
| 260 | + acl_header_files = glob.glob( | ||
| 261 | + os.path.join(acl_include_root, "**", "*.h"), | ||
| 262 | + recursive=True, | ||
| 263 | + ) | ||
| 264 | + for src in acl_header_files: | ||
| 265 | + relative_header = os.path.relpath(src, acl_include_root) | ||
| 266 | + dst = os.path.join( | ||
| 267 | + BASE_DIR, | ||
| 268 | + "libtorch_npu/include", | ||
| 269 | + relative_header, | ||
| 270 | + ) | ||
| 271 | + os.makedirs(os.path.dirname(dst), exist_ok=True) | ||
| 272 | + ret.append((src, dst)) | ||
| 273 | + | ||
| 274 | + # Preserve legacy include paths with forwarding headers, not duplicate ACL headers. | ||
| 275 | + compat_header = os.path.join( | ||
| 276 | + BASE_DIR, "build", "acl_compat_headers", relative_header | ||
| 277 | + ) | ||
| 278 | + os.makedirs(os.path.dirname(compat_header), exist_ok=True) | ||
| 279 | + relative_include = relative_header.replace(os.sep, "/") | ||
| 280 | + with open(compat_header, "w", encoding="utf-8", newline="\n") as file: | ||
| 281 | + file.write(f"#pragma once\n#include <{relative_include}>\n") | ||
| 282 | + compat_dst = os.path.join( | ||
| 283 | + BASE_DIR, | ||
| 284 | + "libtorch_npu/include/third_party/acl/inc", | ||
| 285 | + relative_header, | ||
| 286 | + ) | ||
| 287 | + os.makedirs(os.path.dirname(compat_dst), exist_ok=True) | ||
| 288 | + ret.append((compat_header, compat_dst)) | ||
| 289 | + | ||
| 261 | return ret | 290 | return ret |
| 262 | ret = get_src_py_and_dst() | 291 | ret = get_src_py_and_dst() |
| 263 | for src, dst in ret: | 292 | for src, dst in ret: |
| @@ -56,7 +56,7 @@ def fetch_acl_headers(): | |||
| 56 | try: | 56 | try: |
| 57 | import torch_npu | 57 | import torch_npu |
| 58 | installed_acl = Path( | 58 | installed_acl = Path( |
| 59 | - torch_npu.__file__).resolve().parent / 'include' / 'third_party' / 'acl' / 'inc' / 'acl' | 59 | + torch_npu.__file__).resolve().parent / 'include' / 'acl' |
| 60 | if installed_acl.is_dir(): | 60 | if installed_acl.is_dir(): |
| 61 | acl_dest.mkdir(parents=True, exist_ok=True) | 61 | acl_dest.mkdir(parents=True, exist_ok=True) |
| 62 | shutil.copytree(str(installed_acl), str(acl_dest), dirs_exist_ok=True) | 62 | shutil.copytree(str(installed_acl), str(acl_dest), dirs_exist_ok=True) |
| @@ -474,9 +474,7 @@ def get_src_py_and_dst(): | |||
| 474 | "torch_npu/csrc/*/*/*.h", | 474 | "torch_npu/csrc/*/*/*.h", |
| 475 | "torch_npu/csrc/*/*/*/*.h", | 475 | "torch_npu/csrc/*/*/*/*.h", |
| 476 | "torch_npu/csrc/*/*/*/*/*.h", | 476 | "torch_npu/csrc/*/*/*/*/*.h", |
| 477 | - "third_party/acl/inc/*/*.h", | ||
H | |||
| 478 | "third_party/hccl/inc/*/*.h", | 477 | "third_party/hccl/inc/*/*.h", |
| 479 | - "third_party/acl/inc/*/*/*.h", | ||
| 480 | "torch_npu/csrc/distributed/HCCLUtils.hpp", | 478 | "torch_npu/csrc/distributed/HCCLUtils.hpp", |
| 481 | "torch_npu/csrc/distributed/ProcessGroupHCCL.hpp" | 479 | "torch_npu/csrc/distributed/ProcessGroupHCCL.hpp" |
| 482 | ] | 480 | ] |
| @@ -492,6 +490,37 @@ def get_src_py_and_dst(): | |||
| 492 | os.makedirs(os.path.dirname(dst), exist_ok=True) | 490 | os.makedirs(os.path.dirname(dst), exist_ok=True) |
| 493 | ret.append((src, dst)) | 491 | ret.append((src, dst)) |
| 494 | 492 | ||
| 493 | + acl_include_root = os.path.join(BASE_DIR, "third_party", "acl", "inc") | ||
| 494 | + acl_header_files = glob.glob( | ||
| 495 | + os.path.join(acl_include_root, "**", "*.h"), | ||
| 496 | + recursive=True, | ||
| 497 | + ) | ||
| 498 | + for src in acl_header_files: | ||
| 499 | + relative_header = os.path.relpath(src, acl_include_root) | ||
| 500 | + dst = os.path.join( | ||
| 501 | + BASE_DIR, | ||
| 502 | + "build/packages/torch_npu/include", | ||
| 503 | + relative_header, | ||
| 504 | + ) | ||
| 505 | + os.makedirs(os.path.dirname(dst), exist_ok=True) | ||
| 506 | + ret.append((src, dst)) | ||
| 507 | + | ||
| 508 | + # Preserve legacy include paths with forwarding headers, not duplicate ACL headers. | ||
| 509 | + compat_header = os.path.join( | ||
| 510 | + BASE_DIR, "build", "acl_compat_headers", relative_header | ||
| 511 | + ) | ||
| 512 | + os.makedirs(os.path.dirname(compat_header), exist_ok=True) | ||
| 513 | + relative_include = relative_header.replace(os.sep, "/") | ||
| 514 | + with open(compat_header, "w", encoding="utf-8", newline="\n") as file: | ||
| 515 | + file.write(f"#pragma once\n#include <{relative_include}>\n") | ||
| 516 | + compat_dst = os.path.join( | ||
| 517 | + BASE_DIR, | ||
| 518 | + "build/packages/torch_npu/include/third_party/acl/inc", | ||
| 519 | + relative_header, | ||
| 520 | + ) | ||
| 521 | + os.makedirs(os.path.dirname(compat_dst), exist_ok=True) | ||
| 522 | + ret.append((compat_header, compat_dst)) | ||
| 523 | + | ||
| 495 | torch_header_files = [ | 524 | torch_header_files = [ |
| 496 | "*/*.h", | 525 | "*/*.h", |
| 497 | "*/*/*.h", | 526 | "*/*/*.h", |
| @@ -21,7 +21,12 @@ def create_build_path(build_directory): | |||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | def build_stub(base_dir): | 23 | def build_stub(base_dir): |
| 24 | - build_stub_cmd = ["sh", os.path.join(base_dir, 'third_party/acl/libs/build_stub.sh')] | 24 | + build_stub_cmd = [ |
| 25 | + "sh", | ||
| 26 | + os.path.join(base_dir, 'third_party/acl/libs/build_stub.sh'), | ||
| 27 | + # Use the same installed header root for the ACL stub and C++ Extension. | ||
| 28 | + os.path.join(PYTORCH_NPU_INSTALL_PATH, 'include'), | ||
H 这一行的目的是啥 ![]() ![]() | |||
| 29 | + ] | ||
| 25 | if subprocess.call(build_stub_cmd) != 0: | 30 | if subprocess.call(build_stub_cmd) != 0: |
| 26 | raise RuntimeError('Failed to build stub: {}'.format(build_stub_cmd)) | 31 | raise RuntimeError('Failed to build stub: {}'.format(build_stub_cmd)) |
| 27 | 32 | ||
| @@ -47,7 +52,6 @@ class TestPluggableAllocator(TestCase): | |||
| 47 | extra_ldflags.append(f"-L{PYTORCH_INSTALL_PATH}") | 52 | extra_ldflags.append(f"-L{PYTORCH_INSTALL_PATH}") |
| 48 | extra_include_paths = [os.path.join(TEST_DIR, "cpp_extensions")] | 53 | extra_include_paths = [os.path.join(TEST_DIR, "cpp_extensions")] |
| 49 | extra_include_paths.append(os.path.join(PYTORCH_NPU_INSTALL_PATH, 'include')) | 54 | extra_include_paths.append(os.path.join(PYTORCH_NPU_INSTALL_PATH, 'include')) |
| 50 | - extra_include_paths.append(os.path.join(PYTORCH_NPU_INSTALL_PATH, 'include', 'third_party', 'acl', 'inc')) | ||
| 51 | 55 | ||
| 52 | cls.module = torch.utils.cpp_extension.load( | 56 | cls.module = torch.utils.cpp_extension.load( |
| 53 | name="pluggable_allocator_extensions", | 57 | name="pluggable_allocator_extensions", |
| @@ -2,8 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | -#include "third_party/acl/inc/acl/acl_base.h" | 5 | +#include <acl/acl_base.h> |
| 6 | -#include "third_party/acl/inc/acl/acl_rt.h" | 6 | +#include <acl/acl_rt.h> |
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | extern "C" { | 9 | extern "C" { |
| @@ -335,7 +335,7 @@ class TestRpc(TestCase): | |||
| 335 | 335 | ||
| 336 | 336 | ||
| 337 | def test_async_call_for_cpu(self): | 337 | def test_async_call_for_cpu(self): |
| 338 | - inputs = [torch.rand(1024, 1024).cpu(), torch.rand(1024, 1024, 1024).cpu()] | 338 | + inputs = [torch.rand(1024, 1024).cpu(), torch.rand(1024, 1024, 4).cpu()] |
| 339 | self._test_multiprocess(TestRpc._test_async_call_for_cpu, inputs, self.world_size_2p) | 339 | self._test_multiprocess(TestRpc._test_async_call_for_cpu, inputs, self.world_size_2p) |
| 340 | 340 | ||
| 341 | 341 | ||
| @@ -23,7 +23,11 @@ def create_build_path(build_directory): | |||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | def build_stub(base_dir): | 25 | def build_stub(base_dir): |
| 26 | - build_stub_cmd = ["sh", os.path.join(base_dir, 'third_party/acl/libs/build_stub.sh')] | 26 | + build_stub_cmd = [ |
| 27 | + "sh", | ||
| 28 | + os.path.join(base_dir, 'third_party/acl/libs/build_stub.sh'), | ||
| 29 | + os.path.join(PYTORCH_NPU_INSTALL_PATH, 'include'), | ||
| 30 | + ] | ||
| 27 | if subprocess.call(build_stub_cmd) != 0: | 31 | if subprocess.call(build_stub_cmd) != 0: |
| 28 | raise RuntimeError('Failed to build stub: {}'.format(build_stub_cmd)) | 32 | raise RuntimeError('Failed to build stub: {}'.format(build_stub_cmd)) |
| 29 | 33 | ||
| @@ -56,7 +60,6 @@ class TestPluggableAllocator(TestCase): | |||
| 56 | extra_ldflags.append(f"-L{PYTORCH_INSTALL_PATH}") | 60 | extra_ldflags.append(f"-L{PYTORCH_INSTALL_PATH}") |
| 57 | extra_include_paths = [os.path.join(TEST_DIR, "cpp_extensions")] | 61 | extra_include_paths = [os.path.join(TEST_DIR, "cpp_extensions")] |
| 58 | extra_include_paths.append(os.path.join(PYTORCH_NPU_INSTALL_PATH, "include")) | 62 | extra_include_paths.append(os.path.join(PYTORCH_NPU_INSTALL_PATH, "include")) |
| 59 | - extra_include_paths.append(os.path.join(PYTORCH_NPU_INSTALL_PATH, 'include', 'third_party', 'acl', 'inc')) | ||
| 60 | 63 | ||
| 61 | cls.module = torch.utils.cpp_extension.load( | 64 | cls.module = torch.utils.cpp_extension.load( |
| 62 | name="pluggable_allocator_extensions", | 65 | name="pluggable_allocator_extensions", |
| @@ -41,6 +41,7 @@ def build_stub(base_dir): | |||
| 41 | build_stub_cmd = [ | 41 | build_stub_cmd = [ |
| 42 | "sh", | 42 | "sh", |
| 43 | os.path.join(base_dir, "third_party/acl/libs/build_stub.sh"), | 43 | os.path.join(base_dir, "third_party/acl/libs/build_stub.sh"), |
| 44 | + os.path.join(PYTORCH_NPU_INSTALL_PATH, "include"), | ||
| 44 | ] | 45 | ] |
| 45 | if subprocess.call(build_stub_cmd) != 0: | 46 | if subprocess.call(build_stub_cmd) != 0: |
| 46 | raise RuntimeError(f"Failed to build stub: {build_stub_cmd}") | 47 | raise RuntimeError(f"Failed to build stub: {build_stub_cmd}") |
| @@ -79,7 +80,6 @@ class TestSanitizerPluggableAllocator(TestCase): | |||
| 79 | extra_ldflags.append(f"-L{PYTORCH_INSTALL_PATH}") | 80 | extra_ldflags.append(f"-L{PYTORCH_INSTALL_PATH}") |
| 80 | extra_include_paths = [os.path.join(TEST_DIR, "cpp_extensions")] | 81 | extra_include_paths = [os.path.join(TEST_DIR, "cpp_extensions")] |
| 81 | extra_include_paths.append(os.path.join(PYTORCH_NPU_INSTALL_PATH, 'include')) | 82 | extra_include_paths.append(os.path.join(PYTORCH_NPU_INSTALL_PATH, 'include')) |
| 82 | - extra_include_paths.append(os.path.join(PYTORCH_NPU_INSTALL_PATH, 'include', 'third_party', 'acl', 'inc')) | ||
| 83 | 83 | ||
| 84 | cls.module = torch.utils.cpp_extension.load( | 84 | cls.module = torch.utils.cpp_extension.load( |
| 85 | name="sanitizer_pluggable_allocator_extensions", | 85 | name="sanitizer_pluggable_allocator_extensions", |
| @@ -1,20 +1,23 @@ | |||
| 1 | #!/bin/bash | 1 | #!/bin/bash |
| 2 | 2 | ||
| 3 | +set -e | ||
| 4 | + | ||
| 3 | CDIR="$(cd "$(dirname "$0")" ; pwd -P)" | 5 | CDIR="$(cd "$(dirname "$0")" ; pwd -P)" |
| 4 | 6 | ||
| 5 | cd ${CDIR} | 7 | cd ${CDIR} |
| 6 | 8 | ||
| 7 | gcc -fPIC -shared -o libhccl.so -I./ hccl.cpp | 9 | gcc -fPIC -shared -o libhccl.so -I./ hccl.cpp |
| 8 | 10 | ||
| 9 | -gcc -fPIC -shared -o libascendcl.so -I../inc acl.cpp | 11 | +ACL_INCLUDE_DIR="${1:-../inc}" |
| 10 | 12 | ||
| 11 | -gcc -fPIC -shared -o libacl_op_compiler.so -I../inc acl_op_compiler.cpp | 13 | +gcc -fPIC -shared -o libascendcl.so -I"${ACL_INCLUDE_DIR}" acl.cpp |
| 12 | 14 | ||
| 13 | -gcc -fPIC -shared -o libge_runner.so -I../inc ge_runner.cpp ge_api.cpp | 15 | +gcc -fPIC -shared -o libacl_op_compiler.so -I"${ACL_INCLUDE_DIR}" acl_op_compiler.cpp |
| 14 | 16 | ||
| 15 | -gcc -fPIC -shared -o libgraph.so -I../inc graph.cpp operator_factory.cpp operator.cpp tensor.cpp | 17 | +gcc -fPIC -shared -o libge_runner.so -I"${ACL_INCLUDE_DIR}" ge_runner.cpp ge_api.cpp |
| 16 | 18 | ||
| 17 | -gcc -fPIC -shared -o libacl_tdt_channel.so -I../inc acl_tdt.cpp | 19 | +gcc -fPIC -shared -o libgraph.so -I"${ACL_INCLUDE_DIR}" graph.cpp operator_factory.cpp operator.cpp tensor.cpp |
| 18 | 20 | ||
| 19 | -gcc -fPIC -shared -o libascend_ml.so -I../inc aml_fwk_detect.cpp | 21 | +gcc -fPIC -shared -o libacl_tdt_channel.so -I"${ACL_INCLUDE_DIR}" acl_tdt.cpp |
| 20 | 22 | ||
| 23 | +gcc -fPIC -shared -o libascend_ml.so -I"${ACL_INCLUDE_DIR}" aml_fwk_detect.cpp | ||
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | -#include "third_party/acl/inc/acl/acl.h" | 15 | +#include <acl/acl.h> |
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | extern "C" { | 18 | extern "C" { |
| @@ -109,13 +109,11 @@ def _build_npu_ext(obj_name: str, src_path, src_dir) -> str: | |||
| 109 | 109 | ||
| 110 | torch_npu_dir = torch_npu_root / "include" | 110 | torch_npu_dir = torch_npu_root / "include" |
| 111 | torch_npu_lib_dir = torch_npu_root / "lib" | 111 | torch_npu_lib_dir = torch_npu_root / "lib" |
| 112 | - acl_inc_dir = torch_npu_dir / "third_party" / "acl" / "inc" | ||
| 113 | 112 | ||
| 114 | cc_cmd += [ | 113 | cc_cmd += [ |
| 115 | f"-I{torch_npu_dir}", | 114 | f"-I{torch_npu_dir}", |
| 116 | f"-I{cpp_common_dir}", | 115 | f"-I{cpp_common_dir}", |
| 117 | f"-L{torch_npu_lib_dir}", | 116 | f"-L{torch_npu_lib_dir}", |
| 118 | - f"-I{acl_inc_dir}", | ||
| 119 | "-ltorch_npu", | 117 | "-ltorch_npu", |
| 120 | f"-Wl,-rpath", | 118 | f"-Wl,-rpath", |
| 121 | "-std=c++17", | 119 | "-std=c++17", |
| @@ -40,7 +40,7 @@ def include_paths(npu: bool = False) -> List[str]: | |||
| 40 | os.path.join(lib_include, 'TH'), | 40 | os.path.join(lib_include, 'TH'), |
| 41 | os.path.join(lib_include, 'THC') | 41 | os.path.join(lib_include, 'THC') |
| 42 | ] | 42 | ] |
| 43 | - include_path = os.path.join(PYTORCH_NPU_INSTALL_PATH, "include", "third_party", "acl", "inc") | 43 | + include_path = os.path.join(PYTORCH_NPU_INSTALL_PATH, "include") |
H inductor让图模式的也确认下 ![]() ![]() | |||
| 44 | paths.extend([include_path]) | 44 | paths.extend([include_path]) |
| 45 | if npu: | 45 | if npu: |
| 46 | ASCEND_HOME = get_ascend_home() | 46 | ASCEND_HOME = get_ascend_home() |
| @@ -51,8 +51,6 @@ def include_paths(npu: bool = False) -> List[str]: | |||
| 51 | os.path.join(ASCEND_HOME, "include/experiment"), | 51 | os.path.join(ASCEND_HOME, "include/experiment"), |
| 52 | os.path.join(ASCEND_HOME, "include/experiment/msprof"), | 52 | os.path.join(ASCEND_HOME, "include/experiment/msprof"), |
| 53 | ]) | 53 | ]) |
| 54 | - | ||
| 55 | - paths.append(os.path.join(PYTORCH_NPU_INSTALL_PATH, "include")) | ||
| 56 | return paths | 54 | return paths |
| 57 | 55 | ||
| 58 | 56 | ||
| @@ -121,4 +119,4 @@ def get_cpp_torch_device_options( | |||
| 121 | 119 | ||
| 122 | 120 | ||
| 123 | def patch_get_cpp_torch_device_options(): | 121 | def patch_get_cpp_torch_device_options(): |
| 124 | - torch._inductor.cpp_builder.get_cpp_torch_device_options = get_cpp_torch_device_options | 122 | + torch._inductor.cpp_builder.get_cpp_torch_device_options = get_cpp_torch_device_options |
| @@ -8,7 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | -#include "third_party/acl/inc/acl/acl.h" | 11 | +#include <acl/acl.h> |
| 12 | 12 | ||
| 13 | namespace at_npu { | 13 | namespace at_npu { |
| 14 | namespace native { | 14 | namespace native { |
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | -#include "third_party/acl/inc/acl/acl_base.h" | 6 | +#include <acl/acl_base.h> |
| 7 | 7 | ||
| 8 | namespace at_npu { | 8 | namespace at_npu { |
| 9 | namespace native { | 9 | namespace native { |
| @@ -2,8 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | -#include "third_party/acl/inc/acl/acl_base.h" | 5 | +#include <acl/acl_base.h> |
| 6 | -#include "third_party/acl/inc/acl/acl_rt.h" | 6 | +#include <acl/acl_rt.h> |
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | ||
| @@ -23,7 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | -#include "third_party/acl/inc/acl/acl_base.h" | 26 | +#include <acl/acl_base.h> |
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | namespace { | 29 | namespace { |
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | -#include "third_party/acl/inc/acl/acl_base.h" | 6 | +#include <acl/acl_base.h> |
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | namespace torch_npu { | 9 | namespace torch_npu { |
| @@ -8,8 +8,8 @@ | |||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | -#include "third_party/acl/inc/acl/acl_rt.h" | 11 | +#include <acl/acl_rt.h> |
| 12 | -#include "third_party/acl/inc/acl/acl_base.h" | 12 | +#include <acl/acl_base.h> |
| 13 | 13 | ||
| 14 | namespace torch_npu { | 14 | namespace torch_npu { |
| 15 | 15 | ||
| @@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | -#include "third_party/acl/inc/acl/acl_rt.h" | 8 | +#include <acl/acl_rt.h> |
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | namespace torch_npu { | 11 | namespace torch_npu { |
| @@ -6,8 +6,8 @@ | |||
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | -#include <third_party/acl/inc/acl/acl.h> | 9 | +#include <acl/acl.h> |
| 10 | -#include <third_party/acl/inc/acl/acl_rt.h> | 10 | +#include <acl/acl_rt.h> |
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| @@ -9,7 +9,7 @@ | |||
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | -#include "third_party/acl/inc/acl/acl.h" | 12 | +#include <acl/acl.h> |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | constexpr size_t kVersionIndex1 = 1; | 15 | constexpr size_t kVersionIndex1 = 1; |
| @@ -567,4 +567,4 @@ bool IsGteDriverVersion(const std::string driverVersion) | |||
| 567 | double currentDriverNum = DriverVersionToNum(currentDriverVersion); | 567 | double currentDriverNum = DriverVersionToNum(currentDriverVersion); |
| 568 | double boundaryDriverNum = DriverVersionToNum(driverVersion); | 568 | double boundaryDriverNum = DriverVersionToNum(driverVersion); |
| 569 | return currentDriverNum >= boundaryDriverNum; | 569 | return currentDriverNum >= boundaryDriverNum; |
| 570 | -} | 570 | +} |
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | -#include "third_party/acl/inc/acl/acl_base.h" | 7 | +#include <acl/acl_base.h> |
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | 10 | ||
| @@ -15,8 +15,8 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | -#include "third_party/acl/inc/acl/acl_base.h" | 18 | +#include <acl/acl_base.h> |
| 19 | -#include "third_party/acl/inc/acl/acl_rt.h" | 19 | +#include <acl/acl_rt.h> |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | -#include "third_party/acl/inc/acl/acl.h" | 7 | +#include <acl/acl.h> |
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | 10 | ||
| @@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | -#include <third_party/acl/inc/acl/acl.h> | 8 | +#include <acl/acl.h> |
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | 11 | ||
| @@ -49,4 +49,4 @@ private: | |||
| 49 | std::unordered_set<aclrtEvent> ipc_events_; | 49 | std::unordered_set<aclrtEvent> ipc_events_; |
| 50 | }; | 50 | }; |
| 51 | 51 | ||
| 52 | -} // namespace c10_npu | 52 | +} // namespace c10_npu |
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | -#include <third_party/acl/inc/acl/acl_base.h> | 18 | +#include <acl/acl_base.h> |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 21 | ||
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | -#include "third_party/acl/inc/acl/acl_rt.h" | 10 | +#include <acl/acl_rt.h> |
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include <third_party/acl/inc/acl/acl.h> | 19 | +#include <acl/acl.h> |
| 20 | 20 | ||
| 21 | namespace c10_npu { | 21 | namespace c10_npu { |
| 22 | 22 | ||
| @@ -6,7 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | -#include "third_party/acl/inc/acl/error_codes/rt_error_codes.h" | 9 | +#include <acl/error_codes/rt_error_codes.h> |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| @@ -8,9 +8,9 @@ | |||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | -#include "third_party/acl/inc/acl/acl_base.h" | 11 | +#include <acl/acl_base.h> |
| 12 | -#include "third_party/acl/inc/acl/acl_rt.h" | 12 | +#include <acl/acl_rt.h> |
| 13 | -#include "third_party/acl/inc/acl/super_kernel.h" | 13 | +#include <acl/super_kernel.h> |
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| @@ -1,7 +1,7 @@ | |||
| 1 | 1 | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | -#include <third_party/acl/inc/acl/acl_rt.h> | 4 | +#include <acl/acl_rt.h> |
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | 7 | ||
| @@ -19,7 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | -#include <third_party/acl/inc/acl/acl_rt.h> | 22 | +#include <acl/acl_rt.h> |
| 23 | 23 | ||
| 24 | namespace c10_npu { | 24 | namespace c10_npu { |
| 25 | struct timeval delay = { 0, 1 }; | 25 | struct timeval delay = { 0, 1 }; |
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | -#include <third_party/acl/inc/acl/acl_op.h> | 10 | +#include <acl/acl_op.h> |
| 11 | 11 | ||
| 12 | namespace c10_npu { | 12 | namespace c10_npu { |
| 13 | 13 | ||
| @@ -184,4 +184,4 @@ public: | |||
| 184 | 184 | ||
| 185 | static ::c10_npu::register_queue_cb::NPUCallBackRegisterBuilder \ | 185 | static ::c10_npu::register_queue_cb::NPUCallBackRegisterBuilder \ |
| 186 | register_queue_func_builder(execF, copyF, releaseF, newF, deleteF, copyReleaseParamF, releaseParamF); | 186 | register_queue_func_builder(execF, copyF, releaseF, newF, deleteF, copyReleaseParamF, releaseParamF); |
| 187 | -} // namespace c10_npu | 187 | +} // namespace c10_npu |
| @@ -20,7 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | -#include "third_party/acl/inc/acl/acl_rt.h" | 23 | +#include <acl/acl_rt.h> |
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | ||
| @@ -10,8 +10,8 @@ | |||
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | -#include "third_party/acl/inc/acl/acl.h" | 13 | +#include <acl/acl.h> |
| 14 | -#include "third_party/acl/inc/acl/acl_op.h" | 14 | +#include <acl/acl_op.h> |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | namespace c10_npu { | 17 | namespace c10_npu { |
| @@ -1,8 +1,8 @@ | |||
| 1 | 1 | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | -#include "third_party/acl/inc/acl/acl_base.h" | 4 | +#include <acl/acl_base.h> |
| 5 | -#include "third_party/acl/inc/acl/acl_rt.h" | 5 | +#include <acl/acl_rt.h> |
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | 8 | ||
| @@ -4,8 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | -#include "third_party/acl/inc/acl/acl_base.h" | 7 | +#include <acl/acl_base.h> |
| 8 | -#include "third_party/acl/inc/acl/acl_rt.h" | 8 | +#include <acl/acl_rt.h> |
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | 11 | ||
| @@ -7,9 +7,9 @@ | |||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | -#include "third_party/acl/inc/acl/acl.h" | 10 | +#include <acl/acl.h> |
| 11 | -#include "third_party/acl/inc/acl/acl_base.h" | 11 | +#include <acl/acl_base.h> |
| 12 | -#include "third_party/acl/inc/acl/acl_rt.h" | 12 | +#include <acl/acl_rt.h> |
| 13 | 13 | ||
| 14 | namespace c10_npu { | 14 | namespace c10_npu { |
| 15 | namespace impl { | 15 | namespace impl { |
| @@ -2,12 +2,12 @@ | |||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | -#include "third_party/acl/inc/acl/acl_rt.h" | 5 | +#include <acl/acl_rt.h> |
| 6 | -#include "third_party/acl/inc/acl/acl_base.h" | 6 | +#include <acl/acl_base.h> |
| 7 | -#include "third_party/acl/inc/acl/acl_mdl.h" | 7 | +#include <acl/acl_mdl.h> |
| 8 | -#include "third_party/acl/inc/acl/acl_prof.h" | 8 | +#include <acl/acl_prof.h> |
| 9 | 9 | ||
| 10 | -#include "third_party/acl/inc/acl/acl.h" | 10 | +#include <acl/acl.h> |
| 11 | 11 | ||
| 12 | using aclrtHostFunc = void (*)(void *args); | 12 | using aclrtHostFunc = void (*)(void *args); |
| 13 | struct aclrtMemUsageInfo; | 13 | struct aclrtMemUsageInfo; |
| @@ -6,7 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | -#include "third_party/acl/inc/acl/acl_rt.h" | 9 | +#include <acl/acl_rt.h> |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | 12 | ||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | -#include "third_party/acl/inc/acl/acl_rt.h" | 5 | +#include <acl/acl_rt.h> |
| 6 | 6 | ||
| 7 | namespace c10_npu { | 7 | namespace c10_npu { |
| 8 | namespace queue { | 8 | namespace queue { |
| @@ -1,5 +1,5 @@ | |||
| 1 | 1 | ||
| 2 | -#include "third_party/acl/inc/aml/aml_fwk_detect.h" | 2 | +#include <aml/aml_fwk_detect.h> |
| 3 | 3 | ||
| 4 | namespace c10_npu { | 4 | namespace c10_npu { |
| 5 | namespace amlapi { | 5 | namespace amlapi { |
| @@ -1,8 +1,8 @@ | |||
| 1 | 1 | ||
| 2 | 2 | ||
| 3 | -#include "third_party/acl/inc/acl/super_kernel.h" | 3 | +#include <acl/super_kernel.h> |
| 4 | -#include "third_party/acl/inc/acl/acl_base.h" | 4 | +#include <acl/acl_base.h> |
| 5 | -#include "third_party/acl/inc/acl/acl_mdl.h" | 5 | +#include <acl/acl_mdl.h> |
| 6 | 6 | ||
| 7 | namespace c10_npu { | 7 | namespace c10_npu { |
| 8 | namespace skapi { | 8 | namespace skapi { |
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | -#include "third_party/acl/inc/acl/acl_base.h" | 6 | +#include <acl/acl_base.h> |
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | ||
| @@ -19,8 +19,8 @@ | |||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | -#include "third_party/acl/inc/acl/acl_op_compiler.h" | 22 | +#include <acl/acl_op_compiler.h> |
| 23 | -#include "third_party/acl/inc/acl/acl_rt.h" | 23 | +#include <acl/acl_rt.h> |
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | ||
| @@ -1,6 +1,6 @@ | |||
| 1 | 1 | ||
| 2 | 2 | ||
| 3 | -#include <third_party/acl/inc/acl/acl.h> | 3 | +#include <acl/acl.h> |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | 6 | ||
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | -#include "third_party/acl/inc/acl/acl_base.h" | 10 | +#include <acl/acl_base.h> |
| 11 | 11 | ||
| 12 | namespace c10_npu { | 12 | namespace c10_npu { |
| 13 | const int g_toAclOffset = 256; | 13 | const int g_toAclOffset = 256; |
| @@ -33,8 +33,8 @@ | |||
| 33 | 33 | ||
| 34 | 34 | ||
| 35 | 35 | ||
| 36 | -#include "third_party/acl/inc/acl/acl.h" | 36 | +#include <acl/acl.h> |
| 37 | -#include "third_party/acl/inc/acl/acl_base.h" | 37 | +#include <acl/acl_base.h> |
| 38 | 38 | ||
| 39 | 39 | ||
| 40 | 40 | ||
| @@ -16,7 +16,7 @@ | |||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | 18 | ||
| 19 | -#include "third_party/acl/inc/acl/acl_rt.h" | 19 | +#include <acl/acl_rt.h> |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| @@ -362,7 +362,7 @@ void TensorPipeAgent::checkAndSetStaticGroup(const c10::intrusive_ptr<::c10d::St | |||
| 362 | returnedVec = store->compareSet(isStaticGroupKey, std::vector<uint8_t>(), isStaticGroupVec); | 362 | returnedVec = store->compareSet(isStaticGroupKey, std::vector<uint8_t>(), isStaticGroupVec); |
| 363 | std::string returnedVal = std::string(returnedVec.begin(), returnedVec.end()); | 363 | std::string returnedVal = std::string(returnedVec.begin(), returnedVec.end()); |
| 364 | // In both cases, the returned value should be the value of isStaticGroupStr, | 364 | // In both cases, the returned value should be the value of isStaticGroupStr, |
| 365 | - // otherwise there is a discrepency with initialization among one of the | 365 | + // otherwise there is a discrepancy with initialization among one of the |
| 366 | // members | 366 | // members |
| 367 | } | 367 | } |
| 368 | 368 | ||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | -#include "third_party/acl/inc/acl/acl_base.h" | 6 | +#include <acl/acl_base.h> |
| 7 | 7 | ||
| 8 | namespace c10d { | 8 | namespace c10d { |
| 9 | namespace symmetric_memory { | 9 | namespace symmetric_memory { |
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | -#include "third_party/acl/inc/acl/acl_base.h" | 7 | +#include <acl/acl_base.h> |
| 8 | 8 | ||
| 9 | namespace at_npu { | 9 | namespace at_npu { |
| 10 | namespace native { | 10 | namespace native { |
| @@ -47,4 +47,4 @@ public: | |||
| 47 | } // namespace native | 47 | } // namespace native |
| 48 | } // namespace at_npu | 48 | } // namespace at_npu |
| 49 | 49 | ||
| 50 | -#endif // __NATIVE_NPU_UTILS_FORMAT_INFER__ | 50 | +#endif // __NATIVE_NPU_UTILS_FORMAT_INFER__ |
| @@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | -#include "third_party/acl/inc/acl/acl_op_compiler.h" | 8 | +#include <acl/acl_op_compiler.h> |
| 9 | 9 | ||
| 10 | namespace at_npu { | 10 | namespace at_npu { |
| 11 | namespace aclops { | 11 | namespace aclops { |
| @@ -27,4 +27,4 @@ void InitializeJitCompilationMode(); | |||
| 27 | } // namespace aclops | 27 | } // namespace aclops |
| 28 | } // namespace at_npu | 28 | } // namespace at_npu |
| 29 | 29 | ||
| 30 | -#endif // AT_NPU_ACLOPS_LAZYINITACLOPS_H_ | 30 | +#endif // AT_NPU_ACLOPS_LAZYINITACLOPS_H_ |
| @@ -4,8 +4,8 @@ | |||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | -#include "third_party/acl/inc/acl/acl.h" | 7 | +#include <acl/acl.h> |
| 8 | -#include "third_party/acl/inc/acl/acl_base.h" | 8 | +#include <acl/acl_base.h> |
| 9 | 9 | ||
| 10 | namespace at_npu { | 10 | namespace at_npu { |
| 11 | namespace native { | 11 | namespace native { |
| @@ -39,4 +39,4 @@ public: | |||
| 39 | } // namespace native | 39 | } // namespace native |
| 40 | } // namespace at_npu | 40 | } // namespace at_npu |
| 41 | 41 | ||
| 42 | -#endif | 42 | +#endif |
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | -#include "third_party/acl/inc/acl/acl_base.h" | 7 | +#include <acl/acl_base.h> |
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | 10 | ||
| @@ -443,4 +443,4 @@ void SetDeterministicOps(bool deterministicAlgorithmsStatus); | |||
| 443 | } // namespace native | 443 | } // namespace native |
| 444 | } // namespace at_npu | 444 | } // namespace at_npu |
| 445 | 445 | ||
| 446 | -#endif | 446 | +#endif |
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | -#include <third_party/acl/inc/acl/acl_op_compiler.h> | 5 | +#include <acl/acl_op_compiler.h> |
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | namespace at_npu { | 8 | namespace at_npu { |
| @@ -147,4 +147,4 @@ AoeDumpGraphManager& aoe_manager(); | |||
| 147 | } // namespace native | 147 | } // namespace native |
| 148 | } // namespace at_npu | 148 | } // namespace at_npu |
| 149 | 149 | ||
| 150 | -#endif // __NATIVE_NPU_TOOLS_AOEUTILS__ | 150 | +#endif // __NATIVE_NPU_TOOLS_AOEUTILS__ |
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | -#include "third_party/acl/inc/acl/acl_base.h" | 6 | +#include <acl/acl_base.h> |
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | ||
| @@ -40,4 +40,4 @@ struct ContiguousTensorDesc { | |||
| 40 | } // namespace native | 40 | } // namespace native |
| 41 | } // namespace at_npu | 41 | } // namespace at_npu |
| 42 | 42 | ||
| 43 | -#endif | 43 | +#endif |
| @@ -1,10 +1,10 @@ | |||
| 1 | 1 | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | -#include "third_party/acl/inc/acl/acl_rt.h" | 4 | +#include <acl/acl_rt.h> |
| 5 | -#include <third_party/acl/inc/acl/acl_base.h> | 5 | +#include <acl/acl_base.h> |
| 6 | -#include <third_party/acl/inc/acl/acl_prof.h> | 6 | +#include <acl/acl_prof.h> |
| 7 | -#include <third_party/acl/inc/acl/acl_op.h> | 7 | +#include <acl/acl_op.h> |
| 8 | 8 | ||
| 9 | namespace at_npu { | 9 | namespace at_npu { |
| 10 | namespace native { | 10 | namespace native { |
| @@ -76,4 +76,4 @@ aclError AclopStopDumpArgs(uint32_t dumpType); | |||
| 76 | } // namespace native | 76 | } // namespace native |
| 77 | } // namespace at_npu | 77 | } // namespace at_npu |
| 78 | 78 | ||
| 79 | -#endif // __TORCH_NPU_INTERFACE_ACLINTERFACE__ | 79 | +#endif // __TORCH_NPU_INTERFACE_ACLINTERFACE__ |
| @@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | -#include "third_party/acl/inc/acl/acl_base.h" | 8 | +#include <acl/acl_base.h> |
| 9 | 9 | ||
| 10 | namespace at_npu | 10 | namespace at_npu |
| 11 | { | 11 | { |
| @@ -191,4 +191,4 @@ aclError AclDestroyAclOpExecutor(aclOpExecutor *executor) | |||
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | } // namespace native | 193 | } // namespace native |
| 194 | -} // namespace at_npu | 194 | +} // namespace at_npu |
| @@ -1,7 +1,7 @@ | |||
| 1 | 1 | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | -#include "third_party/acl/inc/acl/acl_op_compiler.h" | 4 | +#include <acl/acl_op_compiler.h> |
| 5 | 5 | ||
| 6 | typedef struct aclOpExecutor aclOpExecutor; | 6 | typedef struct aclOpExecutor aclOpExecutor; |
| 7 | 7 | ||
| @@ -148,4 +148,4 @@ ACL_FUNC_VISIBILITY aclError AclDestroyAclOpExecutor(aclOpExecutor *executor); | |||
| 148 | } // namespace native | 148 | } // namespace native |
| 149 | } // namespace at_npu | 149 | } // namespace at_npu |
| 150 | 150 | ||
| 151 | -#endif // __NATIVE_NPU_INTERFACE_ACLOPCOMPILE__ | 151 | +#endif // __NATIVE_NPU_INTERFACE_ACLOPCOMPILE__ |
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | -#include "third_party/acl/inc/acl/acl_mdl.h" | 10 | +#include <acl/acl_mdl.h> |
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| @@ -1,7 +1,7 @@ | |||
| 1 | 1 | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | -#include "third_party/acl/inc/acl/acl_prof.h" | 4 | +#include <acl/acl_prof.h> |
| 5 | 5 | ||
| 6 | namespace at_npu { | 6 | namespace at_npu { |
| 7 | namespace native { | 7 | namespace native { |
| @@ -1,7 +1,7 @@ | |||
| 1 | 1 | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | -#include <third_party/acl/inc/acl/acl_prof.h> | 4 | +#include <acl/acl_prof.h> |
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | namespace at_npu { | 7 | namespace at_npu { |
| @@ -1,7 +1,7 @@ | |||
| 1 | 1 | ||
| 2 | 2 | ||
| 3 | -#include "third_party/acl/inc/acl/acl_base.h" | 3 | +#include <acl/acl_base.h> |
| 4 | -#include "third_party/acl/inc/acl/acl_rt.h" | 4 | +#include <acl/acl_rt.h> |
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | 7 | ||
| @@ -14,8 +14,8 @@ | |||
| 14 | 14 | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | -#include "third_party/acl/inc/acl/acl_base.h" | 17 | +#include <acl/acl_base.h> |
| 18 | -#include "third_party/acl/inc/acl/acl.h" | 18 | +#include <acl/acl.h> |
| 19 | 19 | ||
| 20 | using std::string; | 20 | using std::string; |
| 21 | using std::vector; | 21 | using std::vector; |
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | -#include <third_party/acl/inc/graph/operator.h> | 6 | +#include <graph/operator.h> |
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | ||
| @@ -21,4 +21,4 @@ using DynamicInputRegFunc = std::function<ge::OperatorPtr(DyNumAndIndex, std::st | |||
| 21 | } // namespace native | 21 | } // namespace native |
| 22 | } // namespace at_npu | 22 | } // namespace at_npu |
| 23 | 23 | ||
| 24 | -#endif // __NATIVE_NPU_UTILS_NPU_CONFIG__ | 24 | +#endif // __NATIVE_NPU_UTILS_NPU_CONFIG__ |
| @@ -7,9 +7,9 @@ | |||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | -#include "third_party/acl/inc/acl/acl.h" | 10 | +#include <acl/acl.h> |
| 11 | -#include "third_party/acl/inc/acl/acl_base.h" | 11 | +#include <acl/acl_base.h> |
| 12 | -#include "third_party/acl/inc/acl/acl_op.h" | 12 | +#include <acl/acl_op.h> |
| 13 | 13 | ||
| 14 | 14 | ||
| 15 | 15 | ||
| @@ -2,8 +2,8 @@ | |||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | -#include "third_party/acl/inc/acl/acl_base.h" | 5 | +#include <acl/acl_base.h> |
| 6 | -#include "third_party/acl/inc/acl/acl_rt.h" | 6 | +#include <acl/acl_rt.h> |
| 7 | 7 | ||
| 8 | typedef void* NPUdeviceptr; | 8 | typedef void* NPUdeviceptr; |
| 9 | 9 | ||
| @@ -8,8 +8,8 @@ | |||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | -#include "third_party/acl/inc/experiment/msprof/toolchain/prof_api.h" | 11 | +#include <experiment/msprof/toolchain/prof_api.h> |
| 12 | -#include "third_party/acl/inc/experiment/msprof/toolchain/prof_common.h" | 12 | +#include <experiment/msprof/toolchain/prof_common.h> |
| 13 | 13 | ||
| 14 | struct TilingMem { | 14 | struct TilingMem { |
| 15 | std::unique_ptr<void, decltype(&aclrtFreeHost)> arg_tiling_host; | 15 | std::unique_ptr<void, decltype(&aclrtFreeHost)> arg_tiling_host; |
| @@ -167,4 +167,4 @@ void TORCH_NPU_API opcommand_call(const char* name, std::function<int()> launch_ | |||
| 167 | at_npu::native::OpCommand cmd; | 167 | at_npu::native::OpCommand cmd; |
| 168 | cmd.Name(name).SetCustomHandler(launch_call).Run(); | 168 | cmd.Name(name).SetCustomHandler(launch_call).Run(); |
| 169 | } | 169 | } |
| 170 | -#endif // BUILD_LIBTORCH | 170 | +#endif // BUILD_LIBTORCH |
| @@ -1,8 +1,8 @@ | |||
| 1 | 1 | ||
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | -#include "third_party/acl/inc/acl/acl_base.h" | 4 | +#include <acl/acl_base.h> |
| 5 | -#include "third_party/acl/inc/acl/acl_rt.h" | 5 | +#include <acl/acl_rt.h> |
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | rtError_t common_launch(char* kernelName, const void* func, uint32_t gridX, void* args, uint32_t argsSize, | 8 | rtError_t common_launch(char* kernelName, const void* func, uint32_t gridX, void* args, uint32_t argsSize, |
| @@ -10,4 +10,4 @@ rtError_t common_launch(char* kernelName, const void* func, uint32_t gridX, void | |||
| 10 | rtError_t common_launch_dyn(char* kernelName, void* func, void* tiling_func, int64_t tilingSize, void* arg_tiling_host, | 10 | rtError_t common_launch_dyn(char* kernelName, void* func, void* tiling_func, int64_t tilingSize, void* arg_tiling_host, |
| 11 | void* arg_tiling_device, uint32_t gridX, void* args, uint32_t argsSize, rtStream_t stream); | 11 | void* arg_tiling_device, uint32_t gridX, void* args, uint32_t argsSize, rtStream_t stream); |
| 12 | void opcommand_call(const char* name, std::function<int()> launch_call); | 12 | void opcommand_call(const char* name, std::function<int()> launch_call); |
| 13 | -#endif // BUILD_LIBTORCH | 13 | +#endif // BUILD_LIBTORCH |
| @@ -8,8 +8,8 @@ | |||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | -#include "third_party/acl/inc/acl/acl_base.h" | 11 | +#include <acl/acl_base.h> |
| 12 | -#include "third_party/acl/inc/acl/acl_rt.h" | 12 | +#include <acl/acl_rt.h> |
| 13 | 13 | ||
| 14 | namespace torch_npu { | 14 | namespace torch_npu { |
| 15 | namespace ipc { | 15 | namespace ipc { |
| @@ -264,4 +264,4 @@ namespace NPUCachingAllocator { | |||
| 264 | REGISTER_FREE_MEMORY_CALLBACK("npu_ipc_collect", NpuIPCCollectCallback); | 264 | REGISTER_FREE_MEMORY_CALLBACK("npu_ipc_collect", NpuIPCCollectCallback); |
| 265 | 265 | ||
| 266 | } // namespace NPUCachingAllocator | 266 | } // namespace NPUCachingAllocator |
| 267 | -} // namespace c10_npu | 267 | +} // namespace c10_npu |
| @@ -22,8 +22,8 @@ | |||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | -#include "third_party/acl/inc/acl/acl_base.h" | 25 | +#include <acl/acl_base.h> |
| 26 | -#include "third_party/acl/inc/acl/acl_rt.h" | 26 | +#include <acl/acl_rt.h> |
| 27 | 27 | ||
| 28 | namespace torch_npu { | 28 | namespace torch_npu { |
| 29 | namespace reductions { | 29 | namespace reductions { |
| @@ -5,9 +5,9 @@ | |||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | -#include "third_party/acl/inc/acl/acl_base.h" | 8 | +#include <acl/acl_base.h> |
| 9 | -#include "third_party/acl/inc/acl/acl_rt.h" | 9 | +#include <acl/acl_rt.h> |
| 10 | -#include "third_party/acl/inc/acl/super_kernel.h" | 10 | +#include <acl/super_kernel.h> |
| 11 | 11 | ||
| 12 | struct PendingTensorData { | 12 | struct PendingTensorData { |
| 13 | PendingTensorData(uintptr_t dataPtr, Py_ssize_t nbytes, PyObject* shape, PyObject* dtype) | 13 | PendingTensorData(uintptr_t dataPtr, Py_ssize_t nbytes, PyObject* shape, PyObject* dtype) |
| @@ -24,7 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | ||
| 27 | -#include <third_party/acl/inc/acl/acl.h> | 27 | +#include <acl/acl.h> |
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | 30 | ||
| @@ -3,9 +3,9 @@ | |||
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | -#include "third_party/acl/inc/acl/acl.h" | 6 | +#include <acl/acl.h> |
| 7 | -#include "third_party/acl/inc/acl/acl_base.h" | 7 | +#include <acl/acl_base.h> |
| 8 | -#include "third_party/acl/inc/acl/acl_rt.h" | 8 | +#include <acl/acl_rt.h> |
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | 11 | ||
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | -#include "third_party/acl/inc/acl/acl_prof.h" | 10 | +#include <acl/acl_prof.h> |
| 11 | 11 | ||
| 12 | 12 | ||
| 13 | 13 | ||
| @@ -7,8 +7,8 @@ | |||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | -#include "third_party/acl/inc/acl/acl_base.h" | 10 | +#include <acl/acl_base.h> |
| 11 | -#include "third_party/acl/inc/acl/acl_rt.h" | 11 | +#include <acl/acl_rt.h> |
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | 14 | ||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | -#include "third_party/acl/inc/acl/acl_prof.h" | 7 | +#include <acl/acl_prof.h> |
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | 10 | ||
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | 9 | ||
| 10 | -#include "third_party/acl/inc/acl/acl_rt.h" | 10 | +#include <acl/acl_rt.h> |
| 11 | 11 | ||
| 12 | namespace torch_npu { | 12 | namespace torch_npu { |
| 13 | namespace profiler { | 13 | namespace profiler { |
| @@ -1,7 +1,6 @@ | |||
| 1 | import os | 1 | import os |
| 2 | import setuptools | 2 | import setuptools |
| 3 | 3 | ||
| 4 | -import torch | ||
| 5 | import torch.utils.cpp_extension as TorchExtension | 4 | import torch.utils.cpp_extension as TorchExtension |
| 6 | 5 | ||
| 7 | import torch_npu | 6 | import torch_npu |
| @@ -38,7 +37,6 @@ def NpuExtension(name, sources, *args, **kwargs): | |||
| 38 | torch_npu_dir = PYTORCH_NPU_INSTALL_PATH | 37 | torch_npu_dir = PYTORCH_NPU_INSTALL_PATH |
| 39 | include_dirs = kwargs.get('include_dirs', []) | 38 | include_dirs = kwargs.get('include_dirs', []) |
| 40 | include_dirs.append(os.path.join(torch_npu_dir, 'include')) | 39 | include_dirs.append(os.path.join(torch_npu_dir, 'include')) |
| 41 | - include_dirs.append(os.path.join(torch_npu_dir, 'include', 'third_party', 'acl', 'inc')) | ||
| 42 | include_dirs.append(os.path.join(torch_npu_dir, 'include', 'third_party', 'hccl', 'inc')) | 40 | include_dirs.append(os.path.join(torch_npu_dir, 'include', 'third_party', 'hccl', 'inc')) |
| 43 | include_dirs += TorchExtension.include_paths() | 41 | include_dirs += TorchExtension.include_paths() |
| 44 | kwargs['include_dirs'] = include_dirs | 42 | kwargs['include_dirs'] = include_dirs |


为了兼容性,原有目录建议保留