Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
DeepEP
Commits
eeaf98b0
Commit
eeaf98b0
authored
Dec 02, 2025
by
lijian6
Browse files
Add compile for dushmem.
Signed-off-by:
lijian
<
lijian6@sugon.com
>
parent
dd9d1740
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
18 deletions
+59
-18
.gitmodules
.gitmodules
+3
-0
build.sh
build.sh
+55
-18
third-party/dushmem-hip
third-party/dushmem-hip
+1
-0
No files found.
.gitmodules
View file @
eeaf98b0
[submodule "third-party/rocshmem"]
[submodule "third-party/rocshmem"]
path = third-party/rocshmem
path = third-party/rocshmem
url = http://112.11.119.99:10068/dcutoolkit/deeplearing/rocshmem.git
url = http://112.11.119.99:10068/dcutoolkit/deeplearing/rocshmem.git
[submodule "third-party/dushmem-hip"]
path = third-party/dushmem-hip
url = http://112.11.119.99:10068/lijian/dushmem-hip
build.sh
View file @
eeaf98b0
...
@@ -19,11 +19,6 @@ if [ -d "${llvm18_path}" ]; then
...
@@ -19,11 +19,6 @@ if [ -d "${llvm18_path}" ]; then
llvm_path
=
${
llvm18_path
}
llvm_path
=
${
llvm18_path
}
fi
fi
if
[
!
-d
"third-party/rocshmem/src/"
]
;
then
echo
"download submodule..."
git submodule update
--recursive
--init
fi
src_path
=
$(
dirname
"
$(
realpath
$0
)
"
)
src_path
=
$(
dirname
"
$(
realpath
$0
)
"
)
if
[
!
-d
"build_"
]
;
then
if
[
!
-d
"build_"
]
;
then
...
@@ -33,8 +28,22 @@ fi
...
@@ -33,8 +28,22 @@ fi
PYTHON_INCLUDE
=
$(
python3
-c
"from sysconfig import get_paths; print(get_paths()['include'])"
)
PYTHON_INCLUDE
=
$(
python3
-c
"from sysconfig import get_paths; print(get_paths()['include'])"
)
PYTHON_PLATLIB
=
$(
python3
-c
"from sysconfig import get_paths; print(get_paths()['platlib'])"
)
PYTHON_PLATLIB
=
$(
python3
-c
"from sysconfig import get_paths; print(get_paths()['platlib'])"
)
USE_NVSHMEM
=
${
USE_NVSHMEM
:
=OFF
}
USE_NVSHMEM
=
OFF
USE_ROCSHMEM
=
${
USE_ROCSHMEM
:
=ON
}
USE_ROCSHMEM
=
OFF
case
"
$1
"
in
rocshmem
)
USE_ROCSHMEM
=
ON
;;
nvshmem|dushmem
)
USE_NVSHMEM
=
ON
;;
*
)
echo
"Usage:
$0
[rocshmem|nvshmem]"
exit
1
;;
esac
echo
"USE_NVSHMEM=
$USE_NVSHMEM
"
echo
"USE_ROCSHMEM=
$USE_ROCSHMEM
"
# -------------------------- With rocSHMEM -------------------------- #
# -------------------------- With rocSHMEM -------------------------- #
build_rocshmem
()
build_rocshmem
()
...
@@ -55,27 +64,55 @@ build_rocshmem()
...
@@ -55,27 +64,55 @@ build_rocshmem()
}
}
if
[
"
$USE_ROCSHMEM
"
==
"ON"
]
;
then
if
[
"
$USE_ROCSHMEM
"
==
"ON"
]
;
then
if
[
!
-d
"third-party/rocshmem_dir"
]
;
then
if
[
!
-d
"third-party/rocshmem/src/"
]
;
then
mkdir
-p
third-party/rocshmem_dir
echo
"download submodule..."
git submodule update
--init
third-party/rocshmem
fi
fi
if
[
!
-d
"third-party/rocshmem_install"
]
;
then
mkdir
-p
third-party/rocshmem_install
fi
build_rocshmem
build_rocshmem
SHMEM_INSTALL_PREFIX
=
$(
pwd
)
/third-party/rocshmem_
dir
SHMEM_INSTALL_PREFIX
=
$(
pwd
)
/third-party/rocshmem_
install
COMPILE_OPTIONS
=
${
COMPILE_OPTIONS
:
= -fPIC -D__HIP_PLATFORM_AMD__=1 -DUSE_ROCM=1 -DHIPBLAS_V2 -DCUDA_HAS_FP16=1 -O3 -fgpu-rdc -DTORCH_API_INCLUDE_EXTENSION_H
'-DPYBIND11_COMPILER_TYPE="_gcc"'
'-DPYBIND11_STDLIB="_libstdcpp"'
'-DPYBIND11_BUILD_ABI="_cxxabi1014"'
-DTORCH_EXTENSION_NAME=deep_ep_cpp -D_GLIBCXX_USE_CXX11_ABI=1 --offload-arch=gfx936 -std=c++17 -Wno-return-type
}
COMPILE_OPTIONS
=
${
COMPILE_OPTIONS
:
= -fPIC -D__HIP_PLATFORM_AMD__=1 -DUSE_ROCM=1 -DHIPBLAS_V2 -DCUDA_HAS_FP16=1 -O3 -fgpu-rdc -DTORCH_API_INCLUDE_EXTENSION_H
'-DPYBIND11_COMPILER_TYPE="_gcc"'
'-DPYBIND11_STDLIB="_libstdcpp"'
'-DPYBIND11_BUILD_ABI="_cxxabi1014"'
-DTORCH_EXTENSION_NAME=deep_ep_cpp -D_GLIBCXX_USE_CXX11_ABI=1 --offload-arch=gfx936 -std=c++17 -Wno-return-type
}
SHMEM_LINK_OPTIONS
=
${
SHMEM_LINK_OPTIONS
:
=
"-Wl,-rpath,
${
SHMEM_INSTALL_PREFIX
}
/lib/ -l:librocshmem.a"
}
SHMEM_LINK_OPTIONS
=
${
SHMEM_LINK_OPTIONS
:
=
"-Wl,-rpath,
${
SHMEM_INSTALL_PREFIX
}
/lib/ -l:librocshmem.a"
}
fi
fi
# -------------------------- rocSHMEM END -------------------------- #
# -------------------------- rocSHMEM END -------------------------- #
# -------------------------- With duSHMEM -------------------------- #
# -------------------------- With duSHMEM -------------------------- #
# build_dushmem() # TODO
build_dushmem
()
# {
{
#
cd
third-party/dushmem-hip/
# }
source
env.build.sh
export
CMAKE_PREFIX_PATH
=
${
ROCM_PATH
}
/lib/cmake/amd_comgr:
${
ROCM_PATH
}
/lib64/cmake/amd_comgr:
${
CMAKE_PREFIX_PATH
:-}
export
NVSHMEM_PREFIX
=
$src_path
/third-party/dushmem_install
if
[
!
-d
"build"
]
;
then
mkdir
-p
build
fi
cd
build
||
{
echo
"错误: 无法进入构建目录 '
$build_dir
'"
cd
"
$src_path
"
return
1
}
echo
"cd third-party/dushmem-hip/build"
cmake ../
make
-j64
make
install
echo
"编译dushmem-hip成功"
cd
"
$src_path
"
}
if
[
"
$USE_NVSHMEM
"
==
"ON"
]
;
then
if
[
"
$USE_NVSHMEM
"
==
"ON"
]
;
then
if
[
!
-d
"dushmem_dir"
]
;
then
if
[
!
-d
"third-party/dushmem-hip/src/"
]
;
then
mkdir
-p
dushmem_dir
echo
"download submodule..."
git submodule update
--init
third-party/dushmem-hip
fi
if
[
!
-d
"third-party/dushmem_install"
]
;
then
mkdir
-p
third-party/dushmem_install
fi
fi
# build_dushmem() #TODO
build_dushmem
SHMEM_INSTALL_PREFIX
=
$(
pwd
)
/third-party/dushmem_install
COMPILE_OPTIONS
=
${
COMPILE_OPTIONS
:
= -fPIC -DFORCE_NVSHMEM_API -D__HIP_PLATFORM_AMD__=1 -DUSE_ROCM=1 -DHIPBLAS_V2 -DCUDA_HAS_FP16=1 -O3 -fgpu-rdc -DTORCH_API_INCLUDE_EXTENSION_H
'-DPYBIND11_COMPILER_TYPE="_gcc"'
'-DPYBIND11_STDLIB="_libstdcpp"'
'-DPYBIND11_BUILD_ABI="_cxxabi1014"'
-DTORCH_EXTENSION_NAME=deep_ep_cpp -D_GLIBCXX_USE_CXX11_ABI=1 --offload-arch=gfx936 -std=c++17 -Wno-return-type
}
COMPILE_OPTIONS
=
${
COMPILE_OPTIONS
:
= -fPIC -DFORCE_NVSHMEM_API -D__HIP_PLATFORM_AMD__=1 -DUSE_ROCM=1 -DHIPBLAS_V2 -DCUDA_HAS_FP16=1 -O3 -fgpu-rdc -DTORCH_API_INCLUDE_EXTENSION_H
'-DPYBIND11_COMPILER_TYPE="_gcc"'
'-DPYBIND11_STDLIB="_libstdcpp"'
'-DPYBIND11_BUILD_ABI="_cxxabi1014"'
-DTORCH_EXTENSION_NAME=deep_ep_cpp -D_GLIBCXX_USE_CXX11_ABI=1 --offload-arch=gfx936 -std=c++17 -Wno-return-type
}
SHMEM_INSTALL_PREFIX
=
${
SHMEM_INSTALL_PREFIX
:
=
$(
pwd
)
/dushmem_dir
}
SHMEM_LINK_OPTIONS
=
"-Wl,-rpath,
${
SHMEM_INSTALL_PREFIX
}
/lib/ -l:libnvshmem_device.a -lnvshmem_host"
SHMEM_LINK_OPTIONS
=
"-Wl,-rpath,
${
SHMEM_INSTALL_PREFIX
}
/lib/ -l:libnvshmem_device.a -lnvshmem_host"
fi
fi
# -------------------------- duSHMEM END -------------------------- #
# -------------------------- duSHMEM END -------------------------- #
...
...
dushmem-hip
@
f7bed0c3
Subproject commit f7bed0c3d13c9bfa53d2b7ecc8a69ebc1b69473b
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