Skip to content
Discussion options

You must be logged in to vote

Interesting! Before digging in further, I'd suggest taking a look at FAQ: Benchmarking JAX Code and make sure you're following the advice there (particularly with regard to asynchronous dispatch) to make sure you're measuring the actual runtime.

I do see that binQuantile is a few times faster than jnp.quantile for very large arrays, although the current method seems to outperform the proposed method for more moderately-sized arrays:

x = random.normal(random.key( int( time() * 1e3) ), 1000)

print(jnp.quantile(x, 0.5))
print(binQuantile(x, 0.5))

%timeit jnp.quantile(x, 0.5).block_until_ready()
%timeit binQuantile(x, 0.5).block_until_ready()
0.0152827315
0.0152827315
238 µs ± 5.99 µs per l…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Space4444
Comment options

Answer selected by Space4444
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants