Skip to content

feat(vamb/bin): add GPU support - #12876

Merged
dialvarezs merged 2 commits into
nf-core:masterfrom
dialvarezs:vamb-gpu
Sep 4, 2026
Merged

feat(vamb/bin): add GPU support#12876
dialvarezs merged 2 commits into
nf-core:masterfrom
dialvarezs:vamb-gpu

Conversation

@dialvarezs

@dialvarezs dialvarezs commented Sep 3, 2026

Copy link
Copy Markdown
Member

Same treatment SemiBin2 got in #12863, now for Vamb.

vamb/bin picks its container and conda environment from task.accelerator, carries the process_gpu label, and passes --cuda when an accelerator is declared. It also emits the CUDA runtime version to the versions topic.

Vamb pins torch ==2.6.0, which conda-forge only builds against CUDA 12.6, so that is what the GPU environment gets. That build has no sm_120 kernels, but the driver JITs the compute_90 PTX, so Blackwell cards still run.

The wave images are Amazon Linux based and ship neither find nor gzip, both of which the module used on its bins. So gzip joins the GPU environment and the find call becomes a null glob, which tolerates zero bins the same way.

Tests

The existing checks were closures without assert, so { path(...).exists() } and the Completed Vamb line were evaluated and discarded. Adding assert showed the log check never held, since the lines are timestamped.

The tests now use the metagenome binning dataset, which ships per-sample assemblies, BAMs and an abundance table, so BOWTIE2_BUILD, BOWTIE2_ALIGN, COVERM_CONTIG and MMSEQS_CONTIG_TAXONOMY all go. The taxonomy test keeps one GAWK, deriving the lineage from the contig labels the dataset documents.

What is asserted was measured over repeated runs. The bins, the cluster tables and the log move between runs, so the bins are checked as a partition instead: every contig Vamb clustered appears in exactly one bin. abundance, composition and latent_encoding held steady, so they are snapshotted alongside the versions.

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • Remove all TODO statements.
  • Broadcast software version numbers to topic: versions
  • Follow the naming conventions.
  • Follow the parameters requirements.
  • Follow the input/output options guidelines.
  • Add a resource label
  • Use BioConda and BioContainers if possible to fulfil software requirements.
  • nf-core modules test vamb/bin --profile singularity

🤖 Generated with Claude Code

@dialvarezs
dialvarezs force-pushed the vamb-gpu branch 2 times, most recently from a354c96 to 4a9ee7e Compare September 3, 2026 12:48
dialvarezs and others added 2 commits September 3, 2026 10:00
Select the container and conda environment from `task.accelerator`, carry the
`process_gpu` label, and pass `--cuda` when an accelerator is declared. The
CUDA runtime version also goes to the versions topic.

Vamb pins `torch ==2.6.0`, which conda-forge only builds against CUDA 12.6 on
linux-64, so that is what the GPU environment gets. It carries no sm_120
kernels, but the driver JITs the `compute_90` PTX, so Blackwell cards still
run.

Two fixes the GPU path forced. The wave images are Amazon Linux based and ship
neither `find` nor `gzip`, both of which the module used to rename and
compress its bins. So `gzip` joins the GPU environment and the `find` call
becomes a null glob, which tolerates zero bins the same way the old one did.
That matters because `bins` is an optional output.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The existing checks were closures without `assert`, so `{ path(...).exists() }`
and the `Completed Vamb` line were evaluated and discarded. Adding `assert`
showed the log check never held: the lines are timestamped, so `contains` on
the bare string is false.

The tests now use the metagenome binning dataset, which ships per-sample
assemblies, BAMs and an abundance table, so BOWTIE2_BUILD, BOWTIE2_ALIGN,
COVERM_CONTIG and MMSEQS_CONTIG_TAXONOMY all go. The taxonomy test keeps one
GAWK, deriving the lineage from the contig labels the dataset documents. Four
tests that took minutes now take about fifteen seconds each.

Every file Vamb writes turns out to differ between machines, the `.npz`
archives included, so the snapshot keeps the versions and the bins are
checked as a partition instead: every contig Vamb clustered appears in
exactly one bin, read with the nft-fasta plugin. Note this means the
`abundance` snapshot the tests carried before only held because it was
recorded on a runner.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dialvarezs
dialvarezs marked this pull request as ready for review September 3, 2026 13:18
@dialvarezs
dialvarezs added this pull request to the merge queue Sep 4, 2026
Merged via the queue into nf-core:master with commit f553db8 Sep 4, 2026
30 checks passed
@dialvarezs
dialvarezs deleted the vamb-gpu branch September 4, 2026 08:47
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.

2 participants