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
93d261ed
Commit
93d261ed
authored
Feb 12, 2026
by
zhushuang
Browse files
issue/1021 - feat: support bf16 in infiniccl on moore_gpu_arch mp_31 with mccl
parent
718b18cf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
4 deletions
+44
-4
src/infiniccl/moore/infiniccl_moore.cc
src/infiniccl/moore/infiniccl_moore.cc
+16
-3
xmake.lua
xmake.lua
+6
-0
xmake/moore.lua
xmake/moore.lua
+22
-1
No files found.
src/infiniccl/moore/infiniccl_moore.cc
View file @
93d261ed
...
@@ -23,6 +23,12 @@ inline mcclDataType_t getMcclDtype(infiniDtype_t datatype) {
...
@@ -23,6 +23,12 @@ inline mcclDataType_t getMcclDtype(infiniDtype_t datatype) {
return
mcclFloat
;
return
mcclFloat
;
case
INFINI_DTYPE_F16
:
case
INFINI_DTYPE_F16
:
return
mcclHalf
;
return
mcclHalf
;
#if MARCH_TYPE == 310
case
INFINI_DTYPE_BF16
:
return
mcclBfloat16
;
#endif
default:
default:
std
::
abort
();
std
::
abort
();
return
mcclHalf
;
return
mcclHalf
;
...
@@ -83,9 +89,16 @@ infiniStatus_t allReduce(
...
@@ -83,9 +89,16 @@ infiniStatus_t allReduce(
infinicclComm_t
comm
,
infinicclComm_t
comm
,
infinirtStream_t
stream
)
{
infinirtStream_t
stream
)
{
if
(
datatype
!=
INFINI_DTYPE_F32
&&
datatype
!=
INFINI_DTYPE_F16
)
{
#if MARCH_TYPE == 310
return
INFINI_STATUS_BAD_PARAM
;
CHECK_DTYPE
(
datatype
,
}
INFINI_DTYPE_F32
,
INFINI_DTYPE_F16
,
INFINI_DTYPE_BF16
);
#else
CHECK_DTYPE
(
datatype
,
INFINI_DTYPE_F32
,
INFINI_DTYPE_F16
);
#endif
CHECK_MCCL
(
mcclAllReduce
(
sendbuf
,
recvbuf
,
count
,
getMcclDtype
(
datatype
),
CHECK_MCCL
(
mcclAllReduce
(
sendbuf
,
recvbuf
,
count
,
getMcclDtype
(
datatype
),
getMcclRedOp
(
op
),
getMcclComm
(
comm
),
getMusaStream
(
stream
)));
getMcclRedOp
(
op
),
getMcclComm
(
comm
),
getMusaStream
(
stream
)));
...
...
xmake.lua
View file @
93d261ed
...
@@ -180,6 +180,12 @@ option("moore-gpu")
...
@@ -180,6 +180,12 @@ option("moore-gpu")
set_description
(
"Whether to compile implementations for Moore Threads GPU"
)
set_description
(
"Whether to compile implementations for Moore Threads GPU"
)
option_end
()
option_end
()
option
(
"moore-gpu-arch"
)
set_default
(
"mp_31"
)
set_showmenu
(
true
)
set_description
(
"Set Moore GPU architecture (e.g. mp_31)"
)
option_end
()
if
has_config
(
"moore-gpu"
)
then
if
has_config
(
"moore-gpu"
)
then
add_defines
(
"ENABLE_MOORE_API"
)
add_defines
(
"ENABLE_MOORE_API"
)
includes
(
"xmake/moore.lua"
)
includes
(
"xmake/moore.lua"
)
...
...
xmake/moore.lua
View file @
93d261ed
...
@@ -16,7 +16,22 @@ rule("mu")
...
@@ -16,7 +16,22 @@ rule("mu")
local
mcc
=
MUSA_ROOT
..
"/bin/mcc"
local
mcc
=
MUSA_ROOT
..
"/bin/mcc"
local
includedirs
=
table.concat
(
target
:
get
(
"includedirs"
),
" "
)
local
includedirs
=
table.concat
(
target
:
get
(
"includedirs"
),
" "
)
local
args
=
{
"-c"
,
sourcefile
,
"-o"
,
objectfile
,
"-I"
..
MUSA_ROOT
..
"/include"
,
"-O3"
,
"-fPIC"
,
"-Wall"
,
"-std=c++17"
,
"-pthread"
}
local
args
=
{
"-c"
,
sourcefile
,
"-o"
,
objectfile
,
"-I"
..
MUSA_ROOT
..
"/include"
,
"-O3"
,
"-fPIC"
,
"-Wall"
,
"-std=c++17"
,
"-pthread"
}
local
moore_gpu_arch
=
get_config
(
"moore-gpu-arch"
)
if
moore_gpu_arch
==
"mp_31"
then
table.insert
(
args
,
1
,
"--cuda-gpu-arch=mp_31"
)
end
for
_
,
includedir
in
ipairs
(
target
:
get
(
"includedirs"
))
do
for
_
,
includedir
in
ipairs
(
target
:
get
(
"includedirs"
))
do
table.insert
(
args
,
"-I"
..
includedir
)
table.insert
(
args
,
"-I"
..
includedir
)
end
end
...
@@ -76,6 +91,12 @@ target("infiniccl-moore")
...
@@ -76,6 +91,12 @@ target("infiniccl-moore")
if
has_config
(
"ccl"
)
then
if
has_config
(
"ccl"
)
then
add_links
(
"libmccl.so"
)
add_links
(
"libmccl.so"
)
add_files
(
"../src/infiniccl/moore/*.cc"
)
add_files
(
"../src/infiniccl/moore/*.cc"
)
-- Moore GPU arch with mp_31 support mcclBfloat16 in MCCL
if
get_config
(
"moore-gpu-arch"
)
==
"mp_31"
then
add_defines
(
"MARCH_TYPE=310"
)
add_cxxflags
(
"-Wno-unused-function"
)
end
end
end
set_languages
(
"cxx17"
)
set_languages
(
"cxx17"
)
...
...
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