mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-29 03:00:14 -04:00
allow benchmarking forward only (#5436)
This commit is contained in:
16
test/external/external_benchmark_schedule.py
vendored
16
test/external/external_benchmark_schedule.py
vendored
@@ -8,19 +8,21 @@ if __name__ == "__main__":
|
||||
img = Tensor.empty(64, 3, 224, 224)
|
||||
|
||||
PROFILE = getenv("PROFILE", 1)
|
||||
FORWARD_ONLY = getenv("FORWARD_ONLY", 0)
|
||||
|
||||
with Profiling(PROFILE):
|
||||
with Timing("***** model forward in "):
|
||||
out = mdl(img)
|
||||
|
||||
with Profiling(PROFILE):
|
||||
with Timing("***** model schedule in "):
|
||||
sched = out.schedule()
|
||||
if not FORWARD_ONLY:
|
||||
with Profiling(PROFILE):
|
||||
with Timing("***** model schedule in "):
|
||||
sched = out.schedule()
|
||||
|
||||
# snakeviz /tmp/schedule.prof
|
||||
with Profiling(PROFILE, fn="/tmp/schedule.prof"):
|
||||
with Timing("***** model lower in "):
|
||||
eis = list(lower_schedule(sched))
|
||||
# snakeviz /tmp/schedule.prof
|
||||
with Profiling(PROFILE, fn="/tmp/schedule.prof"):
|
||||
with Timing("***** model lower in "):
|
||||
eis = list(lower_schedule(sched))
|
||||
|
||||
# random makes this slow
|
||||
#with Profiling(PROFILE):
|
||||
|
||||
Reference in New Issue
Block a user