Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jerrrrry
infinicore
Commits
11dd5850
Unverified
Commit
11dd5850
authored
Jul 18, 2025
by
Jiacheng Huang
Committed by
GitHub
Jul 18, 2025
Browse files
Merge pull request #332 from InfiniTensor/issue/277
Issue/277: 为 ReLU 的九齿实现接入天数设备
parent
66dfb435
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
README.md
README.md
+1
-1
src/infiniop/ops/relu/operator.cc
src/infiniop/ops/relu/operator.cc
+21
-1
xmake/iluvatar.lua
xmake/iluvatar.lua
+4
-0
No files found.
README.md
View file @
11dd5850
...
@@ -155,7 +155,7 @@ pip install -e .
...
@@ -155,7 +155,7 @@ pip install -e .
2.
在
`InfiniCore`
文件夹下运行以下命令 AOT 编译库中的九齿算子:
2.
在
`InfiniCore`
文件夹下运行以下命令 AOT 编译库中的九齿算子:
```
shell
```
shell
PYTHONPATH
=
src
/
python scripts/build_ntops.py
PYTHONPATH
=
${
PYTHONPATH
}
:
src python scripts/build_ntops.py
```
```
注:如果对九齿相关文件有修改,需要重新构建 InfiniCore 时,也需要同时运行以上命令进行重新生成。
注:如果对九齿相关文件有修改,需要重新构建 InfiniCore 时,也需要同时运行以上命令进行重新生成。
...
...
src/infiniop/ops/relu/operator.cc
View file @
11dd5850
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
#ifdef ENABLE_CPU_API
#ifdef ENABLE_CPU_API
#include "cpu/relu_cpu.h"
#include "cpu/relu_cpu.h"
#endif
#endif
#ifdef
ENABLE_NVIDIA_API
#if
def
ined(
ENABLE_NVIDIA_API
) || defined(ENABLE_ILUVATAR_API)
#ifdef ENABLE_NINETOOTHED
#ifdef ENABLE_NINETOOTHED
#include "nvidia/relu_nvidia.cuh"
#include "nvidia/relu_nvidia.cuh"
#endif
#endif
...
@@ -40,6 +40,11 @@ __C infiniStatus_t infiniopCreateReluDescriptor(
...
@@ -40,6 +40,11 @@ __C infiniStatus_t infiniopCreateReluDescriptor(
CREATE
(
INFINI_DEVICE_NVIDIA
,
nvidia
);
CREATE
(
INFINI_DEVICE_NVIDIA
,
nvidia
);
#endif
#endif
#endif
#endif
#ifdef ENABLE_ILUVATAR_API
#ifdef ENABLE_NINETOOTHED
CREATE
(
INFINI_DEVICE_ILUVATAR
,
nvidia
);
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
#ifdef ENABLE_NINETOOTHED
#ifdef ENABLE_NINETOOTHED
CREATE
(
INFINI_DEVICE_METAX
,
metax
);
CREATE
(
INFINI_DEVICE_METAX
,
metax
);
...
@@ -69,6 +74,11 @@ __C infiniStatus_t infiniopGetReluWorkspaceSize(infiniopReluDescriptor_t desc, s
...
@@ -69,6 +74,11 @@ __C infiniStatus_t infiniopGetReluWorkspaceSize(infiniopReluDescriptor_t desc, s
GET
(
INFINI_DEVICE_NVIDIA
,
nvidia
)
GET
(
INFINI_DEVICE_NVIDIA
,
nvidia
)
#endif
#endif
#endif
#endif
#ifdef ENABLE_ILUVATAR_API
#ifdef ENABLE_NINETOOTHED
GET
(
INFINI_DEVICE_ILUVATAR
,
nvidia
)
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
#ifdef ENABLE_NINETOOTHED
#ifdef ENABLE_NINETOOTHED
GET
(
INFINI_DEVICE_METAX
,
metax
)
GET
(
INFINI_DEVICE_METAX
,
metax
)
...
@@ -105,6 +115,11 @@ __C infiniStatus_t infiniopRelu(
...
@@ -105,6 +115,11 @@ __C infiniStatus_t infiniopRelu(
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
nvidia
);
CALCULATE
(
INFINI_DEVICE_NVIDIA
,
nvidia
);
#endif
#endif
#endif
#endif
#ifdef ENABLE_ILUVATAR_API
#ifdef ENABLE_NINETOOTHED
CALCULATE
(
INFINI_DEVICE_ILUVATAR
,
nvidia
);
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
#ifdef ENABLE_NINETOOTHED
#ifdef ENABLE_NINETOOTHED
CALCULATE
(
INFINI_DEVICE_METAX
,
metax
);
CALCULATE
(
INFINI_DEVICE_METAX
,
metax
);
...
@@ -136,6 +151,11 @@ infiniopDestroyReluDescriptor(infiniopReluDescriptor_t desc) {
...
@@ -136,6 +151,11 @@ infiniopDestroyReluDescriptor(infiniopReluDescriptor_t desc) {
DELETE
(
INFINI_DEVICE_NVIDIA
,
nvidia
);
DELETE
(
INFINI_DEVICE_NVIDIA
,
nvidia
);
#endif
#endif
#endif
#endif
#ifdef ENABLE_ILUVATAR_API
#ifdef ENABLE_NINETOOTHED
DELETE
(
INFINI_DEVICE_ILUVATAR
,
nvidia
);
#endif
#endif
#ifdef ENABLE_METAX_API
#ifdef ENABLE_METAX_API
#ifdef ENABLE_NINETOOTHED
#ifdef ENABLE_NINETOOTHED
DELETE
(
INFINI_DEVICE_METAX
,
metax
);
DELETE
(
INFINI_DEVICE_METAX
,
metax
);
...
...
xmake/iluvatar.lua
View file @
11dd5850
...
@@ -49,6 +49,10 @@ target("infiniop-iluvatar")
...
@@ -49,6 +49,10 @@ target("infiniop-iluvatar")
-- set_languages("cxx17") 天数似乎不能用这个配置
-- set_languages("cxx17") 天数似乎不能用这个配置
add_files
(
"../src/infiniop/devices/nvidia/*.cu"
,
"../src/infiniop/ops/*/nvidia/*.cu"
)
add_files
(
"../src/infiniop/devices/nvidia/*.cu"
,
"../src/infiniop/ops/*/nvidia/*.cu"
)
if
has_config
(
"ninetoothed"
)
then
add_files
(
"../build/ninetoothed/*.c"
,
{
cxflags
=
{
"-Wno-return-type"
}})
end
target_end
()
target_end
()
target
(
"infinirt-iluvatar"
)
target
(
"infinirt-iluvatar"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment