Repository navigation
Conversation
## What `run_inference_flash.py` can now shard each store over several GPUs with Lightning DDP (`--devices N`, `--num-nodes M`; one SLURM task per GPU). Each rank predicts every N-th cell; rank 0 gathers the rows, restores table order and writes the `pred_table` with the existing code, so the table format is the same for 1 and N GPUs. Each rank seeds with `seed + rank`. The Rich progress bar is replaced by tqdm, which writes lines to a log file. `FlowPipeline.__call__` is split into `sample_batch` and `denormalize` so the Lightning path reuses the sampling code. `__call__` itself is unchanged. A new test pins `__call__` to those two. ## Why A store with ~800k cells takes more than 24 h on one GPU, past the QoS wall clock. The per-store queue cannot help with a single slide. **With N > 1 values are not bitwise equal to 1 GPU**: each cell gets different noise and batches contain different cells. The difference is the size of a seed change (see below). With one device the output is bitwise identical to the previous script. With several devices a failed store aborts the job instead of being skipped. ## Tested - `pytest tests`: 47 passed, 2 failed (`test_models.py` `llama3_forward`, `mixer_autoencoder_roundtrip`, CUDA errors on the GPU-less login node; not re-run on a GPU). - `prek` hooks on the changed files: all pass. - H100 node, 243-cell store, batch size 16: `--devices 1` is bitwise equal to the old script (default and `--fast`); 4 GPUs vs 1 GPU gives mean |d| 0.183 / 0.182 (seed 0 / 1), against 0.188 for seed 1 vs 0 on 1 GPU; table format identical. - 56,510-cell store, 4 x H100: 1838 s vs 7191 s on 1 GPU (3.9x), format identical, mean |d| 0.153.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #28 +/- ##
==========================================
+ Coverage 48.20% 48.25% +0.05%
==========================================
Files 10 10
Lines 1029 1030 +1
==========================================
+ Hits 496 497 +1
Misses 533 533
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
run_inference_flash.pycan now split a single store across several GPUs with Lightning DDP.--devices N/--num-nodes M, launched with one SLURM task per GPU (srun --ntasks-per-node=N).pred_tablewith the existing code, so the table format is the same for 1 and N GPUs.seed + rank, so ranks do not share noise.FlowPipeline.__call__is split intosample_batchanddenormalizeso the Lightning path reuses the sampling code.__call__is unchanged; a new test pins it to those two.Why
A store with ~800k cells takes more than 24 h on one GPU, past the QoS wall clock, and the per-store queue cannot help with a single slide.
Heads-up
pred_tableare skipped, so a rerun resumes.scripts/*.sbatchis gitignored). It needs--gpu-bind=noneso each task sees all four GPUs.Tested
pytest tests: 47 passed, 2 failed (test_models.py:llama3_forward,mixer_autoencoder_roundtrip; CUDA errors on the GPU-less login node, not re-run on a GPU).prekhooks on the changed files: all pass.H100, 243 cells, batch size 16, mean |Δ|:
--devices 1vs old script--fast)Table format (dtype, shape,
obs,var,obsm["spatial"],uns["spatialdata_attrs"]) is identical.56,510 cells, 4 × H100: 1838 s vs 7191 s on 1 GPU (3.9×). Format identical, mean |Δ| 0.153.