Skip to content

Commit cf51492

Browse files
committed
gracefully skip plot generation
1 parent df3c69a commit cf51492

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

network/benchmarks/all_reduce_bench.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
from pathlib import Path
7676
import datetime
7777
import gc
78-
import matplotlib.pyplot as plt
7978
import os
8079
import signal
8180
import socket
@@ -112,6 +111,12 @@ def get_device_info():
112111

113112
def plot(path, x, y, ranks):
114113

114+
try:
115+
import matplotlib.pyplot as plt
116+
except:
117+
print("!!! Can't generate plot. Please run `pip install matplotlib` to enable plotting. !!!\n")
118+
return
119+
115120
plt.figure(dpi=500)
116121
plt.plot(x, y)
117122
plt.xlabel(f"Message size")

todo.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# TODO
2+
3+
Also see [stabs](./stabs)
4+
5+
- re-run all-reduce bench and update plot+table as the bench switched to KiB/MiB/etc.
6+
https://github.com/stas00/ml-engineering/tree/master/network/benchmarks#all_reduce-benchmark

0 commit comments

Comments
 (0)