MCPcopy Create free account
hub / github.com/ml-explore/mlx / bench

Function bench

benchmarks/python/conv1d_bench.py:19–28  ·  view source on GitHub ↗
(f, a, b)

Source from the content-addressed store, hash-verified

17
18
19def bench(f, a, b):
20 for i in range(N_warmup):
21 f(a, b)
22 torch.mps.synchronize()
23
24 s = time.perf_counter_ns()
25 for i in range(N_iter_bench):
26 f(a, b)
27 e = time.perf_counter_ns()
28 return (e - s) * 1e-9
29
30
31def make_mx_conv_1D(strides=1, padding=0, groups=1):

Callers 1

bench_shapeFunction · 0.70

Calls 2

fFunction · 0.85
synchronizeMethod · 0.45

Tested by

no test coverage detected