Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pySDC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
atml-ati
pySDC
Commits
b81b47be
Unverified
Commit
b81b47be
authored
7 months ago
by
Thomas Baumann
Committed by
GitHub
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Added a few things to the NCCL communicator (#503)
parent
bf940bd4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#233471
passed
7 months ago
Stage: benchmark
Changes
1
Pipelines
3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pySDC/helpers/NCCL_communicator.py
+25
-1
25 additions, 1 deletion
pySDC/helpers/NCCL_communicator.py
with
25 additions
and
1 deletion
pySDC/helpers/NCCL_communicator.py
+
25
−
1
View file @
b81b47be
...
@@ -27,7 +27,7 @@ class NCCLComm(object):
...
@@ -27,7 +27,7 @@ class NCCLComm(object):
Args:
Args:
Name (str): Name of the requested attribute
Name (str): Name of the requested attribute
"""
"""
if
name
not
in
[
'
size
'
,
'
rank
'
,
'
Get_rank
'
,
'
Get_size
'
,
'
Split
'
]:
if
name
not
in
[
'
size
'
,
'
rank
'
,
'
Get_rank
'
,
'
Get_size
'
,
'
Split
'
,
'
Create_cart
'
,
'
Is_inter
'
,
'
Get_topology
'
]:
cp
.
cuda
.
get_current_stream
().
synchronize
()
cp
.
cuda
.
get_current_stream
().
synchronize
()
return
getattr
(
self
.
commMPI
,
name
)
return
getattr
(
self
.
commMPI
,
name
)
...
@@ -71,6 +71,26 @@ class NCCLComm(object):
...
@@ -71,6 +71,26 @@ class NCCLComm(object):
else
:
else
:
raise
NotImplementedError
(
'
Don
\'
t know what NCCL operation to use to replace this MPI operation!
'
)
raise
NotImplementedError
(
'
Don
\'
t know what NCCL operation to use to replace this MPI operation!
'
)
def
reduce
(
self
,
sendobj
,
op
=
MPI
.
SUM
,
root
=
0
):
sync
=
False
if
hasattr
(
sendobj
,
'
data
'
):
if
hasattr
(
sendobj
.
data
,
'
ptr
'
):
sync
=
True
if
sync
:
cp
.
cuda
.
Device
().
synchronize
()
return
self
.
commMPI
.
reduce
(
sendobj
,
op
=
op
,
root
=
root
)
def
allreduce
(
self
,
sendobj
,
op
=
MPI
.
SUM
):
sync
=
False
if
hasattr
(
sendobj
,
'
data
'
):
if
hasattr
(
sendobj
.
data
,
'
ptr
'
):
sync
=
True
if
sync
:
cp
.
cuda
.
Device
().
synchronize
()
return
self
.
commMPI
.
allreduce
(
sendobj
,
op
=
op
)
def
Reduce
(
self
,
sendbuf
,
recvbuf
,
op
=
MPI
.
SUM
,
root
=
0
):
def
Reduce
(
self
,
sendbuf
,
recvbuf
,
op
=
MPI
.
SUM
,
root
=
0
):
if
not
hasattr
(
sendbuf
.
data
,
'
ptr
'
):
if
not
hasattr
(
sendbuf
.
data
,
'
ptr
'
):
return
self
.
commMPI
.
Reduce
(
sendbuf
=
sendbuf
,
recvbuf
=
recvbuf
,
op
=
op
,
root
=
root
)
return
self
.
commMPI
.
Reduce
(
sendbuf
=
sendbuf
,
recvbuf
=
recvbuf
,
op
=
op
,
root
=
root
)
...
@@ -113,3 +133,7 @@ class NCCLComm(object):
...
@@ -113,3 +133,7 @@ class NCCLComm(object):
stream
=
cp
.
cuda
.
get_current_stream
()
stream
=
cp
.
cuda
.
get_current_stream
()
self
.
commNCCL
.
bcast
(
buff
=
buf
.
data
.
ptr
,
count
=
count
,
datatype
=
dtype
,
root
=
root
,
stream
=
stream
.
ptr
)
self
.
commNCCL
.
bcast
(
buff
=
buf
.
data
.
ptr
,
count
=
count
,
datatype
=
dtype
,
root
=
root
,
stream
=
stream
.
ptr
)
def
Barrier
(
self
):
cp
.
cuda
.
get_current_stream
().
synchronize
()
self
.
commMPI
.
Barrier
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment