Skip to content

Bump cellmapper_scvi's base image and align both obsm keys - #53

Merged
rcannood merged 2 commits into
mainfrom
fix/cellmapper-scvi-key-and-pin
Jul 30, 2026
Merged

Bump cellmapper_scvi's base image and align both obsm keys#53
rcannood merged 2 commits into
mainfrom
fix/cellmapper-scvi-key-and-pin

Conversation

@rcannood

@rcannood rcannood commented Jul 29, 2026

Copy link
Copy Markdown
Member

Describe your changes

cellmapper_scvi fails on every run on current main:

KeyError: 'mod2_pred'

This is my fault -- #23 was wrong. I checked cellmapper's GitHub main instead of the version the image actually installs. Sorry for the churn.

What's really going on

cellmapper changed how map_obsm names its output key, and the two cellmapper components were on different sides of that change because of their base images:

release builds
0.2.2 / 0.2.3 f"{key}_{prediction_postfix}"
0.2.4+ f"{key}{prediction_postfix}"

cellmapper_scvi pinned openproblems/base_pytorch_nvidia:1.0.0, which is on Python 3.10 -- and 0.2.4+ requires ≥3.11 (0.2.6 requires ≥3.12), so pip there could only ever resolve 0.2.3:

ERROR: Ignored the following versions that require a different python version:
  0.2.4 Requires-Python >=3.11; 0.2.5 Requires-Python >=3.11; 0.2.6 Requires-Python >=3.12

On 0.2.3 the "_pred" postfix yields mod2__pred, hence the KeyError.

The change

Rather than pinning the component down to 0.2.3, bump the base image -- :1.0.0 was the only non-sliding base image left in the repo, everything else already uses :1, and :1 is on Python 3.12:

  • cellmapper_scvi: base image :1.0.0 -> :1. The existing prediction_postfix="_pred" is then correct, so the script is untouched.
  • cellmapper_linear: switch to the same "_pred" postfix, so both components read obsm["mod2_pred"].
  • Both: require cellmapper>=0.2.6. An open >=0.2.2 makes the correct key depend on when the image was built, which is how this slipped through twice.

The bumped image also picks up current versions of everything else:

cellmapper-0.2.6  scvi-tools-1.5.0.post1  muon-0.1.9
lightning-2.6.5   mudata-0.3.10           torchmetrics-1.9.0

Verified on a de.NBI Tesla T4

Rebuilt both images from scratch (---setup cb) and ran them, sampling nvidia-smi --query-compute-apps once a second:

cellmapper_scvi     EXIT=0  42s  peak 12% util  165 MiB  CUDA proc 17/39  -> USES GPU
  prediction shape=(163, 134) method_id='cellmapper_scvi' CONTRACT=OK

cellmapper_linear   EXIT=0  23s                          (no gpu label)   -> CPU, as expected
  prediction shape=(163, 134) method_id='cellmapper_linear' CONTRACT=OK

Both images confirmed on cellmapper 0.2.6. cellmapper_scvi now produces a valid prediction and genuinely uses the GPU -- as far as I can tell it has never produced a score before this.

Found while checking on de.NBI which GPU-labelled methods actually use the GPU.

Checklist before requesting a review

  • I have performed a self-review of my code

  • Check the correct box. Does this PR contain:

    • Breaking changes
    • New functionality
    • Major changes
    • Minor changes
    • Bug fixes
  • Proposed changes are described in the CHANGELOG.md

  • CI Tests succeed and look good!

@rcannood
rcannood force-pushed the fix/cellmapper-scvi-key-and-pin branch from e441c39 to 6b38233 Compare July 29, 2026 17:43
@rcannood rcannood changed the title Fix the cellmapper_scvi obsm key, and pin what each variant assumes Bump cellmapper_scvi's base image and align both obsm keys Jul 29, 2026
The 1.0.0 tag is on python 3.10, which caps cellmapper at 0.2.3, and
0.2.3 builds the map_obsm key as f"{key}_{prediction_postfix}" -- so the
"_pred" postfix gave mod2__pred and the component KeyError'd on every
run. The sliding :1 tag is on 3.12 and installs 0.2.6, which builds the
key without the extra underscore.

* Bump cellmapper_scvi to openproblems/base_pytorch_nvidia:1
* Require cellmapper>=0.2.6 in both components
* Switch cellmapper_linear to the same "_pred" postfix, so both read
  obsm["mod2_pred"]
@rcannood
rcannood force-pushed the fix/cellmapper-scvi-key-and-pin branch from 6b38233 to dcdfec9 Compare July 30, 2026 06:43
Comment thread src/methods/cellmapper_linear/config.vsh.yaml Outdated
Comment thread src/methods/cellmapper_scvi/config.vsh.yaml Outdated
Comment thread CHANGELOG.md Outdated
Co-authored-by: Robrecht Cannoodt <rcannood@gmail.com>
@rcannood
rcannood merged commit 0659ffa into main Jul 30, 2026
1 check passed
@rcannood
rcannood deleted the fix/cellmapper-scvi-key-and-pin branch July 30, 2026 06:50
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