Skip to content

test: add --bm-device to run the mini-benchmark on a GPU - #2168

Draft
manuelgloeckler wants to merge 1 commit into
fix/mini-sbibm-task-loadersfrom
feat/bm-device
Draft

manuelgloeckler wants to merge 1 commit into
fix/mini-sbibm-task-loadersfrom
feat/bm-device

Conversation

@manuelgloeckler

Copy link
Copy Markdown
Contributor

Split out of the Simformer PR (#1621). This adds --bm-device so the mini-benchmark can train on a GPU. It builds on the device support for mini-sbibm from #1621, with the MixedData part by @nMaax (co-author on the commit).

Stacked on #2167 (the mini-sbibm loader fixes), because both change the same task methods. This PR targets that branch, so the diff shows only the device change.

Changes

  • --bm-device cuda (or mps) runs training in tests/bm_test.py on that device. The prior and the observations move to the device. Posterior samples come back to the CPU for C2ST. Without the flag everything stays on the CPU, as before.
  • Simulations are still drawn on the CPU, so a given seed gives the same training data on every device.
  • The device is added after the result label is set, so results from different devices land under the same method label.
  • MixedData.get_prior passes the device to MultipleIndependent. Without it, MultipleIndependent moves its parts to the CPU, and MNLE failed on the GPU with a prior device mismatch.
  • Task priors and simulators take an optional device. The simulators also accept parameters that are already on a device. The sequential modes need this, because their proposals sample on the training device.

Testing

Short runs (--bm-num-simulations 300) of the none (without NPE-PFN), snpe, snle, snre and mnle groups pass on --bm-device cuda and --bm-device cpu. tests/mini_sbibm/ passes.

🤖 Generated with Claude Code

Training runs on the given device; simulations are still drawn on the CPU so
a seed gives the same data on every device. Task priors and simulators take
an optional device, and simulators accept parameters already on a device, as
the sequential rounds need.

Co-authored-by: nMaax <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@manuelgloeckler manuelgloeckler mentioned this pull request Nov 11, 2026

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant