已合并
[v2.12.0-26.1.0][bugfix]cann and pta header mixing bulid bugfix #45000
[v2.12.0-26.1.0][bugfix]cann and pta header mixing bulid bugfix #45000
已合并
Dring创建于 10 天前
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 ret290 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_npu57 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)
Msetup.py+31-2
@@ -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
Hhuangyunlong10 天前
已过期

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

likedislike
Dring
10 天前 评论:
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 
23def build_stub(base_dir):23def 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
Hhuangyunlong10 天前

这一行的目的是啥

likedislike
Dring
10 天前 评论:
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#include <iostream>2#include <iostream>
3#include <torch/extension.h>3#include <torch/extension.h>
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#include "torch_npu/csrc/core/npu/NPUCachingAllocator.h"7#include "torch_npu/csrc/core/npu/NPUCachingAllocator.h"
8 8 
9extern "C" {9extern "C" {
@@ -335,7 +335,7 @@ class TestRpc(TestCase):
335 335 
336 @skipIfUnsupportMultiNPU(2)336 @skipIfUnsupportMultiNPU(2)
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 @skipIfUnsupportMultiNPU(2)341 @skipIfUnsupportMultiNPU(2)
@@ -23,7 +23,11 @@ def create_build_path(build_directory):
23 23 
24 24 
25def build_stub(base_dir):25def 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/bash1#!/bin/bash
2 2 
3+set -e
4+ 
3CDIR="$(cd "$(dirname "$0")" ; pwd -P)"5CDIR="$(cd "$(dirname "$0")" ; pwd -P)"
4 6 
5cd ${CDIR}7cd ${CDIR}
6 8 
7gcc -fPIC -shared -o libhccl.so -I./ hccl.cpp9gcc -fPIC -shared -o libhccl.so -I./ hccl.cpp
8 10 
9-gcc -fPIC -shared -o libascendcl.so -I../inc acl.cpp11+ACL_INCLUDE_DIR="${1:-../inc}"
10 12 
11-gcc -fPIC -shared -o libacl_op_compiler.so -I../inc acl_op_compiler.cpp13+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.cpp15+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.cpp17+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.cpp19+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.cpp21+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#define HCCL_H_12#define HCCL_H_
13 13 
14#include "third_party/hccl/inc/hccl/hccl_types.h"14#include "third_party/hccl/inc/hccl/hccl_types.h"
15-#include "third_party/acl/inc/acl/acl.h"15+#include <acl/acl.h>
16 16 
17#ifdef __cplusplus17#ifdef __cplusplus
18extern "C" {18extern "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
Hhuangyunlong10 天前

inductor让图模式的也确认下

likedislike
LucciC
LucciC
10 天前 评论:
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 paths54 return paths
57 55 
58 56 
@@ -121,4 +119,4 @@ def get_cpp_torch_device_options(
121 119 
122 120 
123def patch_get_cpp_torch_device_options():121def patch_get_cpp_torch_device_options():
124- torch._inductor.cpp_builder.get_cpp_torch_device_options = get_cpp_torch_device_options122+ torch._inductor.cpp_builder.get_cpp_torch_device_options = get_cpp_torch_device_options
@@ -8,7 +8,7 @@
8#include "torch_npu/csrc/aten/NPUNativeFunctions.h"8#include "torch_npu/csrc/aten/NPUNativeFunctions.h"
9#include "torch_npu/csrc/core/NPUBridge.h"9#include "torch_npu/csrc/core/NPUBridge.h"
10#include "torch_npu/csrc/core/npu/interface/AsyncTaskQueueInterface.h"10#include "torch_npu/csrc/core/npu/interface/AsyncTaskQueueInterface.h"
11-#include "third_party/acl/inc/acl/acl.h"11+#include <acl/acl.h>
12 12 
13namespace at_npu {13namespace at_npu {
14namespace native {14namespace native {
@@ -3,7 +3,7 @@
3 3 
4#include <ATen/ATen.h>4#include <ATen/ATen.h>
5 5 
6-#include "third_party/acl/inc/acl/acl_base.h"6+#include <acl/acl_base.h>
7 7 
8namespace at_npu {8namespace at_npu {
9namespace native {9namespace native {
@@ -2,8 +2,8 @@
2#include <ATen/NativeFunctions.h>2#include <ATen/NativeFunctions.h>
3#include <ATen/Dispatch_v2.h>3#include <ATen/Dispatch_v2.h>
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#include "torch_npu/csrc/core/npu/NPUStream.h"7#include "torch_npu/csrc/core/npu/NPUStream.h"
8#include "torch_npu/csrc/framework/utils/CalcuOpUtil.h"8#include "torch_npu/csrc/framework/utils/CalcuOpUtil.h"
9#include "torch_npu/csrc/aten/NPUNativeFunctions.h"9#include "torch_npu/csrc/aten/NPUNativeFunctions.h"
@@ -23,7 +23,7 @@
23#include "torch_npu/csrc/aten/common/ResizeNpu.h"23#include "torch_npu/csrc/aten/common/ResizeNpu.h"
24#include "torch_npu/csrc/framework/StorageDescHelper.h"24#include "torch_npu/csrc/framework/StorageDescHelper.h"
25#include "torch_npu/csrc/core/npu/NPUGuard.h"25#include "torch_npu/csrc/core/npu/NPUGuard.h"
26-#include "third_party/acl/inc/acl/acl_base.h"26+#include <acl/acl_base.h>
27#include "op_plugin/OpInterface.h"27#include "op_plugin/OpInterface.h"
28 28 
29namespace {29namespace {
@@ -3,7 +3,7 @@
3#include "torch_npu/csrc/core/npu/NPUGuard.h"3#include "torch_npu/csrc/core/npu/NPUGuard.h"
4#include "torch_npu/csrc/core/NPUSerialization.h"4#include "torch_npu/csrc/core/NPUSerialization.h"
5#include "torch_npu/csrc/framework/FormatHelper.h"5#include "torch_npu/csrc/framework/FormatHelper.h"
6-#include "third_party/acl/inc/acl/acl_base.h"6+#include <acl/acl_base.h>
7#include "torch_npu/csrc/framework/StorageDescHelper.h"7#include "torch_npu/csrc/framework/StorageDescHelper.h"
8 8 
9namespace torch_npu {9namespace torch_npu {
@@ -8,8 +8,8 @@
8#include <c10/util/typeid.h>8#include <c10/util/typeid.h>
9#include <c10/util/order_preserving_flat_hash_map.h>9#include <c10/util/order_preserving_flat_hash_map.h>
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 
14namespace torch_npu {14namespace torch_npu {
15 15 
@@ -5,7 +5,7 @@
5 5 
6#include "torch_npu/csrc/framework/StorageDescHelper.h"6#include "torch_npu/csrc/framework/StorageDescHelper.h"
7#include "torch_npu/csrc/core/NPUTensorImpl.h"7#include "torch_npu/csrc/core/NPUTensorImpl.h"
8-#include "third_party/acl/inc/acl/acl_rt.h"8+#include <acl/acl_rt.h>
9#include "torch_npu/csrc/core/NPUStorageImpl.h"9#include "torch_npu/csrc/core/NPUStorageImpl.h"
10 10 
11namespace torch_npu {11namespace torch_npu {
@@ -6,8 +6,8 @@
6#include "torch_npu/csrc/core/npu/NPUMacros.h"6#include "torch_npu/csrc/core/npu/NPUMacros.h"
7#include "torch_npu/csrc/core/npu/NPUStream.h"7#include "torch_npu/csrc/core/npu/NPUStream.h"
8#include "torch_npu/csrc/core/npu/NPUException.h"8#include "torch_npu/csrc/core/npu/NPUException.h"
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#include <c10/core/DeviceGuard.h>12#include <c10/core/DeviceGuard.h>
13#include <ATen/DeviceGuard.h>13#include <ATen/DeviceGuard.h>
@@ -9,7 +9,7 @@
9#include "torch_npu/csrc/core/npu/register/FunctionLoader.h"9#include "torch_npu/csrc/core/npu/register/FunctionLoader.h"
10#include "torch_npu/csrc/core/npu/NPUException.h"10#include "torch_npu/csrc/core/npu/NPUException.h"
11#include "torch_npu/csrc/core/npu/interface/AclInterface.h"11#include "torch_npu/csrc/core/npu/interface/AclInterface.h"
12-#include "third_party/acl/inc/acl/acl.h"12+#include <acl/acl.h>
13 13 
14 14 
15constexpr size_t kVersionIndex1 = 1;15constexpr 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#include <c10/core/AllocatorConfig.h>4#include <c10/core/AllocatorConfig.h>
5#include <c10/util/Deprecated.h>5#include <c10/util/Deprecated.h>
6 6 
7-#include "third_party/acl/inc/acl/acl_base.h"7+#include <acl/acl_base.h>
8#include "torch_npu/csrc/core/npu/GetCANNInfo.h"8#include "torch_npu/csrc/core/npu/GetCANNInfo.h"
9#include "torch_npu/csrc/core/npu/NPUException.h"9#include "torch_npu/csrc/core/npu/NPUException.h"
10#include "torch_npu/csrc/core/npu/NPUAllocatorConfig.h"10#include "torch_npu/csrc/core/npu/NPUAllocatorConfig.h"
@@ -15,8 +15,8 @@
15#include <c10/util/UniqueVoidPtr.h>15#include <c10/util/UniqueVoidPtr.h>
16#include <c10/util/llvmMathExtras.h>16#include <c10/util/llvmMathExtras.h>
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#include "torch_npu/csrc/core/npu/interface/AsyncTaskQueueInterface.h"20#include "torch_npu/csrc/core/npu/interface/AsyncTaskQueueInterface.h"
21#include "torch_npu/csrc/core/npu/NPUCachingAllocator.h"21#include "torch_npu/csrc/core/npu/NPUCachingAllocator.h"
22#include "torch_npu/csrc/core/npu/NPUAllocatorConfig.h"22#include "torch_npu/csrc/core/npu/NPUAllocatorConfig.h"
@@ -4,7 +4,7 @@
4#include "torch_npu/csrc/core/npu/NPUMacros.h"4#include "torch_npu/csrc/core/npu/NPUMacros.h"
5#include "torch_npu/csrc/core/npu/NPUGuard.h"5#include "torch_npu/csrc/core/npu/NPUGuard.h"
6#include "torch_npu/csrc/core/npu/NPUFunctions.h"6#include "torch_npu/csrc/core/npu/NPUFunctions.h"
7-#include "third_party/acl/inc/acl/acl.h"7+#include <acl/acl.h>
8#include <cstdint>8#include <cstdint>
9#include <utility>9#include <utility>
10 10 
@@ -5,7 +5,7 @@
5#include <unordered_set>5#include <unordered_set>
6#include <c10/core/thread_pool.h>6#include <c10/core/thread_pool.h>
7#include <c10/util/flat_hash_map.h>7#include <c10/util/flat_hash_map.h>
8-#include <third_party/acl/inc/acl/acl.h>8+#include <acl/acl.h>
9 9 
10#include "torch_npu/csrc/core/npu/NPUException.h"10#include "torch_npu/csrc/core/npu/NPUException.h"
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_npu52+} // namespace c10_npu
@@ -15,7 +15,7 @@
15#include <regex>15#include <regex>
16#include <c10/macros/Macros.h>16#include <c10/macros/Macros.h>
17#include <c10/util/Exception.h>17#include <c10/util/Exception.h>
18-#include <third_party/acl/inc/acl/acl_base.h>18+#include <acl/acl_base.h>
19#include "torch_npu/csrc/core/npu/NPUMacros.h"19#include "torch_npu/csrc/core/npu/NPUMacros.h"
20#include "torch_npu/csrc/core/npu/interface/AclInterface.h"20#include "torch_npu/csrc/core/npu/interface/AclInterface.h"
21#include "torch_npu/csrc/core/npu/NPUErrorCodes.h"21#include "torch_npu/csrc/core/npu/NPUErrorCodes.h"
@@ -7,7 +7,7 @@
7#include "torch_npu/csrc/core/npu/register/OptionsManager.h"7#include "torch_npu/csrc/core/npu/register/OptionsManager.h"
8#include "torch_npu/csrc/core/npu/GetCANNInfo.h"8#include "torch_npu/csrc/core/npu/GetCANNInfo.h"
9#include "torch_npu/csrc/framework/interface/EnvVariables.h"9#include "torch_npu/csrc/framework/interface/EnvVariables.h"
10-#include "third_party/acl/inc/acl/acl_rt.h"10+#include <acl/acl_rt.h>
11#ifndef BUILD_LIBTORCH11#ifndef BUILD_LIBTORCH
12#include "torch_npu/csrc/sanitizer/NPUTrace.h"12#include "torch_npu/csrc/sanitizer/NPUTrace.h"
13#endif13#endif
@@ -16,7 +16,7 @@
16#include "torch_npu/csrc/core/npu/npu_log.h"16#include "torch_npu/csrc/core/npu/npu_log.h"
17#include "torch_npu/csrc/core/npu/NPUMacros.h"17#include "torch_npu/csrc/core/npu/NPUMacros.h"
18#include "torch_npu/csrc/core/npu/NPUStream.h"18#include "torch_npu/csrc/core/npu/NPUStream.h"
19-#include <third_party/acl/inc/acl/acl.h>19+#include <acl/acl.h>
20 20 
21namespace c10_npu {21namespace c10_npu {
22 22 
@@ -6,7 +6,7 @@
6#include "torch_npu/csrc/core/npu/NPUStreamUtils.h"6#include "torch_npu/csrc/core/npu/NPUStreamUtils.h"
7#include "torch_npu/csrc/aten/NPUGeneratorImpl.h"7#include "torch_npu/csrc/aten/NPUGeneratorImpl.h"
8#include "torch_npu/csrc/core/npu/register/OptionRegister.h"8#include "torch_npu/csrc/core/npu/register/OptionRegister.h"
9-#include "third_party/acl/inc/acl/error_codes/rt_error_codes.h"9+#include <acl/error_codes/rt_error_codes.h>
10#include "torch_npu/csrc/core/npu/sys_ctrl/npu_sys_ctrl.h"10#include "torch_npu/csrc/core/npu/sys_ctrl/npu_sys_ctrl.h"
11#include "torch_npu/csrc/core/npu/GetCANNInfo.h"11#include "torch_npu/csrc/core/npu/GetCANNInfo.h"
12 12 
@@ -8,9 +8,9 @@
8#include <vector>8#include <vector>
9#include <functional>9#include <functional>
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#include "torch_npu/csrc/core/npu/interface/AclInterface.h"14#include "torch_npu/csrc/core/npu/interface/AclInterface.h"
15#include "torch_npu/csrc/core/npu/interface/SkInterface.h"15#include "torch_npu/csrc/core/npu/interface/SkInterface.h"
16#include "torch_npu/csrc/core/npu/NPUGraphsUtils.h"16#include "torch_npu/csrc/core/npu/NPUGraphsUtils.h"
@@ -1,7 +1,7 @@
1#include <vector>1#include <vector>
2#include <c10/util/Exception.h>2#include <c10/util/Exception.h>
3#include <c10/util/irange.h>3#include <c10/util/irange.h>
4-#include <third_party/acl/inc/acl/acl_rt.h>4+#include <acl/acl_rt.h>
5#include "torch_npu/csrc/core/npu/NpuVariables.h"5#include "torch_npu/csrc/core/npu/NpuVariables.h"
6#include "torch_npu/csrc/core/npu/NPUPeerToPeerAccess.h"6#include "torch_npu/csrc/core/npu/NPUPeerToPeerAccess.h"
7#include "torch_npu/csrc/core/npu/NPUGuard.h"7#include "torch_npu/csrc/core/npu/NPUGuard.h"
@@ -19,7 +19,7 @@
19#include <sstream>19#include <sstream>
20#include <sys/time.h>20#include <sys/time.h>
21#include <sys/eventfd.h>21#include <sys/eventfd.h>
22-#include <third_party/acl/inc/acl/acl_rt.h>22+#include <acl/acl_rt.h>
23 23 
24namespace c10_npu {24namespace c10_npu {
25struct timeval delay = { 0, 1 };25struct timeval delay = { 0, 1 };
@@ -7,7 +7,7 @@
7 7 
8#include <c10/core/Device.h>8#include <c10/core/Device.h>
9#include "torch_npu/csrc/logging/LogContext.h"9#include "torch_npu/csrc/logging/LogContext.h"
10-#include <third_party/acl/inc/acl/acl_op.h>10+#include <acl/acl_op.h>
11 11 
12namespace c10_npu {12namespace c10_npu {
13 13 
@@ -184,4 +184,4 @@ public:
184#define REGISTER_QUEUE_FUNC(execF, copyF, releaseF, newF, deleteF, copyReleaseParamF, releaseParamF) \184#define REGISTER_QUEUE_FUNC(execF, copyF, releaseF, newF, deleteF, copyReleaseParamF, releaseParamF) \
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_npu187+} // namespace c10_npu
@@ -20,7 +20,7 @@
20#include "torch_npu/csrc/core/npu/NPUStreamUtils.h"20#include "torch_npu/csrc/core/npu/NPUStreamUtils.h"
21#include "torch_npu/csrc/core/npu/sys_ctrl/npu_sys_ctrl.h"21#include "torch_npu/csrc/core/npu/sys_ctrl/npu_sys_ctrl.h"
22#include "torch_npu/csrc/core/npu/interface/AsyncTaskQueueInterface.h"22#include "torch_npu/csrc/core/npu/interface/AsyncTaskQueueInterface.h"
23-#include "third_party/acl/inc/acl/acl_rt.h"23+#include <acl/acl_rt.h>
24#ifndef BUILD_LIBTORCH24#ifndef BUILD_LIBTORCH
25#include "torch_npu/csrc/sanitizer/NPUTrace.h"25#include "torch_npu/csrc/sanitizer/NPUTrace.h"
26#endif26#endif
@@ -10,8 +10,8 @@
10#include "torch_npu/csrc/core/npu/NPUException.h"10#include "torch_npu/csrc/core/npu/NPUException.h"
11#include "torch_npu/csrc/core/npu/NPUQueue.h"11#include "torch_npu/csrc/core/npu/NPUQueue.h"
12#include "torch_npu/csrc/core/npu/npu_log.h"12#include "torch_npu/csrc/core/npu/npu_log.h"
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#include "torch_npu/csrc/aten/NPUNativeFunctions.h"15#include "torch_npu/csrc/aten/NPUNativeFunctions.h"
16 16 
17namespace c10_npu {17namespace c10_npu {
@@ -1,8 +1,8 @@
1#include <unistd.h>1#include <unistd.h>
2#include <c10/util/flat_hash_map.h>2#include <c10/util/flat_hash_map.h>
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#include "torch_npu/csrc/core/npu/NPUFunctions.h"6#include "torch_npu/csrc/core/npu/NPUFunctions.h"
7#include "torch_npu/csrc/core/npu/NpuVariables.h"7#include "torch_npu/csrc/core/npu/NpuVariables.h"
8#include "torch_npu/csrc/core/npu/NPUSwappedMemoryAllocator.h"8#include "torch_npu/csrc/core/npu/NPUSwappedMemoryAllocator.h"
@@ -4,8 +4,8 @@
4#include <c10/util/flat_hash_map.h>4#include <c10/util/flat_hash_map.h>
5#include <c10/util/irange.h>5#include <c10/util/irange.h>
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#include "torch_npu/csrc/core/npu/interface/AsyncTaskQueueInterface.h"9#include "torch_npu/csrc/core/npu/interface/AsyncTaskQueueInterface.h"
10#include "torch_npu/csrc/core/npu/register/OptionsManager.h"10#include "torch_npu/csrc/core/npu/register/OptionsManager.h"
11#include "torch_npu/csrc/core/npu/NPUFunctions.h"11#include "torch_npu/csrc/core/npu/NPUFunctions.h"
@@ -7,9 +7,9 @@
7#include "torch_npu/csrc/core/npu/NPUException.h"7#include "torch_npu/csrc/core/npu/NPUException.h"
8#include "torch_npu/csrc/core/npu/NPUFunctions.h"8#include "torch_npu/csrc/core/npu/NPUFunctions.h"
9#include "torch_npu/csrc/core/npu/NPUStream.h"9#include "torch_npu/csrc/core/npu/NPUStream.h"
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 
14namespace c10_npu {14namespace c10_npu {
15namespace impl {15namespace impl {
@@ -2,12 +2,12 @@
2 2 
3#include <c10/core/Device.h>3#include <c10/core/Device.h>
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#include "torch_npu/csrc/core/npu/interface/HcclInterface.h"9#include "torch_npu/csrc/core/npu/interface/HcclInterface.h"
10-#include "third_party/acl/inc/acl/acl.h"10+#include <acl/acl.h>
11 11 
12using aclrtHostFunc = void (*)(void *args);12using aclrtHostFunc = void (*)(void *args);
13struct aclrtMemUsageInfo;13struct aclrtMemUsageInfo;
@@ -6,7 +6,7 @@
6#include <ATen/record_function.h>6#include <ATen/record_function.h>
7#include "torch_npu/csrc/framework/utils/NpuUtils.h"7#include "torch_npu/csrc/framework/utils/NpuUtils.h"
8#include "torch_npu/csrc/framework/NPUDefine.h"8#include "torch_npu/csrc/framework/NPUDefine.h"
9-#include "third_party/acl/inc/acl/acl_rt.h"9+#include <acl/acl_rt.h>
10#ifndef BUILD_LIBTORCH10#ifndef BUILD_LIBTORCH
11#include "torch_npu/csrc/sanitizer/NPUTrace.h"11#include "torch_npu/csrc/sanitizer/NPUTrace.h"
12#endif12#endif
@@ -2,7 +2,7 @@
2 2 
3#include "c10/core/Storage.h"3#include "c10/core/Storage.h"
4#include "torch_npu/csrc/core/npu/NPUStream.h"4#include "torch_npu/csrc/core/npu/NPUStream.h"
5-#include "third_party/acl/inc/acl/acl_rt.h"5+#include <acl/acl_rt.h>
6 6 
7namespace c10_npu {7namespace c10_npu {
8namespace queue {8namespace queue {
@@ -1,5 +1,5 @@
1#pragma once1#pragma once
2-#include "third_party/acl/inc/aml/aml_fwk_detect.h"2+#include <aml/aml_fwk_detect.h>
3 3 
4namespace c10_npu {4namespace c10_npu {
5namespace amlapi {5namespace amlapi {
@@ -1,8 +1,8 @@
1#pragma once1#pragma once
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 
7namespace c10_npu {7namespace c10_npu {
8namespace skapi {8namespace skapi {
@@ -3,7 +3,7 @@
3#include <iostream>3#include <iostream>
4#include <string>4#include <string>
5#include <stdio.h>5#include <stdio.h>
6-#include "third_party/acl/inc/acl/acl_base.h"6+#include <acl/acl_base.h>
7#include "torch_npu/csrc/core/npu/register/OptionsManager.h"7#include "torch_npu/csrc/core/npu/register/OptionsManager.h"
8 8 
9#if defined(__GNUC__) && __GNUC__ >= 129#if defined(__GNUC__) && __GNUC__ >= 12
@@ -19,8 +19,8 @@
19#include "torch_npu/csrc/core/npu/register/OptionsManager.h"19#include "torch_npu/csrc/core/npu/register/OptionsManager.h"
20#include "torch_npu/csrc/core/npu/NpuVariables.h"20#include "torch_npu/csrc/core/npu/NpuVariables.h"
21#include "torch_npu/csrc/distributed/symm_mem/NPUSHMEMInterface.h"21#include "torch_npu/csrc/distributed/symm_mem/NPUSHMEMInterface.h"
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#include "torch_npu/csrc/framework/interface/AclOpCompileInterface.h"24#include "torch_npu/csrc/framework/interface/AclOpCompileInterface.h"
25#include "torch_npu/csrc/framework/LazyInitAclops.h"25#include "torch_npu/csrc/framework/LazyInitAclops.h"
26#include "torch_npu/csrc/core/npu/NPUFunctions.h"26#include "torch_npu/csrc/core/npu/NPUFunctions.h"
@@ -1,6 +1,6 @@
1#pragma once1#pragma once
2 2 
3-#include <third_party/acl/inc/acl/acl.h>3+#include <acl/acl.h>
4#include <map>4#include <map>
5#include <string>5#include <string>
6#include <vector>6#include <vector>
@@ -7,7 +7,7 @@
7#include "torch_npu/csrc/core/npu/NPUMacros.h"7#include "torch_npu/csrc/core/npu/NPUMacros.h"
8#include "torch_npu/csrc/core/npu/NPUException.h"8#include "torch_npu/csrc/core/npu/NPUException.h"
9#include "torch_npu/csrc/framework/utils/OpPreparation.h"9#include "torch_npu/csrc/framework/utils/OpPreparation.h"
10-#include "third_party/acl/inc/acl/acl_base.h"10+#include <acl/acl_base.h>
11 11 
12namespace c10_npu {12namespace c10_npu {
13const int g_toAclOffset = 256;13const int g_toAclOffset = 256;
@@ -33,8 +33,8 @@
33#include <arpa/inet.h>33#include <arpa/inet.h>
34 34 
35#include "op_plugin/OpInterface.h"35#include "op_plugin/OpInterface.h"
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#include "torch_npu/csrc/aten/CustomFunctions.h"38#include "torch_npu/csrc/aten/CustomFunctions.h"
39#include "torch_npu/csrc/aten/NPUNativeFunctions.h"39#include "torch_npu/csrc/aten/NPUNativeFunctions.h"
40#include "torch_npu/csrc/core/npu/GetCANNInfo.h"40#include "torch_npu/csrc/core/npu/GetCANNInfo.h"
@@ -16,7 +16,7 @@
16 16 
17#include "third_party/Tensorpipe/tensorpipe/common/device_id.h"17#include "third_party/Tensorpipe/tensorpipe/common/device_id.h"
18#include "third_party/Tensorpipe/tensorpipe/tensorpipe.h"18#include "third_party/Tensorpipe/tensorpipe/tensorpipe.h"
19-#include "third_party/acl/inc/acl/acl_rt.h"19+#include <acl/acl_rt.h>
20#include "torch_npu/csrc/core/npu/sys_ctrl/npu_sys_ctrl.h"20#include "torch_npu/csrc/core/npu/sys_ctrl/npu_sys_ctrl.h"
21#include "torch_npu/csrc/distributed/rpc/tensorpipe_utils.h"21#include "torch_npu/csrc/distributed/rpc/tensorpipe_utils.h"
22#include "torch_npu/csrc/core/npu/NPUFunctions.h"22#include "torch_npu/csrc/core/npu/NPUFunctions.h"
@@ -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 the365+ // otherwise there is a discrepancy with initialization among one of the
366 // members366 // members
367}367}
368 368 
@@ -3,7 +3,7 @@
3#include <cstddef>3#include <cstddef>
4#include <cstdint>4#include <cstdint>
5#include "third_party/shmem/include/shmem_host_def.h"5#include "third_party/shmem/include/shmem_host_def.h"
6-#include "third_party/acl/inc/acl/acl_base.h"6+#include <acl/acl_base.h>
7 7 
8namespace c10d {8namespace c10d {
9namespace symmetric_memory {9namespace symmetric_memory {
@@ -4,7 +4,7 @@
4#include <ATen/ATen.h>4#include <ATen/ATen.h>
5 5 
6#include "torch_npu/csrc/framework/utils/NPUDefinition.h"6#include "torch_npu/csrc/framework/utils/NPUDefinition.h"
7-#include "third_party/acl/inc/acl/acl_base.h"7+#include <acl/acl_base.h>
8 8 
9namespace at_npu {9namespace at_npu {
10namespace native {10namespace native {
@@ -47,4 +47,4 @@ public:
47} // namespace native47} // namespace native
48} // namespace at_npu48} // namespace at_npu
49 49 
50-#endif // __NATIVE_NPU_UTILS_FORMAT_INFER__50+#endif // __NATIVE_NPU_UTILS_FORMAT_INFER__
@@ -5,7 +5,7 @@
5#include <vector>5#include <vector>
6#include <string>6#include <string>
7#include <utility>7#include <utility>
8-#include "third_party/acl/inc/acl/acl_op_compiler.h"8+#include <acl/acl_op_compiler.h>
9 9 
10namespace at_npu {10namespace at_npu {
11namespace aclops {11namespace aclops {
@@ -27,4 +27,4 @@ void InitializeJitCompilationMode();
27} // namespace aclops27} // namespace aclops
28} // namespace at_npu28} // namespace at_npu
29 29 
30-#endif // AT_NPU_ACLOPS_LAZYINITACLOPS_H_30+#endif // AT_NPU_ACLOPS_LAZYINITACLOPS_H_
@@ -4,8 +4,8 @@
4#include <ATen/ATen.h>4#include <ATen/ATen.h>
5 5 
6#include "torch_npu/csrc/framework/utils/NpuUtils.h"6#include "torch_npu/csrc/framework/utils/NpuUtils.h"
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 
10namespace at_npu {10namespace at_npu {
11namespace native {11namespace native {
@@ -39,4 +39,4 @@ public:
39} // namespace native39} // namespace native
40} // namespace at_npu40} // namespace at_npu
41 41 
42-#endif42+#endif
@@ -4,7 +4,7 @@
4#include "torch_npu/csrc/core/npu/NPUStream.h"4#include "torch_npu/csrc/core/npu/NPUStream.h"
5#include "torch_npu/csrc/logging/LogContext.h"5#include "torch_npu/csrc/logging/LogContext.h"
6 6 
7-#include "third_party/acl/inc/acl/acl_base.h"7+#include <acl/acl_base.h>
8#include "torch_npu/csrc/framework/interface/AclOpCompileInterface.h"8#include "torch_npu/csrc/framework/interface/AclOpCompileInterface.h"
9#include "torch_npu/csrc/framework/NPUDefine.h"9#include "torch_npu/csrc/framework/NPUDefine.h"
10#include "torch_npu/csrc/framework/utils/ForceJitCompileList.h"10#include "torch_npu/csrc/framework/utils/ForceJitCompileList.h"
@@ -443,4 +443,4 @@ void SetDeterministicOps(bool deterministicAlgorithmsStatus);
443} // namespace native443} // namespace native
444} // namespace at_npu444} // namespace at_npu
445 445 
446-#endif446+#endif
@@ -2,7 +2,7 @@
2#define __NATIVE_NPU_TOOLS_AOEUTILS__2#define __NATIVE_NPU_TOOLS_AOEUTILS__
3 3 
4#include <unordered_set>4#include <unordered_set>
5-#include <third_party/acl/inc/acl/acl_op_compiler.h>5+#include <acl/acl_op_compiler.h>
6#include "torch_npu/csrc/core/npu/NPUException.h"6#include "torch_npu/csrc/core/npu/NPUException.h"
7 7 
8namespace at_npu {8namespace at_npu {
@@ -147,4 +147,4 @@ AoeDumpGraphManager& aoe_manager();
147} // namespace native147} // namespace native
148} // namespace at_npu148} // namespace at_npu
149 149 
150-#endif // __NATIVE_NPU_TOOLS_AOEUTILS__150+#endif // __NATIVE_NPU_TOOLS_AOEUTILS__
@@ -3,7 +3,7 @@
3 3 
4#include <c10/util/SmallVector.h>4#include <c10/util/SmallVector.h>
5 5 
6-#include "third_party/acl/inc/acl/acl_base.h"6+#include <acl/acl_base.h>
7#include "torch_npu/csrc/framework/utils/NpuUtils.h"7#include "torch_npu/csrc/framework/utils/NpuUtils.h"
8#include "torch_npu/csrc/framework/utils/NPUDefinition.h"8#include "torch_npu/csrc/framework/utils/NPUDefinition.h"
9 9 
@@ -40,4 +40,4 @@ struct ContiguousTensorDesc {
40} // namespace native40} // namespace native
41} // namespace at_npu41} // namespace at_npu
42 42 
43-#endif43+#endif
@@ -1,10 +1,10 @@
1#ifndef __TORCH_NPU_INTERFACE_ACLINTERFACE__1#ifndef __TORCH_NPU_INTERFACE_ACLINTERFACE__
2#define __TORCH_NPU_INTERFACE_ACLINTERFACE__2#define __TORCH_NPU_INTERFACE_ACLINTERFACE__
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 
9namespace at_npu {9namespace at_npu {
10namespace native {10namespace native {
@@ -76,4 +76,4 @@ aclError AclopStopDumpArgs(uint32_t dumpType);
76} // namespace native76} // namespace native
77} // namespace at_npu77} // namespace at_npu
78 78 
79-#endif // __TORCH_NPU_INTERFACE_ACLINTERFACE__79+#endif // __TORCH_NPU_INTERFACE_ACLINTERFACE__
@@ -5,7 +5,7 @@
5#include "torch_npu/csrc/core/npu/register/FunctionLoader.h"5#include "torch_npu/csrc/core/npu/register/FunctionLoader.h"
6#include "torch_npu/csrc/framework/interface/AclOpCompileInterface.h"6#include "torch_npu/csrc/framework/interface/AclOpCompileInterface.h"
7#include "torch_npu/csrc/core/npu/register/OptionsManager.h"7#include "torch_npu/csrc/core/npu/register/OptionsManager.h"
8-#include "third_party/acl/inc/acl/acl_base.h"8+#include <acl/acl_base.h>
9 9 
10namespace at_npu10namespace at_npu
11{11{
@@ -191,4 +191,4 @@ aclError AclDestroyAclOpExecutor(aclOpExecutor *executor)
191}191}
192 192 
193 } // namespace native193 } // namespace native
194-} // namespace at_npu194+} // namespace at_npu
@@ -1,7 +1,7 @@
1#ifndef __PLUGIN_NATIVE_NPU_INTERFACE_ACLOPCOMPILE__1#ifndef __PLUGIN_NATIVE_NPU_INTERFACE_ACLOPCOMPILE__
2#define __PLUGIN_NATIVE_NPU_INTERFACE_ACLOPCOMPILE__2#define __PLUGIN_NATIVE_NPU_INTERFACE_ACLOPCOMPILE__
3#include <c10/util/Optional.h>3#include <c10/util/Optional.h>
4-#include "third_party/acl/inc/acl/acl_op_compiler.h"4+#include <acl/acl_op_compiler.h>
5 5 
6typedef struct aclOpExecutor aclOpExecutor;6typedef struct aclOpExecutor aclOpExecutor;
7 7 
@@ -148,4 +148,4 @@ ACL_FUNC_VISIBILITY aclError AclDestroyAclOpExecutor(aclOpExecutor *executor);
148} // namespace native148} // namespace native
149} // namespace at_npu149} // namespace at_npu
150 150 
151-#endif // __NATIVE_NPU_INTERFACE_ACLOPCOMPILE__151+#endif // __NATIVE_NPU_INTERFACE_ACLOPCOMPILE__
@@ -7,7 +7,7 @@
7#include <string>7#include <string>
8#include "torch_npu/csrc/core/npu/NPUException.h"8#include "torch_npu/csrc/core/npu/NPUException.h"
9 9 
10-#include "third_party/acl/inc/acl/acl_mdl.h"10+#include <acl/acl_mdl.h>
11#include "torch_npu/csrc/framework/utils/ForceJitCompileList.h"11#include "torch_npu/csrc/framework/utils/ForceJitCompileList.h"
12#include "torch_npu/csrc/framework/utils/ForceAclnnList.h"12#include "torch_npu/csrc/framework/utils/ForceAclnnList.h"
13#include "torch_npu/csrc/framework/interface/AclOpCompileInterface.h"13#include "torch_npu/csrc/framework/interface/AclOpCompileInterface.h"
@@ -1,7 +1,7 @@
1#include "torch_npu/csrc/framework/interface/MsProfilerInterface.h"1#include "torch_npu/csrc/framework/interface/MsProfilerInterface.h"
2#include "torch_npu/csrc/core/npu/NPUException.h"2#include "torch_npu/csrc/core/npu/NPUException.h"
3#include "torch_npu/csrc/core/npu/register/FunctionLoader.h"3#include "torch_npu/csrc/core/npu/register/FunctionLoader.h"
4-#include "third_party/acl/inc/acl/acl_prof.h"4+#include <acl/acl_prof.h>
5 5 
6namespace at_npu {6namespace at_npu {
7namespace native {7namespace native {
@@ -1,7 +1,7 @@
1#ifndef __TORCH_NPU_MSPROFILERINTERFACE__1#ifndef __TORCH_NPU_MSPROFILERINTERFACE__
2#define __TORCH_NPU_MSPROFILERINTERFACE__2#define __TORCH_NPU_MSPROFILERINTERFACE__
3 3 
4-#include <third_party/acl/inc/acl/acl_prof.h>4+#include <acl/acl_prof.h>
5#include "torch_npu/csrc/core/npu/NPUException.h"5#include "torch_npu/csrc/core/npu/NPUException.h"
6 6 
7namespace at_npu {7namespace at_npu {
@@ -1,7 +1,7 @@
1#include <ATen/record_function.h>1#include <ATen/record_function.h>
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#include "torch_npu/csrc/aten/mirror/NPUMemoryOverlap.h"5#include "torch_npu/csrc/aten/mirror/NPUMemoryOverlap.h"
6#include "torch_npu/csrc/core/NPUBridge.h"6#include "torch_npu/csrc/core/NPUBridge.h"
7#include "torch_npu/csrc/core/NPUStorageImpl.h"7#include "torch_npu/csrc/core/NPUStorageImpl.h"
@@ -14,8 +14,8 @@
14#include "torch_npu/csrc/framework/utils/NpuUtils.h"14#include "torch_npu/csrc/framework/utils/NpuUtils.h"
15#include "torch_npu/csrc/core/npu/interface/AclInterface.h"15#include "torch_npu/csrc/core/npu/interface/AclInterface.h"
16#include "torch_npu/csrc/core/npu/npu_log.h"16#include "torch_npu/csrc/core/npu/npu_log.h"
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 
20using std::string;20using std::string;
21using std::vector;21using std::vector;
@@ -3,7 +3,7 @@
3 3 
4 4 
5#include <c10/util/SmallVector.h>5#include <c10/util/SmallVector.h>
6-#include <third_party/acl/inc/graph/operator.h>6+#include <graph/operator.h>
7 7 
8#include <functional>8#include <functional>
9#include <vector>9#include <vector>
@@ -21,4 +21,4 @@ using DynamicInputRegFunc = std::function<ge::OperatorPtr(DyNumAndIndex, std::st
21} // namespace native21} // namespace native
22} // namespace at_npu22} // namespace at_npu
23 23 
24-#endif // __NATIVE_NPU_UTILS_NPU_CONFIG__24+#endif // __NATIVE_NPU_UTILS_NPU_CONFIG__
@@ -7,9 +7,9 @@
7#include <ATen/ATen.h>7#include <ATen/ATen.h>
8#include "torch_npu/csrc/core/npu/npu_log.h"8#include "torch_npu/csrc/core/npu/npu_log.h"
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#include "torch_npu/csrc/core/npu/NPUCachingAllocator.h"14#include "torch_npu/csrc/core/npu/NPUCachingAllocator.h"
15#include "torch_npu/csrc/core/npu/interface/AsyncTaskQueueInterface.h"15#include "torch_npu/csrc/core/npu/interface/AsyncTaskQueueInterface.h"
@@ -2,8 +2,8 @@
2 2 
3#if defined(USE_NPU)3#if defined(USE_NPU)
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 
8typedef void* NPUdeviceptr;8typedef void* NPUdeviceptr;
9 9 
@@ -8,8 +8,8 @@
8#include <torch_npu/csrc/framework/OpCommand.h>8#include <torch_npu/csrc/framework/OpCommand.h>
9#include <torch_npu/csrc/profiler/profiler_mgr.h>9#include <torch_npu/csrc/profiler/profiler_mgr.h>
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 
14struct TilingMem {14struct 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_LIBTORCH170+#endif // BUILD_LIBTORCH
@@ -1,8 +1,8 @@
1#ifndef BUILD_LIBTORCH1#ifndef BUILD_LIBTORCH
2#include <Python.h>2#include <Python.h>
3#include <functional>3#include <functional>
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#include "torch_npu/csrc/inductor/mlir/hacl_rt.h"6#include "torch_npu/csrc/inductor/mlir/hacl_rt.h"
7 7 
8rtError_t common_launch(char* kernelName, const void* func, uint32_t gridX, void* args, uint32_t argsSize,8rtError_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
10rtError_t common_launch_dyn(char* kernelName, void* func, void* tiling_func, int64_t tilingSize, void* arg_tiling_host,10rtError_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);
12void opcommand_call(const char* name, std::function<int()> launch_call);12void opcommand_call(const char* name, std::function<int()> launch_call);
13-#endif // BUILD_LIBTORCH13+#endif // BUILD_LIBTORCH
@@ -8,8 +8,8 @@
8#include "torch_npu/csrc/core/npu/interface/AsyncTaskQueueInterface.h"8#include "torch_npu/csrc/core/npu/interface/AsyncTaskQueueInterface.h"
9#include "torch_npu/csrc/ipc/NPUIPCTypes.h"9#include "torch_npu/csrc/ipc/NPUIPCTypes.h"
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 
14namespace torch_npu {14namespace torch_npu {
15namespace ipc {15namespace ipc {
@@ -264,4 +264,4 @@ namespace NPUCachingAllocator {
264REGISTER_FREE_MEMORY_CALLBACK("npu_ipc_collect", NpuIPCCollectCallback);264REGISTER_FREE_MEMORY_CALLBACK("npu_ipc_collect", NpuIPCCollectCallback);
265 265 
266} // namespace NPUCachingAllocator266} // namespace NPUCachingAllocator
267-} // namespace c10_npu267+} // namespace c10_npu
@@ -22,8 +22,8 @@
22#include "torch_npu/csrc/ipc/NPUIPCTypes.h"22#include "torch_npu/csrc/ipc/NPUIPCTypes.h"
23#include "torch_npu/csrc/ipc/StorageSharing.h"23#include "torch_npu/csrc/ipc/StorageSharing.h"
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 
28namespace torch_npu {28namespace torch_npu {
29namespace reductions {29namespace reductions {
@@ -5,9 +5,9 @@
5#include <torch/csrc/jit/python/pybind_utils.h>5#include <torch/csrc/jit/python/pybind_utils.h>
6#include <torch/csrc/utils/pybind.h>6#include <torch/csrc/utils/pybind.h>
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 
12struct PendingTensorData {12struct 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#include <torch/csrc/utils/tensor_numpy.h>24#include <torch/csrc/utils/tensor_numpy.h>
25 25 
26#include <op_plugin/utils/custom_functions/opapi/FFTCommonOpApi.h>26#include <op_plugin/utils/custom_functions/opapi/FFTCommonOpApi.h>
27-#include <third_party/acl/inc/acl/acl.h>27+#include <acl/acl.h>
28#include <third_party/fmt/include/fmt/format.h>28#include <third_party/fmt/include/fmt/format.h>
29#include <torch_npu/csrc/aten/NPUGeneratorImpl.h>29#include <torch_npu/csrc/aten/NPUGeneratorImpl.h>
30#include <torch_npu/csrc/aten/NPUNativeFunctions.h>30#include <torch_npu/csrc/aten/NPUNativeFunctions.h>
@@ -3,9 +3,9 @@
3#include <torch/csrc/Device.h>3#include <torch/csrc/Device.h>
4#include <torch/csrc/THP.h>4#include <torch/csrc/THP.h>
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#include "torch_npu/csrc/core/npu/NPUGuard.h"9#include "torch_npu/csrc/core/npu/NPUGuard.h"
10#include "torch_npu/csrc/core/npu/sys_ctrl/npu_sys_ctrl.h"10#include "torch_npu/csrc/core/npu/sys_ctrl/npu_sys_ctrl.h"
11#include "torch_npu/csrc/npu/Module.h"11#include "torch_npu/csrc/npu/Module.h"
@@ -7,7 +7,7 @@
7#include <vector>7#include <vector>
8#include <tuple>8#include <tuple>
9 9 
10-#include "third_party/acl/inc/acl/acl_prof.h"10+#include <acl/acl_prof.h>
11 11 
12#include "torch_npu/csrc/toolkit/profiler/common/singleton.h"12#include "torch_npu/csrc/toolkit/profiler/common/singleton.h"
13#include "torch_npu/csrc/toolkit/profiler/common/utils.h"13#include "torch_npu/csrc/toolkit/profiler/common/utils.h"
@@ -7,8 +7,8 @@
7 7 
8#include <ATen/record_function.h>8#include <ATen/record_function.h>
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#include "torch_npu/csrc/toolkit/profiler/inc/data_reporter.h"13#include "torch_npu/csrc/toolkit/profiler/inc/data_reporter.h"
14#include "torch_npu/csrc/profiler/profiler_mgr.h"14#include "torch_npu/csrc/profiler/profiler_mgr.h"
@@ -4,7 +4,7 @@
4#include <mutex>4#include <mutex>
5#include <map>5#include <map>
6 6 
7-#include "third_party/acl/inc/acl/acl_prof.h"7+#include <acl/acl_prof.h>
8 8 
9#include "torch_npu/csrc/toolkit/profiler/common/singleton.h"9#include "torch_npu/csrc/toolkit/profiler/common/singleton.h"
10#include "torch_npu/csrc/toolkit/profiler/inc/data_dumper.h"10#include "torch_npu/csrc/toolkit/profiler/inc/data_dumper.h"
@@ -7,7 +7,7 @@
7#include "torch_npu/csrc/core/npu/NPUStream.h"7#include "torch_npu/csrc/core/npu/NPUStream.h"
8#include "torch_npu/csrc/core/npu/NPUGuard.h"8#include "torch_npu/csrc/core/npu/NPUGuard.h"
9#include "torch_npu/csrc/core/npu/interface/AclInterface.h"9#include "torch_npu/csrc/core/npu/interface/AclInterface.h"
10-#include "third_party/acl/inc/acl/acl_rt.h"10+#include <acl/acl_rt.h>
11 11 
12namespace torch_npu {12namespace torch_npu {
13namespace profiler {13namespace profiler {
@@ -1,7 +1,6 @@
1import os1import os
2import setuptools2import setuptools
3 3 
4-import torch
5import torch.utils.cpp_extension as TorchExtension4import torch.utils.cpp_extension as TorchExtension
6 5 
7import torch_npu6import torch_npu
@@ -38,7 +37,6 @@ def NpuExtension(name, sources, *args, **kwargs):
38 torch_npu_dir = PYTORCH_NPU_INSTALL_PATH37 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_dirs42 kwargs['include_dirs'] = include_dirs