Skip to content

update censoring notebook - #2235

Open
juanitorduz wants to merge 2 commits into
pyro-ppl:masterfrom
juanitorduz:update-censored-nb
Open

update censoring notebook#2235
juanitorduz wants to merge 2 commits into
pyro-ppl:masterfrom
juanitorduz:update-censored-nb

Conversation

@juanitorduz

Copy link
Copy Markdown
Collaborator

Use the recently added censored distribution + minor fix

@juanitorduz juanitorduz self-assigned this Aug 5, 2026
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@juanitorduz juanitorduz added the enhancement New feature or request label Aug 5, 2026
@juanitorduz juanitorduz added the documentation Related to documentation label Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Benchmark report

this PR update-censored-nb at cb52ba3e vs baseline master at a47333ee

- run time:     1 slower, 2 faster
  compile time: unchanged across 32 benchmarks

Significant changes (3)

                         ─────── run time ───────     ────── compile time ─────
  benchmark              baseline  this PR      Δ     baseline   this PR      Δ
───────────────────────────────────────────────────────────────────────────────
+ categorical_log_prob     2.4 ms   2.2 ms  -7.5%      76.7 ms   71.7 ms  -6.5%
+ gamma_log_prob           2.2 ms   2.1 ms  -5.5%       2.32 s    2.23 s  -4.0%
- gamma_sample            19.4 ms  20.8 ms  +7.2%     812.5 ms  829.2 ms  +2.1%

Red is slower, green is faster; a row is coloured by the worse of its two columns. A delta in parentheses cleared the threshold on a measurement below the resolution floor, so it is shown without being called a change. † marks a benchmark that could not be compared — see below.

Full results

distributions

                                 ───────── run time ────────     ────── compile time ──────
  benchmark                      baseline  this PR         Δ     baseline   this PR       Δ
───────────────────────────────────────────────────────────────────────────────────────────
  biject_to_constraints            4.1 ms   3.9 ms     -4.8%     390.7 ms  396.7 ms   +1.6%
+ categorical_log_prob             2.4 ms   2.2 ms     -7.5%      76.7 ms   71.7 ms   -6.5%
  dirichlet_log_prob               708 µs   728 µs     +2.7%     454.0 ms  436.9 ms   -3.8%
  dirichlet_sample                45.0 ms  45.1 ms     +0.3%     865.8 ms  854.5 ms   -1.3%
+ gamma_log_prob                   2.2 ms   2.1 ms     -5.5%       2.32 s    2.23 s   -4.0%
- gamma_sample                    19.4 ms  20.8 ms     +7.2%     812.5 ms  829.2 ms   +2.1%
  lkj_cholesky_sample              5.4 ms   5.4 ms     -0.4%       1.24 s    1.20 s   -3.3%
  mixture_same_family_log_prob     2.1 ms   2.1 ms     +2.6%     109.5 ms  110.6 ms   +1.0%
  multivariate_normal_log_prob     337 µs   286 µs  (-15.3%)     165.7 ms  162.5 ms   -2.0%
  normal_log_prob                  554 µs   688 µs  (+24.2%)      62.1 ms   60.0 ms   -3.3%
  normal_sample                   22.2 ms  22.9 ms     +3.0%     220.0 ms  221.5 ms   +0.7%
  stick_breaking_transform         6.3 ms   6.3 ms     +0.7%     209.5 ms  237.3 ms  +13.3%
  student_t_log_prob               3.1 ms   3.1 ms     -0.4%      85.3 ms   81.6 ms   -4.4%
  truncated_normal_log_prob        792 µs   828 µs     +4.5%      56.9 ms   56.4 ms   -0.9%

handlers

                                  ───────── run time ────────     ────── compile time ──────
  benchmark                       baseline   this PR        Δ     baseline   this PR       Δ
────────────────────────────────────────────────────────────────────────────────────────────
  initialize_model_hierarchical    43.4 ms   41.5 ms    -4.3%       4.02 s    4.03 s   +0.3%
  log_density_hierarchical          3.6 ms    3.8 ms    +2.9%       1.34 s    1.35 s   +0.9%
  nested_handler_stack              1.4 ms    1.4 ms    -1.2%       608 µs    548 µs   -9.9%
  potential_energy_and_grad          22 µs     21 µs  (-6.2%)     107.7 ms  104.9 ms   -2.5%
  predictive_forward_sampling     747.7 ms  740.9 ms    -0.9%     208.6 ms  182.5 ms  -12.5%
  trace_seeded_model                842 µs    838 µs    -0.5%     596.6 ms  595.7 ms   -0.1%

mcmc

                             ──────── run time ───────     ───── compile time ─────
  benchmark                  baseline   this PR      Δ     baseline  this PR      Δ
───────────────────────────────────────────────────────────────────────────────────
  hmc_logistic_regression    755.0 ms  738.5 ms  -2.2%       3.34 s   3.28 s  -1.8%
  nuts_dense_mass_funnel       1.20 s    1.20 s  -0.4%       2.87 s   2.77 s  -3.4%
  nuts_eight_schools           1.19 s    1.15 s  -2.6%       2.77 s   2.71 s  -2.2%
  nuts_hierarchical_glm        4.97 s    4.97 s  -0.0%       5.25 s   5.20 s  -1.0%
  nuts_logistic_regression     1.11 s    1.11 s  -0.2%       3.36 s   3.30 s  -1.9%
  nuts_vectorized_chains       2.58 s    2.59 s  +0.4%       3.07 s   3.10 s  +0.9%

svi

                                             ──────── run time ───────     ───── compile time ─────
  benchmark                                  baseline   this PR      Δ     baseline  this PR      Δ
───────────────────────────────────────────────────────────────────────────────────────────────────
  svi_autodelta_map_logistic                 306.9 ms  308.5 ms  +0.5%       3.19 s   3.16 s  -1.0%
  svi_autodiagonalnormal_hierarchical          1.02 s    1.06 s  +2.9%       5.35 s   5.42 s  +1.3%
  svi_automultivariatenormal_eight_schools   767.0 ms  749.0 ms  -2.3%       4.31 s   4.33 s  +0.3%
  svi_autonormal_logistic                    775.4 ms  753.8 ms  -2.8%       3.45 s   3.38 s  -2.3%
  svi_multi_particle_elbo                      1.55 s    1.58 s  +2.3%       3.74 s   3.75 s  +0.4%
  svi_trace_mean_field_elbo                    1.36 s    1.32 s  -2.8%       5.80 s   5.74 s  -1.0%
Methodology and environment

Each benchmark is set up untimed, then called once with the JAX caches cleared and several more times warm. Run is the fastest warm call; compile is the first call minus that, i.e. the tracing, lowering and XLA compilation the warm calls did not have to pay for.

Both refs were measured on the same runner over 2 interleaved round(s), taking the best observation per benchmark. A result is called neutral when it moves less than ±5% (run) or ±25% (compile), or when the measurement itself is under 1 ms (run) / 50 ms (compile) — a shared CI runner cannot resolve changes below that. Compile time gets the looser band because it is measured once per round rather than best-of-N, and swings by roughly 20% even between two runs of identical code. A delta shown in parentheses did clear its threshold, but on a measurement below the resolution floor, so it is reported without being called a change.

baseline this PR
ref master update-censored-nb
commit a47333ee cb52ba3e
numpyro 0.21.0 0.21.0
jax 0.11.0 0.11.0
backend cpu cpu
python 3.14.6 3.14.6

Runner: Linux-6.17.0-1020-azure-x86_64-with-glibc2.39, 4 CPUs.

Produced by this benchmark run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Related to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant