Skip to content

Commit 2d88df4

Browse files
velochyclaude
andcommitted
Calibrate model_to_float32 speed claims to measured CPU results
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 3fd4e6d commit 2d88df4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pymc/model/transform/optimization.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,9 @@ def model_to_float32(model: Model) -> Model:
418418
variables are unaffected. Explicit `.astype("float64")` casts are redirected
419419
to float32.
420420
421-
This can substantially speed up sampling on CPUs (via SIMD vectorization and
422-
halved memory traffic) and especially on GPUs, at the cost of precision.
421+
This can speed up sampling at the cost of precision — most on GPUs and for
422+
compute-bound models; on CPU backends gains depend on how memory- and
423+
BLAS-bound the model's logp is.
423424
424425
Compile and sample under ``floatX="float32"``, otherwise constants introduced
425426
when building logp graphs will upcast intermediate computations back to float64:

0 commit comments

Comments
 (0)