Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/python_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
Expand All @@ -35,6 +35,8 @@ jobs:
python -m pip install --upgrade pip
python -m pip install pytest pytest-codspeed
python -m pip install .
# temp pin until 0.5 is on conda
python -m pip install "jax<0.5.0"

- name: Test with pytest
run: |
Expand Down
26 changes: 26 additions & 0 deletions tests/jax/test_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,29 @@ def test_benchmark_spergel_kvalue(benchmark, kind):
benchmark, kind, lambda: _run_spergel_bench_kvalue_jit().block_until_ready()
)
print(f"time: {dt:0.4g} ms", end=" ")


@jax.jit
def _run_spergel_bench_init():
return jgs.Spergel(nu=-0.6, half_light_radius=3.4).scale_radius


@pytest.mark.parametrize("kind", ["compile", "run"])
def test_benchmark_spergel_init(benchmark, kind):
dt = _run_benchmarks(
benchmark, kind, lambda: _run_spergel_bench_init().block_until_ready()
)
print(f"time: {dt:0.4g} ms", end=" ")


@jax.jit
def _run_gaussian_bench_init():
return jgs.Gaussian(half_light_radius=3.4).sigma


@pytest.mark.parametrize("kind", ["compile", "run"])
def test_benchmark_gaussian_init(benchmark, kind):
dt = _run_benchmarks(
benchmark, kind, lambda: _run_gaussian_bench_init().block_until_ready()
)
print(f"time: {dt:0.4g} ms", end=" ")
Loading