LucaPCycle icon indicating copy to clipboard operation
LucaPCycle copied to clipboard

Training Using ESM

Open sbc806 opened this issue 1 year ago • 2 comments

Hi,

I am trying to train the model using only the embeddings from ESM on 4 H100 GPUs. To do this, I made the devices 0, 1, 2, and 3 visible. I also switched python run.py args to be torchrun --nproc-per-node=4 --nnodes=1 args, but this caused an error in the function predict_embedding(). Specifically, line 425, which is global_model = global_model.to(device), results in an error stating that spawn process might be used. I was wondering if this error might have been previously encountered?

I was also wondering what the training time for LucaPCycle was? Currently, I changed args.worker_num to be 0 to avoid errors when using multiple GPUs and predict_embedding(), but it seems slower than expected.

During training, args.matrix_dirpath is set to None to avoid space issues, which likely contributes to the slower runtime. I was wondering then how much space might be expected to be used if args.matrix_dirpath is not set to None?

Thank you! Sarah

sbc806 avatar Aug 26 '25 21:08 sbc806

Hi,

I am trying to train the model using only the embeddings from ESM on 4 H100 GPUs. To do this, I made the devices 0, 1, 2, and 3 visible. I also switched python run.py args to be torchrun --nproc-per-node=4 --nnodes=1 args, but this caused an error in the function predict_embedding(). Specifically, line 425, which is global_model = global_model.to(device), results in an error stating that spawn process might be used. I was wondering if this error might have been previously encountered?

I was also wondering what the training time for LucaPCycle was? Currently, I changed args.worker_num to be 0 to avoid errors when using multiple GPUs and predict_embedding(), but it seems slower than expected.

During training, args.matrix_dirpath is set to None to avoid space issues, which likely contributes to the slower runtime. I was wondering then how much space might be expected to be used if args.matrix_dirpath is not set to None?

Thank you! Sarah

If you want to train a model using multiple GPUs, you should first pre-generate the ESM embeddings for all sequences of your model-building dataset. Save these embeddings into a directory: ${matrix_dirpath} (you can refer to the script “src/prediction_structural_embedding.sh” in the V3 branch for this process).

Then, when you run your multi-GPU training script (e.g., run_****.sh), specify the path to your pre-generated embeddings using the --matrix_dirpath=${matrix_dirpath}.

Attempting to generate embeddings on-the-fly during multi-GPU training will cause issues(It hasn't been solved yet). This on-the-fly method only works correctly for single-GPU training.

Additionally, please prioritize using the V3 branch over the master branch.

LucaOne avatar Aug 27 '25 11:08 LucaOne

Thank you very much for the explanation!

sbc806 avatar Aug 27 '25 23:08 sbc806