feat: added lora to evo2#980
Conversation
|
@jstjohn, tagging you on this PR. |
|
Thanks for this! Will take some time to review but it is on our radar! |
|
/ok to test 7dd28a2 |
|
@gabenavarro could you setup and run the pre-commit hooks on your branch, then I can re-run CI? It's just failing on the linter at the moment. Thanks for the contribution! |
@trvachov, yeah, I can get it this week. Glad to contribute! |
|
@trvachov, just got around to setting up and running the pre-commit hooks on my branch. Can you please can re-run CI? Apologies for not setting them up earlier! |
|
/ok to test 1e81b3d |
Signed-off-by: Gabriel Navarro <gchinonavarro@gmail.com>
Signed-off-by: Gabriel Navarro <gchinonavarro@gmail.com>
1e81b3d to
ba748e0
Compare
|
@trvachov, I think I disrupted the testing with signing off on the code. Do you mind restarting tests? Thank you! |
|
/ok to test ba748e0 |
|
Not sure why CI failed -- will update branch and rerun. |
|
/ok to test 6c47582 |
|
FYI there were some pretty significant refactors to |
jstjohn
left a comment
There was a problem hiding this comment.
Approved with comments on the merge.
|
I'm also reviewing this -- ETA 07/25 |
|
@gabenavarro I've reviewed the PR -- looks good! I had to do some conflict resolution due to a recent change from @jstjohn , but it's not too bad. Here's the diff you'll need to apply to train.py Pending that, I think this is good to merge. Some high level before-after numbers: No LoRA finetuning of 1B model: With your LoRA change: Note, we will want to test Evo2 LoRA functionality (possibly taking inspiration from @yzhang123 's ESM2 testing here #996), but this is non-blocking for merge of this PR -- I think this is fine as is. We'll just note it as "experimental" LoRA finetuning of Evo2 in the release notes. Thanks again! |
Signed-off-by: gabenavarro <40647204+gabenavarro@users.noreply.github.com>
|
/ok to test 61e4e57 |
|
@gabenavarro This is ready to merge -- can you just resolve the merge conflict (my prior comment) and make it one commit relative to top-of-tree main? I can also do all this myself and force merge but I'd like you to get the authorship credit into the git history 😄 PS. Dont forget to run the pre-commit (see .pre-commit-config.yaml) so that the tests dont trivially fail on linter errors. |
Signed-off-by: gabenavarro <40647204+gabenavarro@users.noreply.github.com>
Signed-off-by: Gabriel Navarro <gchinonavarro@gmail.com>
|
@trvachov , thanks for the reminder. Should be done now! |
|
/ok to test 2a3221d |
Description
This PR adds Low-Rank Adaptation (LoRA) support to Evo2, enabling parameter-efficient fine-tuning of Evo2/Hyena models for protein sequence modeling and generative tasks. Related to issue #884
Key highlights:
Adds
Evo2LoRAclass inpeft.py:linear_qkv,hyena_filter,short_filter, etc.)Integrates LoRA with Evo2 training via:
--lora-finetuneflag to enable LoRA-based fine-tuning.--lora-checkpoint-pathto resume from a pre-trained LoRA checkpoint.ModelTransformcallback handling for training when LoRA is active.Supports advanced, memory-efficient fine-tuning workflows on large Evo2 models with reduced GPU memory consumption.
Type of changes
CI Pipeline Configuration
Please add:
[SKIP_CI]Skip all continuous integration testsUsage
Example:
train_evo2 \ --experiment-name lora_test \ --model-size 1b \ --devices 8 \ --num-nodes 1 \ --seq-length 8192 \ --micro-batch-size 2 \ --lr 0.000015 \ --min-lr 0.0000149 \ --warmup-steps 500 \ --grad-acc-batches 4 \ --max-steps 10000 \ --ckpt-dir <YOUR>/<CKPT>/<DIR> \ --clip-grad 5 \ --wd 0.001 \ --attention-dropout 0.01 \ --hidden-dropout 0.01 \ --val-check-interval 50 \ --activation-checkpoint-recompute-num-layers 5 \ --result-dir <YOUR>/<RESULT>/<DIR> \ --ckpt-async-save \ --lora-finetune \ --mock-dataPre-submit Checklist