Skip to content

Commit

Permalink
python3Packages.jax: add operations to cuda test
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-huan committed Feb 2, 2025
1 parent 17b7964 commit 7988811
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkgs/development/python-modules/jax/test-cuda.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,21 @@ pkgs.writers.writePython3Bin "jax-test-cuda"
}
''
import jax
import jax.numpy as jnp
from jax import random
from jax.experimental import sparse
assert jax.devices()[0].platform == "gpu"
rng = random.PRNGKey(0)
rng = random.key(0)
x = random.normal(rng, (100, 100))
x @ x
jnp.fft.fft(x)
jnp.linalg.inv(x)
y = sparse.CSR.fromdense(x)
z = random.normal(rng, (100,))
y @ z
print("success!")
''

0 comments on commit 7988811

Please sign in to comment.