Add federated BioNeMo Evo2 fine-tuning example - #5289
holgerroth wants to merge 8 commits into
Conversation
|
/build |
|
holgerroth
left a comment
There was a problem hiding this comment.
Reviewed c130a0f. Found one notebook configuration issue, detailed inline. Validation: all 150 focused Evo2 unit tests passed; a two-client, two-round CPU external-process smoke run and mock evaluation passed, with sample-weighted aggregation verified. GPU training and the Docker build were not rerun.
|
/build |
holgerroth
left a comment
There was a problem hiding this comment.
Re-reviewed ee4adfd. The previous notebook initialization finding is fixed: non-default seed, sequence length, and LoRA settings now reach initialization and evaluation consistently. All 169 focused Evo2 tests passed. A fresh two-client/two-round CPU external-process smoke run, mock evaluation, and a continuation at logical round 2 passed; weighted tensor values and the preserved optimizer signature were verified. One remaining notebook reporting issue is noted inline. GPU training and the Docker build were not rerun.
|
/build |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5289 +/- ##
==========================================
+ Coverage 67.72% 67.73% +0.01%
==========================================
Files 1023 1023
Lines 106444 106444
==========================================
+ Hits 72089 72101 +12
+ Misses 34355 34343 -12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/build |
|
/build |
|
/build |
1 similar comment
|
/build |
What this adds
This adds a compact BioNeMo example for federated LoRA fine-tuning of
evo2/1b-8k-bf16:1.0on three-class splice-site classification.The maintained workflow:
Only the LoRA adapters and classification head cross the federation boundary as CPU FP32 tensors. The BF16 backbone remains frozen at each site. The example validates tensor schemas and provenance, synchronizes optimizer master parameters after loading global weights, rejects no-op runs, checks the frozen backbone, audits data leakage, and requires exact evaluation coverage.
All implementation changes are contained under
examples/advanced/bionemo/evo2and its tests; no shared NVFlare API changes are required. See the README and walkthrough.Maintenance scope
Review feedback correctly identified that the original version included too much experiment infrastructure for a maintained example. This revision removes persistent optimizer and RNG state, continuation and checkpoint chains, checkpoint averaging, local-only and head-only campaign modes, model selection, baseline summarization, and benchmark-report generation.
The scope cut reduces the branch by more than 5,000 net lines.
Each federated task now reconstructs Evo2, loads the current global trainable tensors, creates fresh local training state, returns its update, and exits. The maintained lesson is the BioNeMo/Megatron integration and federated adapter exchange. Longer benchmark reproduction remains research tooling outside this example.
The environment is pinned to specific BioNeMo Recipes, Megatron Bridge, causal-conv1d, dataset, and Evo2 checkpoint revisions. Updating those dependencies should include a GPU smoke test of the real training path.
Precursor H100 evidence
Before the scope reduction, a precursor snapshot ran a longer three-site IID campaign and matched independent local-only training budgets. These measurements motivate the example, but the corresponding averaging, baseline, and reporting machinery is no longer part of the maintained workflow.
The raw final FL model exceeded the validation-selected best local model on test by 4.53 percentage points in accuracy and 4.52 points in macro-F1. It exceeded the descriptive local mean by 6.71 and 6.62 points, respectively. The averaged FL endpoint was 1.03 accuracy points below the BioNeMo tutorial's reported 0.9663 result.
Fixed precursor checkpoint identities:
db62e79e96edcbd1aebdd97bbe31b36100b05f442d8c9ca83f84883764ae787c726ce82310b453b81ea1cd0d08d3bb37b839c3f74cfdcfa301d81a1acd0dad39The averaged endpoint was selected using validation results. The local mean is descriptive and is neither an ensemble nor a model trained on combined local data. These results came from simulated IID partitions on a precursor implementation, and official test results were observed during development. They demonstrate feasibility and collaboration benefit in this controlled experiment; they do not establish broad gains across institutions or heterogeneous genomic datasets.
Validation
git diff --checkpassed.00e3d4506efb8e12f0b0a7ad9c37c56700d69166: two BioNeMo clients completed one round with four local steps; 199 of 206 trainable tensors changed; both clients verified the frozen backbone; the final checkpoint reloaded and evaluated all 3,000 official test rows; and the GPU had no process or allocated memory before or after the run. The current head differs only in test timeout handling.The four-step smoke produced 0.3447 accuracy and 0.2366 macro-F1. This deliberately short run validates the integration path, tensor exchange, checkpoint reload, and teardown; it is not a quality benchmark. One warmup step had produced no BF16-visible update, so the example now documents four steps and rejects a completed run whose global trainable state is unchanged.
The final H100 smoke reused a known-good previously converted Evo2 base checkpoint. Its complete directory content was bound to initialization, training, and evaluation metadata, but it predates the current
nvflare_conversion_provenance.jsonformat. The smoke therefore validates the final training and evaluation path; checkpoint reconversion was not rerun.Types of changes
./runtest.sh.