Skip to content

Commit

Permalink
buggy stil
Browse files Browse the repository at this point in the history
  • Loading branch information
Saeed Maleki committed Oct 23, 2023
1 parent 8e02b03 commit 94a0858
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions python/benchmark/allreduce_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def check_correctness(memory, func):
for i in range(MPI.COMM_WORLD.size):
rand_gen = cp.random.default_rng(seed=i)
expected += rand_gen.random(memory.shape)
print(memory, expected)
return cp.allclose(memory, expected)

def bench_time(niter: int, func):
Expand Down Expand Up @@ -71,15 +72,8 @@ def run_benchmark(mscclpp_op: MscclppOp, nccl_op: NcclOp, table: PrettyTable, ni

if MPI.COMM_WORLD.rank == 0:
table.add_row([human_readable_size(memory_nbytes), "{:.2f}".format(mscclpp_time), "{:.2f}".format(mscclpp_algBw), mscclpp_check, "{:.2f}".format(nccl_time), "{:.2f}".format(nccl_algBw), nccl_check, "{:.2f}".format(nccl_time / mscclpp_time)])
# memory[:] = group.my_rank+1
# kernel.launch_kernel(params, 24, 1024, 0, None)
# expected = 0
# for i in range(group.nranks):
# expected += (i+1)
# assert(cp.allclose(memory[0:nelem], expected))
if MPI.COMM_WORLD.rank == 0:
print(".", end="", flush=True)
# print(cp.nonzero(memory[0:nelem]-expected), memory[0:8])

if __name__ == "__main__":
shm_comm = MPI.COMM_WORLD.Split_type(MPI.COMM_TYPE_SHARED, 0, MPI.INFO_NULL)
Expand All @@ -97,7 +91,7 @@ def run_benchmark(mscclpp_op: MscclppOp, nccl_op: NcclOp, table: PrettyTable, ni
table = PrettyTable()
table.field_names = ["Size", "Time (us)", "AlgBW (GB/s)", "Correctness", "NCCL Time (us)", "NCCL AlgBW (GB/s)", "NCCL Correctness", "Speed Up"]

for i in range(10,28):
for i in range(10,11):
run_benchmark(mscclpp_op, nccl_op, table, 100, 2**i)

if MPI.COMM_WORLD.rank == 0:
Expand Down

0 comments on commit 94a0858

Please sign in to comment.