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
OpenDAS
FastMoE
Commits
103343ca
Commit
103343ca
authored
Feb 07, 2021
by
Rick Ho
Browse files
strong compatibility to different python and pytorch versions
parent
d6169eb1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
cuda/moe.cpp
cuda/moe.cpp
+4
-0
tests/test.sh
tests/test.sh
+7
-3
No files found.
cuda/moe.cpp
View file @
103343ca
...
@@ -116,7 +116,11 @@ class HackNCCLGroup: public c10d::ProcessGroupNCCL {
...
@@ -116,7 +116,11 @@ class HackNCCLGroup: public c10d::ProcessGroupNCCL {
public:
public:
ncclComm_t
getcomm
(
at
::
Device
dev
)
{
ncclComm_t
getcomm
(
at
::
Device
dev
)
{
auto
key
=
std
::
to_string
(
dev
.
index
());
auto
key
=
std
::
to_string
(
dev
.
index
());
#ifdef ENABLE_NCCL_P2P_SUPPORT
auto
v
=
getNCCLComm
(
key
,
{
dev
},
c10d
::
OpType
::
ALLTOALL
);
auto
v
=
getNCCLComm
(
key
,
{
dev
},
c10d
::
OpType
::
ALLTOALL
);
#else
auto
v
=
getNCCLComm
(
key
,
{
dev
});
#endif
if
(
v
.
size
()
==
0
)
{
if
(
v
.
size
()
==
0
)
{
std
::
cerr
<<
"PyTorch has nothing
\n
"
;
std
::
cerr
<<
"PyTorch has nothing
\n
"
;
return
0
;
return
0
;
...
...
tests/test.sh
View file @
103343ca
...
@@ -20,8 +20,12 @@ fi
...
@@ -20,8 +20,12 @@ fi
mkdir
-p
logs
mkdir
-p
logs
PYTHON_EXEC
=
python3
PYTHON_VERSION
=
$(
$PYTHON_EXEC
--version
)
PYTHON_REVISION
=
${
PYTHON_VERSION
:7:3
}
SCRIPT_PATH
=
$(
dirname
$(
dirname
$(
realpath
$0
)))
SCRIPT_PATH
=
$(
dirname
$(
dirname
$(
realpath
$0
)))
export
PYTHONPATH
=
$SCRIPT_PATH
:
$SCRIPT_PATH
/build/lib.linux-x86_64-
3.7
:
$PYTHONPATH
export
PYTHONPATH
=
$SCRIPT_PATH
:
$SCRIPT_PATH
/build/lib.linux-x86_64-
$PYTHON_REVISION
:
$PYTHONPATH
export
LD_LIBRARY_PATH
=
/home/laekov/.local/lib/python
3.7
/site-packages/torch/lib:
$LD_LIBRARY_PATH
export
LD_LIBRARY_PATH
=
/home/laekov/.local/lib/python
$PYTHON_REVISION
/site-packages/torch/lib:
$LD_LIBRARY_PATH
exec
python3
$@
2>logs/
$RANK
.log
exec
$PYTHON_EXEC
$@
2>logs/
$RANK
.log
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