-
I am trying to benchmark some code. However, it seems I can't use Is this a good way to benchmark this code? @jit
def polyval_gpu():
return [jnp.polyval(r, 0.1) for r in SOME_DATA]
%timeit polyval_gpu() OR @jit
def polyval_gpu():
for r in SOME_DATA:
ans = jnp.polyval(r, 0.1)
return ans
%timeit polyval_gpu() |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
For non-array outputs, rather than calling the %timeit jax.block_until_ready(polyval_gpu()) |
Beta Was this translation helpful? Give feedback.
-
@jit
def polyval_gpu():
for r in SOME_DATA:
ans = jnp.polyval(r, 0.1)
return ans
%timeit jax.block_until_ready(polyval_gpu())
|
Beta Was this translation helpful? Give feedback.
For non-array outputs, rather than calling the
array.block_until_ready()
method, you can call thejax.block_until_ready()
function: