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
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
" batch_size=4,\n",
")\n",
"\n",
"analysis_1 = al.AnalysisImaging(dataset=dataset, use_jax=True)\n",
"analysis_1 = al.AnalysisImaging(dataset=dataset)\n",
"\n",
"result_1 = search_1.fit(model=model_1, analysis=analysis_1)"
],
Expand Down Expand Up @@ -530,7 +530,6 @@
"analysis_2 = al.AnalysisImaging(\n",
" dataset=dataset,\n",
" positions_likelihood_list=[positions_likelihood],\n",
" use_jax=True,\n",
")\n",
"\n",
"search_2 = af.Nautilus(\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,6 @@
" dataset=dataset,\n",
" solver=solver,\n",
" fit_positions_cls=al.FitPositionsSourceSolved,\n",
" use_jax=True,\n",
" )\n",
" for dataset in dataset_list\n",
"]\n",
Expand Down
11 changes: 6 additions & 5 deletions notebooks/chapter_optional/tutorial_need_for_speed.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
batch_size=4,
)

analysis_1 = al.AnalysisImaging(dataset=dataset, use_jax=True)
analysis_1 = al.AnalysisImaging(dataset=dataset)

result_1 = search_1.fit(model=model_1, analysis=analysis_1)

Expand Down Expand Up @@ -372,7 +372,6 @@
analysis_2 = al.AnalysisImaging(
dataset=dataset,
positions_likelihood_list=[positions_likelihood],
use_jax=True,
)

search_2 = af.Nautilus(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@
dataset=dataset,
solver=solver,
fit_positions_cls=al.FitPositionsSourceSolved,
use_jax=True,
)
for dataset in dataset_list
]
Expand Down
9 changes: 5 additions & 4 deletions scripts/chapter_optional/tutorial_need_for_speed.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@

__Automatic Compute Setup__

Rather than choosing between JAX and NumPy, CPU and GPU yourself, you can pass `setup="auto"` to the analysis (and
`number_of_cores="auto"` to a Nautilus search). **PyAutoLens** then picks the setup for this likelihood on this
hardware from timings measured when the software was profiled, and prints the choice, the number of CPU workers and
a run-time estimate when the fit starts. Tutorial 2 of Chapter 2 shows and explains these lines.
Rather than choosing between JAX and NumPy, CPU and GPU yourself, you can pass `setup="auto"` to the analysis (the
default from the next release) and `number_of_cores="auto"` to a Nautilus search. **PyAutoLens** then picks the setup
for this likelihood on this hardware from timings measured when the software was profiled, and prints the choice, the
number of CPU workers and a run-time estimate when the fit starts. Tutorial 2 of Chapter 2 shows and explains these
lines.

The measurements show that JAX is not always the fastest choice. On a CPU, a pixelized source is usually fitted
fastest with the NumPy path and a numba sparse operator, run across several CPU cores, while a GPU favours JAX.
Expand Down
Loading