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
8b59f4fe
Commit
8b59f4fe
authored
May 20, 2025
by
Catheriany
Browse files
Merge remote-tracking branch 'origin/main' into issue/204
parents
16506fc0
df1c6b5d
Changes
65
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
7 deletions
+23
-7
test/infiniop/rms_norm.py
test/infiniop/rms_norm.py
+5
-2
test/infiniop/rope.py
test/infiniop/rope.py
+3
-2
xmake.lua
xmake.lua
+3
-0
xmake/ascend.lua
xmake/ascend.lua
+2
-3
xmake/bang.lua
xmake/bang.lua
+10
-0
No files found.
test/infiniop/rms_norm.py
View file @
8b59f4fe
...
@@ -72,6 +72,7 @@ def test(
...
@@ -72,6 +72,7 @@ def test(
x_stride
,
x_stride
,
w_dtype
=
torch
.
float16
,
w_dtype
=
torch
.
float16
,
dtype
=
torch
.
float16
,
dtype
=
torch
.
float16
,
sync
=
None
):
):
print
(
print
(
f
"Testing RMS_Norm on
{
torch_device
}
with y_shape:
{
y_shape
}
x_shape:
{
x_shape
}
w_shape:
{
w_shape
}
"
f
"Testing RMS_Norm on
{
torch_device
}
with y_shape:
{
y_shape
}
x_shape:
{
x_shape
}
w_shape:
{
w_shape
}
"
...
@@ -89,9 +90,11 @@ def test(
...
@@ -89,9 +90,11 @@ def test(
rearrange_if_needed
(
tensor
,
stride
)
rearrange_if_needed
(
tensor
,
stride
)
for
tensor
,
stride
in
zip
([
x
,
y
],
[
x_stride
,
y_stride
])
for
tensor
,
stride
in
zip
([
x
,
y
],
[
x_stride
,
y_stride
])
]
]
x_tensor
,
y_tensor
,
w_tensor
=
[
to_tensor
(
tensor
,
lib
)
for
tensor
in
[
x
,
y
,
w
]]
x_tensor
,
y_tensor
,
w_tensor
=
[
to_tensor
(
tensor
,
lib
)
for
tensor
in
[
x
,
y
,
w
]]
if
sync
is
not
None
:
sync
()
descriptor
=
infiniopRMSNormDescriptor_t
()
descriptor
=
infiniopRMSNormDescriptor_t
()
check_error
(
check_error
(
...
...
test/infiniop/rope.py
View file @
8b59f4fe
...
@@ -117,6 +117,7 @@ def test(
...
@@ -117,6 +117,7 @@ def test(
y_strides
=
None
,
y_strides
=
None
,
inplace
=
Inplace
.
OUT_OF_PLACE
,
inplace
=
Inplace
.
OUT_OF_PLACE
,
dtype
=
torch
.
float32
,
dtype
=
torch
.
float32
,
sync
=
None
):
):
if
inplace
==
Inplace
.
INPLACE_X
:
if
inplace
==
Inplace
.
INPLACE_X
:
y_strides
=
x_strides
y_strides
=
x_strides
...
@@ -147,8 +148,8 @@ def test(
...
@@ -147,8 +148,8 @@ def test(
else
:
else
:
y_tensor
=
to_tensor
(
y
,
lib
)
y_tensor
=
to_tensor
(
y
,
lib
)
if
torch_device
==
"npu"
:
if
sync
is
not
None
:
sync
hronize_device
(
torch_device
)
sync
(
)
check_error
(
check_error
(
lib
.
infiniopCreateRoPEDescriptor
(
lib
.
infiniopCreateRoPEDescriptor
(
...
...
xmake.lua
View file @
8b59f4fe
...
@@ -162,6 +162,9 @@ target("infinirt")
...
@@ -162,6 +162,9 @@ target("infinirt")
if
has_config
(
"nv-gpu"
)
then
if
has_config
(
"nv-gpu"
)
then
add_deps
(
"infinirt-cuda"
)
add_deps
(
"infinirt-cuda"
)
end
end
if
has_config
(
"cambricon-mlu"
)
then
add_deps
(
"infinirt-cambricon"
)
end
if
has_config
(
"ascend-npu"
)
then
if
has_config
(
"ascend-npu"
)
then
add_deps
(
"infinirt-ascend"
)
add_deps
(
"infinirt-ascend"
)
end
end
...
...
xmake/ascend.lua
View file @
8b59f4fe
...
@@ -50,9 +50,8 @@ target("infiniop-ascend")
...
@@ -50,9 +50,8 @@ target("infiniop-ascend")
add_files
(
"$(projectdir)/src/infiniop/devices/ascend/*.cc"
,
"$(projectdir)/src/infiniop/ops/*/ascend/*.cc"
)
add_files
(
"$(projectdir)/src/infiniop/devices/ascend/*.cc"
,
"$(projectdir)/src/infiniop/ops/*/ascend/*.cc"
)
-- Add operator
-- Add operator
-- TODO: add it back after ascend-kernels is fixed
add_rules
(
"ascend-kernels"
)
-- add_rules("ascend-kernels")
add_links
(
builddir
..
"/libascend_kernels.a"
)
-- add_links(builddir.."/libascend_kernels.a")
target_end
()
target_end
()
target
(
"infinirt-ascend"
)
target
(
"infinirt-ascend"
)
...
...
xmake/bang.lua
View file @
8b59f4fe
...
@@ -50,3 +50,13 @@ target("infiniop-cambricon")
...
@@ -50,3 +50,13 @@ target("infiniop-cambricon")
add_files
(
mlu_files
,
{
rule
=
"mlu"
})
add_files
(
mlu_files
,
{
rule
=
"mlu"
})
end
end
target_end
()
target_end
()
target
(
"infinirt-cambricon"
)
set_kind
(
"static"
)
add_deps
(
"infini-utils"
)
set_languages
(
"cxx17"
)
on_install
(
function
(
target
)
end
)
-- Add include dirs
add_files
(
"../src/infinirt/bang/*.cc"
)
add_cxflags
(
"-lstdc++ -Wall -Werror -fPIC"
)
target_end
()
Prev
1
2
3
4
Next
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