You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enhancementImprovement planned or wanted by the maintainershackathonFor our in-person hackathons with maintainers present, not a general up-for-grabs listtestsEverything to do with the sbi test suite
Mini-SBIBM should offer an easy and fast way to test if certain modifications impact the performance of the algorithms. For this, a small set of tasks are implemented on which different methods or configurations can be benchmarked against each other. This can be directly launched via pytest and is thus easily accessible for any developer.
It has a few modes to test different method classes, but here, one can improve quite a bit. There are the following areas of improvement:
Think about what level of customizability would be helpful. Mini-SBIBM should not be a full-baked benchmark to check if something in development works reasonably well quickly.
Think about if we want to allow this set of customizations through pytest API, without requiring to change the code directly. This is currently rather static and can be changed in the code. One can only select different "modes" that run a fixed set of i.e. NPE,SNPE, NRE configurations (depending on what is selected)
Properly organize configurations in some way.
Simple tasks for more "specialized" applications e.g. IID data ...
I'd like to take this on. As a concrete first step, how about making the Mini SBIBM task and method selection configurable through the pytest API (a command line option or markers) instead of editing the code, keeping the current defaults so it stays a quick sanity check rather than a full benchmark? Happy to scope it to that slice first if that fits what you had in mind.
I'd like to take this on. As a concrete first step, how about making the Mini SBIBM task and method selection configurable through the pytest API (a command line option or markers) instead of editing the code, keeping the current defaults so it stays a quick sanity check rather than a full benchmark? Happy to scope it to that slice first if that fits what you had in mind.
Hi @SahilKumar75 , thanks for offering help here! Yes, this sounds good as a first step. Please make a first concise sketch for a minimal version of these pytest-based CLI options. The should be that one can test different methods and their settings easily, e.g., without changing test suite code or config files.
Hi @SahilKumar75, sorry for the slow reply, and thanks for the clear proposal.
I think this is a good first step, but I would narrow it a bit to keep the change and the review small:
Keep the modes, the defaults and the simulation count option as they are.
Give the generated cases readable ids, e.g. NPE-nsf-two_moons instead of the current NPE-extra_kwargs0-two_moons. Then selecting tasks and existing configurations with -k just works, so we don't need a separate task option.
Add one option that sets the estimator(s) for the selected mode, e.g. as a comma-separated list. It replaces the mode's default estimator list and goes to the matching argument (density estimator, classifier or vector field net). The other choices of a mode, like the SDE types for NPSE, stay as they are.
Fail during collection for an unknown mode (right now it silently skips everything), and when the estimator option is used with a mode whose methods take different estimator arguments, like the default run without a mode. Unknown estimator names are already rejected by sbi itself, so please don't copy lists of valid names into the test suite, they are changing with the ongoing neural net builder refactor.
No separate tests for the options and the generated cases. Instead, please put the --collect-only output of the default run before and after your change into the PR description, to show that the default cases are unchanged, plus one example with the new option.
The other points of the issue (organizing the configurations, new tasks such as IID data, training settings) stay out of this PR.
If this works for you, go ahead with one PR. Just a heads-up that reviews can take a while on our side at the moment. Thanks! 🙏
Quick update on where this stands. Thanks again @SahilKumar75 for #2024, it already makes mini-sbibm much easier to use: tasks and configurations can be selected with -k, and the estimators of a mode can be set with --bm-estimators, without touching the test code.
While reviewing it, we collected a few more improvements:
Compare two runs, e.g. main and a branch, side by side in the results table. Right now the results of all runs end up in one file and overwrite each other in the table.
Reduce noise: evaluate amortized methods on 10 instead of 3 observations, and add an option to repeat each case with several training seeds, run in parallel.
Report the error of the posterior mean and standard deviation next to C2ST, because C2ST can miss a posterior that is too wide.
Add a small mixed-data task for MNLE, with a configurable number of i.i.d. trials.
A few small fixes in the summary table and the docs.
Most of these touch the benchmark setup itself, so we'll do them on our side. The mixed-data task is nicely self-contained though. @SahilKumar75, if you'd like to take it: the toy simulator and prior from the MNLE tests have an exact posterior (Gamma for the rate, Beta for the choice probability), so the reference needs no MCMC. The Gaussian linear task is a good template for a task with an exact reference. One PR with the new task and an mnle mode would be great.
Configuring more than the estimator name, e.g. network sizes or noise schedules, waits until the neural net builder refactor is done. I'll keep this issue open until these are in.
Thanks, Jan. I would like to take the mixed data task and mnle mode. I will use the existing MNLE test simulator and prior, compute the exact Gamma and Beta reference posterior, and follow the Gaussian linear task structure. I will keep it in one focused PR.
Comparing changes: runs get a label (the git branch by default), so the table shows main and a branch side by side. Each case can run with several seeds, and the table shows the posterior mean and std errors next to C2ST (PR tests: compare runs, more metrics and seeds in mini-sbibm #2036).
Configurations: the benchmark builds the estimators with sbi's per-model configs.
One point is left: settings beyond the estimator name, e.g. the number of transforms. With the per-model configs this is now a small change, so we will add it when someone needs it.
enhancementImprovement planned or wanted by the maintainershackathonFor our in-person hackathons with maintainers present, not a general up-for-grabs listtestsEverything to do with the sbi test suite
Activity
SahilKumar75 commentedon Jul 18, 2026
I'd like to take this on. As a concrete first step, how about making the Mini SBIBM task and method selection configurable through the pytest API (a command line option or markers) instead of editing the code, keeping the current defaults so it stays a quick sanity check rather than a full benchmark? Happy to scope it to that slice first if that fits what you had in mind.
janfb commentedon Sep 1, 2026
Hi @SahilKumar75 , thanks for offering help here! Yes, this sounds good as a first step. Please make a first concise sketch for a minimal version of these pytest-based CLI options. The should be that one can test different methods and their settings easily, e.g., without changing test suite code or config files.
SahilKumar75 commentedon Sep 3, 2026
Thanks, @janfb. For a minimal first version, I propose:
I would leave new tasks, metrics, and broader configuration restructuring outside this first change.
Does this scope match what you had in mind?
SahilKumar75 commentedon Sep 10, 2026
@janfb, could you please confirm whether this minimal scope is suitable? If so, I will prepare the implementation and focused tests.
janfb commentedon Sep 10, 2026
Thanks for the proposal, I would look into it next week.
SahilKumar75 commentedon Sep 24, 2026
@janfb, following up on the minimal scope above. Would you prefer that I proceed with this version, or narrow it further before implementation?
janfb commentedon Sep 30, 2026
Hi @SahilKumar75, sorry for the slow reply, and thanks for the clear proposal.
I think this is a good first step, but I would narrow it a bit to keep the change and the review small:
NPE-nsf-two_moonsinstead of the currentNPE-extra_kwargs0-two_moons. Then selecting tasks and existing configurations with-kjust works, so we don't need a separate task option.--collect-onlyoutput of the default run before and after your change into the PR description, to show that the default cases are unchanged, plus one example with the new option.The other points of the issue (organizing the configurations, new tasks such as IID data, training settings) stay out of this PR.
If this works for you, go ahead with one PR. Just a heads-up that reviews can take a while on our side at the moment. Thanks! 🙏
SahilKumar75 commentedon Sep 30, 2026
Thanks, Jan. This scope works for me. I will keep the change focused and include the collection outputs and example in the PR description.
janfb commentedon Oct 1, 2026
Quick update on where this stands. Thanks again @SahilKumar75 for #2024, it already makes mini-sbibm much easier to use: tasks and configurations can be selected with
-k, and the estimators of a mode can be set with--bm-estimators, without touching the test code.While reviewing it, we collected a few more improvements:
Most of these touch the benchmark setup itself, so we'll do them on our side. The mixed-data task is nicely self-contained though. @SahilKumar75, if you'd like to take it: the toy simulator and prior from the MNLE tests have an exact posterior (Gamma for the rate, Beta for the choice probability), so the reference needs no MCMC. The Gaussian linear task is a good template for a task with an exact reference. One PR with the new task and an
mnlemode would be great.Configuring more than the estimator name, e.g. network sizes or noise schedules, waits until the neural net builder refactor is done. I'll keep this issue open until these are in.
SahilKumar75 commentedon Oct 1, 2026
Thanks, Jan. I would like to take the mixed data task and mnle mode. I will use the existing MNLE test simulator and prior, compute the exact Gamma and Beta reference posterior, and follow the Gaussian linear task structure. I will keep it in one focused PR.
janfb commentedon Oct 20, 2026
mini-sbibm now covers the points of this issue, so I'm closing it. Thanks @SahilKumar75 for PR #2024 and PR #2034!
-k, and--bm-estimatorssets the estimators of a mode (PR Add estimator selection to mini SBIBM #2024).mnlemode (PR Add mixed data task and MNLE mode to mini SBIBM #2034).The docs have a short developer page on how to use it: https://github.com/sbi-dev/sbi/blob/main/docs/mini_sbibm.md
One point is left: settings beyond the estimator name, e.g. the number of transforms. With the per-model configs this is now a small change, so we will add it when someone needs it.