Skip to content

Adding HPC array support - #59

Merged
epbrenner merged 11 commits into
feature-rescoringfrom
hpc-parallelization
Nov 24, 2026
Merged

epbrenner merged 11 commits into
feature-rescoringfrom
hpc-parallelization

Conversation

@epbrenner

Copy link
Copy Markdown
Contributor

"Evan, I don't want to run 142,000 ML models on my Mac Mini. 😢"

Then check this out. Adds task-based chunking of models that can be used for Slurm cluster job arrays! Adds task-chunks.R which handles the chunking logic (which is slightly complicated by shared model fits, so each chunk needs to have the same tasks that rely on the same model fits for the greatest speedup). Added parameters to workflow.R so users can prepare an array job, run it, and then combine it afterwards. The default is keeping this in "fit" mode, which is the previous behavior and when on regular computers instead of HPC monstrosities you can simply ignore these parameters entirely.

Tested on Alpine in a Conda environment. Use instructions are politely included in the documentation.

@epbrenner epbrenner self-assigned this Nov 6, 2026
@epbrenner
epbrenner added this pull request to stack #58 November 6, 2026 22:13
Adding the ability for tasks to be split into chunks and computed on separate HPC nodes for Slurm array jobs. task-chunks.R handles the details, workflow.R includes the user-facing implementation. Currently, array jobs require you to plan the array first, then execute (the actual modeling on many workers in an array), and finally collect the results into a single result bundle.
Primarily updates HPC performance with Slurm arrays. Now spins out jobs more robustly into very large-scale arrays, and when OOM errors pop up (they will), this logs and auto-retries with additional memory for two more retries. Benchmarking with S. sonnei shows great improvements in runtime when scaled up with large arrays.

Also some MDR scoring changes, which aren't final and deserve scrutiny.
Wasn't catching false positives for some MDR classes, bug has been relocated outside and removed from the premises.
Updating CV handling so folds can be distributed to individual CPU cores, which benefits some very very very slow MDR models. Adding verbosity handling, changing what "vanilla" refers to and adding a lot more documentation to help users figure out what different parameters do.
@AbhirupaGhosh AbhirupaGhosh added rewrite These PRs are relevant to the ongoing rewrite and merging will be to amrml-rewrite branch enhancement New feature or request labels Nov 16, 2026
Keeps both sides' workflow arguments and tests. Array collection now replays the saved rescore_min_seeds (it always used 3), runTaskChunk() uses .threadsBPPARAM() so threads don't fork inside Positron or RStudio, and the collection test checks #53's Parquet rescoring outputs instead of discovery.rds.
@amcim

amcim commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

I merged the feature-rescoring branch in here as that is the branch we should merge this into now that #57 was already merged. Basically things look pretty good in this PR, did the merge to deal with the conflicts

  1. IDE backend: runTaskChunk() now uses .threadsBPPARAM(threads), new in Feature rescoring module and outputting merged results and model fits #53's utils.R. The old code built MulticoreParam for threads > 1, which forks inside Positron or RStudio.
  2. Rescoring minimum: collectTaskArray() replays the saved settings, but rescore_min_seeds wasn't among them, so collection always rescored with 3. The workflow snapshot now saves it, collection passes it back, and there's a test.
    3, Collection test: it now checks for results/rescoring/parameters.json, because Feature rescoring module and outputting merged results and model fits #53 writes Parquet rescoring outputs instead of discovery.rds.

epbrenner and others added 4 commits November 17, 2026 15:37
Oops.

Co-Authored-By: Emily Boyer <130874527+eboyer221@users.noreply.github.com>
Updated version can return for a later PR
Falling back to previous MDR scoring and tuning behavior. These changes deserve greater scrutiny and should be made in a future PR, and these updates are not necessary for v1. Tossing them for now to keep this PR cleaner!
…imization

# Conflicts:
#	R/rescore.R
#	R/task-chunks.R
#	R/workflow.R
#	man/rescoreFeatures.Rd
#	man/runModelingWorkflow.Rd
#	tests/testthat/test-workflow-presets.R
@amcim

amcim commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

@epbrenner Note that for merging this one, I think the reason PR 59 is spinning and infinitely not declared as ready is because its targetting branch for PR 57, the merged PR
image

@epbrenner
epbrenner removed this pull request from stack #58 November 24, 2026 19:52
HPC + MDR optimization & updated defaults
@epbrenner
epbrenner changed the base branch from organization-updates to feature-rescoring November 24, 2026 19:55
@epbrenner
epbrenner merged commit 08fde64 into feature-rescoring Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request rewrite These PRs are relevant to the ongoing rewrite and merging will be to amrml-rewrite branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants