Skip to content

Commit 0bd8292

Browse files
Manan17Manan Shahvaibhavjindal
authored
Automate benchmarking - changed the scripts for backward pass. (#759)
## Summary <!--- This is a required section; please describe the main purpose of this proposed code change. ---> The scripts are updated so that we get benchmarking results on backward pass as well. All benchmark scripts were run on a H100, it took around 55 minutes to run. There are total of 26 scripts, so each generates a plot for speed - forward, backward and full pass for memory - full pass. Total of 104. And the output (csv file) was of 460kB. <!--- ## Details This is an optional section; is there anything specific that reviewers should be aware of? ---> ## Testing Done <!--- This is a required section; please describe how this change was tested. ---> <!-- Replace BLANK with your device type. For example, A100-80G-PCIe Complete the following tasks before sending your PR, and replace `[ ]` with `[x]` to indicate you have done them. --> - Hardware Type: <BLANK> - [ ] run `make test` to ensure correctness - [ ] run `make checkstyle` to ensure code style - [ ] run `make test-convergence` to ensure convergence --------- Co-authored-by: Manan Shah <[email protected]> Co-authored-by: Vaibhav Jindal <[email protected]>
1 parent b6ed735 commit 0bd8292

17 files changed

+17
-18
lines changed

benchmark/scripts/benchmark_cpo_loss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def full():
147147

148148
run_benchmarks(
149149
bench_test_fn=bench_speed_fused_linear_cpo_loss,
150-
kernel_operation_modes=["forward", "full"],
150+
kernel_operation_modes=["forward", "backward", "full"],
151151
metric_name="speed",
152152
metric_unit="ms",
153153
**common_configs,

benchmark/scripts/benchmark_cross_entropy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def full():
109109

110110
run_benchmarks(
111111
bench_test_fn=bench_speed_cross_entropy,
112-
kernel_operation_modes=["forward", "full"],
112+
kernel_operation_modes=["forward", "backward", "full"],
113113
metric_name="speed",
114114
metric_unit="ms",
115115
**common_configs,

benchmark/scripts/benchmark_distill_jsd_loss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def full():
248248

249249
run_benchmarks(
250250
bench_test_fn=bench_speed_jsd_loss,
251-
kernel_operation_modes=["forward", "full"],
251+
kernel_operation_modes=["forward", "backward", "full"],
252252
metric_name="speed",
253253
metric_unit="ms",
254254
**common_configs,

benchmark/scripts/benchmark_dpo_loss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def full():
166166

167167
run_benchmarks(
168168
bench_test_fn=bench_speed_dpo_loss,
169-
kernel_operation_modes=["forward", "full"],
169+
kernel_operation_modes=["forward", "backward", "full"],
170170
metric_name="speed",
171171
metric_unit="ms",
172172
**common_configs,

benchmark/scripts/benchmark_embedding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def full():
112112

113113
run_benchmarks(
114114
bench_test_fn=bench_speed_embedding,
115-
kernel_operation_modes=["forward", "full"],
115+
kernel_operation_modes=["forward", "backward", "full"],
116116
metric_name="speed",
117117
metric_unit="ms",
118118
**common_configs,

benchmark/scripts/benchmark_fused_linear_cross_entropy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def full():
156156

157157
run_benchmarks(
158158
bench_test_fn=bench_speed_fused_linear_cross_entropy,
159-
kernel_operation_modes=["forward", "full"],
159+
kernel_operation_modes=["forward", "backward", "full"],
160160
metric_name="speed",
161161
metric_unit="ms",
162162
**common_configs,

benchmark/scripts/benchmark_fused_linear_jsd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def full():
246246

247247
run_benchmarks(
248248
bench_test_fn=bench_speed_fused_linear_jsd,
249-
kernel_operation_modes=["forward", "full"],
249+
kernel_operation_modes=["forward", "backward", "full"],
250250
metric_name="speed",
251251
metric_unit="ms",
252252
**common_configs,

benchmark/scripts/benchmark_jsd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def full():
143143

144144
run_benchmarks(
145145
bench_test_fn=bench_speed_jsd,
146-
kernel_operation_modes=["forward", "full"],
146+
kernel_operation_modes=["forward", "backward", "full"],
147147
metric_name="speed",
148148
metric_unit="ms",
149149
**common_args,

benchmark/scripts/benchmark_kl_div.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def full():
110110

111111
run_benchmarks(
112112
bench_test_fn=bench_speed_kldiv,
113-
kernel_operation_modes=["forward", "full"],
113+
kernel_operation_modes=["forward", "backward", "full"],
114114
metric_name="speed",
115115
metric_unit="ms",
116116
**common_args,

benchmark/scripts/benchmark_kto_loss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def full():
299299

300300
run_benchmarks(
301301
bench_test_fn=bench_speed_kto_loss,
302-
kernel_operation_modes=["forward", "full"],
302+
kernel_operation_modes=["forward", "backward", "full"],
303303
metric_name="speed",
304304
metric_unit="ms",
305305
**common_configs,

0 commit comments

Comments
 (0)