mirror of
https://github.com/microsoft/mscclpp.git
synced 2026-06-08 15:30:41 +00:00
Renaming channels (#436)
Renamed `ProxyChannel` to `PortChannel` and `SmChannel` to `MemoryChannel`
This commit is contained in:
@@ -28,7 +28,7 @@ def allgather_test(gpus, instances):
|
||||
c = chunk(n, Buffer.input, 0, 1)
|
||||
for peer in range(gpus):
|
||||
if n != peer:
|
||||
c.put(peer, Buffer.output, n, sendtb=peer, chan_type=ChannelType.sm)
|
||||
c.put(peer, Buffer.output, n, sendtb=peer, chan_type=ChannelType.memory)
|
||||
else:
|
||||
c.copy(n, Buffer.output, n, sendtb=peer)
|
||||
# explicit barrier
|
||||
@@ -36,13 +36,13 @@ def allgather_test(gpus, instances):
|
||||
r.barrier(tb_list=list(range(gpus)))
|
||||
for peer in range(gpus):
|
||||
if n != peer:
|
||||
c.signal(peer, Buffer.output, n, sendtb=peer, chan_type=ChannelType.sm)
|
||||
c.signal(peer, Buffer.output, n, sendtb=peer, chan_type=ChannelType.memory)
|
||||
|
||||
for n in range(gpus):
|
||||
for peer in range(gpus):
|
||||
c = chunk(n, Buffer.output, peer, 1)
|
||||
if n != peer:
|
||||
c.wait(peer, Buffer.input, peer, recvtb=peer, chan_type=ChannelType.sm)
|
||||
c.wait(peer, Buffer.input, peer, recvtb=peer, chan_type=ChannelType.memory)
|
||||
|
||||
Json()
|
||||
Check()
|
||||
|
||||
@@ -10,9 +10,9 @@ from mscclpp.language.types import ChannelType
|
||||
|
||||
def send_recv(instances):
|
||||
"""
|
||||
Send and receive data between two ranks using proxy channels, with LL protocol and double scratch buffer.
|
||||
Send and receive data between two ranks using port channels, with LL protocol and double scratch buffer.
|
||||
Steps:
|
||||
1. Each rank sends a chunk to every other rank's scratch buffer with packet format via proxy channel.
|
||||
1. Each rank sends a chunk to every other rank's scratch buffer with packet format via port channel.
|
||||
2. Wait for the data to be received, then copy it to the output buffer.
|
||||
"""
|
||||
size = 2
|
||||
@@ -36,7 +36,7 @@ def send_recv(instances):
|
||||
"scratch",
|
||||
1,
|
||||
sendtb=0,
|
||||
chan_type=ChannelType.proxy,
|
||||
chan_type=ChannelType.port,
|
||||
temp_buffer="scratch",
|
||||
temp_buffer_index=0,
|
||||
)
|
||||
|
||||
@@ -10,7 +10,7 @@ from mscclpp.language.types import ChannelType
|
||||
|
||||
def send_recv(instances):
|
||||
"""
|
||||
Send and receive data between two ranks using proxy channels.
|
||||
Send and receive data between two ranks using port channels.
|
||||
steps:
|
||||
1. Each rank sends a chunk to the other rank's scratch buffer and signals the other rank that the data has been sent.
|
||||
2. Wait for the data to be received then copy it to the output buffer.
|
||||
@@ -34,14 +34,14 @@ def send_recv(instances):
|
||||
"scratch",
|
||||
1,
|
||||
sendtb=0,
|
||||
chan_type=ChannelType.proxy,
|
||||
chan_type=ChannelType.port,
|
||||
)
|
||||
c.signal(nghr, "scratch", 1, sendtb=0, chan_type=ChannelType.proxy)
|
||||
c.flush(nghr, "scratch", 1, sendtb=0, chan_type=ChannelType.proxy)
|
||||
c.signal(nghr, "scratch", 1, sendtb=0, chan_type=ChannelType.port)
|
||||
c.flush(nghr, "scratch", 1, sendtb=0, chan_type=ChannelType.port)
|
||||
|
||||
for r in range(size):
|
||||
c = chunk(r, "scratch", 1)
|
||||
c.wait(1 - r, Buffer.input, 0, recvtb=0, chan_type=ChannelType.proxy)
|
||||
c.wait(1 - r, Buffer.input, 0, recvtb=0, chan_type=ChannelType.port)
|
||||
c.copy(r, Buffer.output, 0, sendtb=0)
|
||||
|
||||
Json()
|
||||
|
||||
Reference in New Issue
Block a user