Skip to content

update censoring notebook - #2235

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

juanitorduz wants to merge 3 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 a7de9450 vs baseline master at 07501df3

+ run time:     1 faster
- compile time: 1 slower, 0 faster

Significant changes (2)

                                ──────── run time ───────     ────── compile time ──────
  benchmark                     baseline   this PR      Δ     baseline   this PR       Δ
────────────────────────────────────────────────────────────────────────────────────────
+ lkj_cholesky_sample             4.3 ms    3.9 ms  -8.8%     830.1 ms  848.2 ms   +2.2%
- predictive_forward_sampling   551.5 ms  546.3 ms  -0.9%     114.9 ms  151.2 ms  +31.6%

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            3.1 ms   3.0 ms     -1.5%     197.6 ms  210.0 ms  +6.3%
  categorical_log_prob             1.4 ms   1.4 ms     +3.0%      57.4 ms   56.8 ms  -1.0%
  dirichlet_log_prob               406 µs   385 µs   (-5.1%)     420.1 ms  386.6 ms  -8.0%
  dirichlet_sample                42.8 ms  43.0 ms     +0.5%     592.4 ms  600.1 ms  +1.3%
  gamma_log_prob                   1.5 ms   1.4 ms     -0.8%       2.04 s    2.08 s  +2.2%
  gamma_sample                    19.4 ms  19.7 ms     +1.2%     526.2 ms  568.1 ms  +8.0%
+ lkj_cholesky_sample              4.3 ms   3.9 ms     -8.8%     830.1 ms  848.2 ms  +2.2%
  mixture_same_family_log_prob     568 µs   575 µs     +1.3%      68.4 ms   66.4 ms  -2.9%
  multivariate_normal_log_prob     403 µs   477 µs  (+18.6%)     480.5 ms  469.5 ms  -2.3%
  normal_log_prob                  449 µs   446 µs     -0.7%      49.5 ms   49.8 ms  +0.6%
  normal_sample                   20.2 ms  20.1 ms     -0.6%     151.5 ms  148.0 ms  -2.3%
  stick_breaking_transform         4.7 ms   4.5 ms     -2.4%     160.5 ms  162.4 ms  +1.1%
  student_t_log_prob               2.5 ms   2.5 ms     +0.0%      71.3 ms   72.1 ms  +1.1%
  truncated_normal_log_prob        529 µs   537 µs     +1.6%      44.2 ms   43.2 ms  -2.3%

handlers

                                  ──────── run time ───────     ────── compile time ──────
  benchmark                       baseline   this PR      Δ     baseline   this PR       Δ
──────────────────────────────────────────────────────────────────────────────────────────
  initialize_model_hierarchical    31.5 ms   31.3 ms  -0.6%       3.24 s    3.34 s   +3.1%
  log_density_hierarchical          2.4 ms    2.3 ms  -2.9%       1.26 s    1.19 s   -5.9%
  nested_handler_stack              976 µs    963 µs  -1.3%       781 µs    611 µs  -21.8%
  potential_energy_and_grad          18 µs     19 µs  +3.7%      78.4 ms   77.1 ms   -1.7%
- predictive_forward_sampling     551.5 ms  546.3 ms  -0.9%     114.9 ms  151.2 ms  +31.6%
  trace_seeded_model                530 µs    536 µs  +1.0%     450.9 ms  451.0 ms   +0.0%

mcmc

                             ──────── run time ───────     ───── compile time ─────
  benchmark                  baseline   this PR      Δ     baseline  this PR      Δ
───────────────────────────────────────────────────────────────────────────────────
  hmc_logistic_regression    589.8 ms  581.8 ms  -1.4%       2.82 s   2.79 s  -0.9%
  nuts_dense_mass_funnel     928.3 ms  924.1 ms  -0.5%       2.27 s   2.30 s  +1.4%
  nuts_eight_schools         923.7 ms  890.9 ms  -3.6%       2.33 s   2.31 s  -1.0%
  nuts_hierarchical_glm        3.25 s    3.24 s  -0.2%       3.97 s   4.23 s  +6.8%
  nuts_logistic_regression   869.8 ms  857.4 ms  -1.4%       2.79 s   3.02 s  +8.3%
  nuts_vectorized_chains       1.93 s    1.95 s  +1.3%       2.42 s   2.37 s  -1.8%

svi

                                             ──────── run time ───────     ───── compile time ─────
  benchmark                                  baseline   this PR      Δ     baseline  this PR      Δ
───────────────────────────────────────────────────────────────────────────────────────────────────
  svi_autodelta_map_logistic                 235.8 ms  243.6 ms  +3.3%       2.70 s   2.76 s  +2.5%
  svi_autodiagonalnormal_hierarchical        811.3 ms  813.6 ms  +0.3%       4.51 s   4.44 s  -1.5%
  svi_automultivariatenormal_eight_schools   592.5 ms  607.1 ms  +2.5%       3.90 s   4.04 s  +3.6%
  svi_autonormal_logistic                    596.3 ms  607.1 ms  +1.8%       3.05 s   3.10 s  +1.6%
  svi_multi_particle_elbo                      1.15 s    1.19 s  +3.6%       3.14 s   3.19 s  +1.8%
  svi_trace_mean_field_elbo                  986.0 ms    1.02 s  +3.0%       4.74 s   4.59 s  -3.2%
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 07501df3 a7de9450
numpyro 0.21.0 0.21.0
jax 0.11.1 0.11.1
backend cpu cpu
python 3.14.7 3.14.7

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

Produced by this benchmark run.

@juanitorduz

Copy link
Copy Markdown
Collaborator Author

wdyt @Qazalbash ?

@Qazalbash

Copy link
Copy Markdown
Collaborator

wdyt @Qazalbash ?

I will soon look into and update you!

@juanitorduz juanitorduz added the awaiting review Awaiting review from maintainers label Aug 24, 2026
@juanitorduz juanitorduz mentioned this pull request Aug 27, 2026
3 tasks

@Qazalbash Qazalbash left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes seem reasonable to me, except for some formatting-related issues in the notebook for latex.

Once @fehiepsi reviews it, we can merge this PR.

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

Labels

awaiting review Awaiting review from maintainers documentation Related to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants