Skip to content

Commit bd4f3ef

Browse files
committed
Increase graph ylim if needed
1 parent e293be2 commit bd4f3ef

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dev/flopscomp.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ using Plots
1313
using Plots.Measures
1414

1515
n_gpu_cores = "??"
16-
# Comment this out if scary. Please mention it in your comment when uploading the figure
16+
# Comment this out if scary. Please mention number of cores in your comment when uploading the figure
1717
system_prof = read(`system_profiler SPDisplaysDataType`, String)
1818
n_gpu_cores = only(match(r"Total Number of Cores:\s*(\d+)", system_prof).captures)
1919

@@ -146,13 +146,19 @@ function main(; Ns=[50, 64, 100, 128, 250, 256, 500, 512, 1000, 1024, 2000, 2048
146146
]
147147

148148
res = Dict()
149+
150+
ylim_upper = 9e12
151+
149152
for (inT, outT) in Ts
150153
tmpres = compare(Ns, Fs, inT, outT; n_batch, ntrials)
151154

152155
plt = plot(xlabel="N, n_batch=$(n_batch)", legendtitle="($inT, $outT)")
153156
for (res, (_, info_str)) in zip(tmpres,Fs)
154157
flops = tmpres[info_str]
155158
peakf = @sprintf("%.3e", maximum(flops))
159+
if peakf > ylim_upper
160+
ylim_upper = peakf * 1.02
161+
end
156162
plot!(plt, Ns, tmpres[info_str]; linewidth=1.5, label="$(peakf) peak: $info_str")
157163
end
158164
res[(inT,outT)] = (plt=plt, results=tmpres)

0 commit comments

Comments
 (0)