Runtime on large predictions
Hello,
I am running predictions on 3,628,619 sequences from a custom database using an HPC job with 4 NVIDIA A100 GPUs allocated. In a small-scale test, the code was able to process 43,580 sequences in 3 hours.
Could you confirm whether this is the expected performance, or if it suggests the code is running slower than it should?
I am using the following command:
python prediction.py --seq_type prot --input_file input.faa --truncation_seq_length 10240 --model_path .. --save_path class2_predicted.csv --dataset_name extra_p_2_class_v3 --dataset_type protein --task_type binary_class --task_level_type seq_level --model_type lucaprot --input_type seq_matrix --input_mode single --time_str 20240924203640 --step 264284 --threshold 0.2 --print_per_number 10000 --gpu_id 0
Cheers, Lucas
Hello,
I am running predictions on 3,628,619 sequences from a custom database using an HPC job with 4 NVIDIA A100 GPUs allocated. In a small-scale test, the code was able to process 43,580 sequences in 3 hours.
Could you confirm whether this is the expected performance, or if it suggests the code is running slower than it should?
I am using the following command:
python prediction.py --seq_type prot --input_file input.faa --truncation_seq_length 10240 --model_path .. --save_path class2_predicted.csv --dataset_name extra_p_2_class_v3 --dataset_type protein --task_type binary_class --task_level_type seq_level --model_type lucaprot --input_type seq_matrix --input_mode single --time_str 20240924203640 --step 264284 --threshold 0.2 --print_per_number 10000 --gpu_id 0Cheers, Lucas
Please prioritise using the 'src/prediction_v2.py' of the V3 branch (the latest version), and refer to the readme under the V3 branch instead of the master branch for prediction. If the V3 branch is used, please ignore it.
The difference between the 'prediction_v2.py' and 'prediction.py' is that the 'prediction_v2.py' does not occupy the GPU simultaneously with the protein language model embedding(ESM2-3B) and LucaPCycle, thus enabling more graphics memory to be used for ESM3-embedding (especially for long protein sequences), although it may take a little more time to run.
For your issue (your prediction only running on one GPU, not four GPUs ) : This script does not automatically perform data parallel prediction on multiple GPUs. You need to perform manual data parallelism on multiple GPUs for predictions.
The guidance is as follows:
- Split your input fasta file into K parts, where K represents the number of your available GPUs;
- Predict the corresponding subfile for each GPU and specify the GPU index using '--gpu_id'.
For example, If you have four available GPUs, then divide your 'input.faa' into four equal parts: 'input_01_04.faa', 'input_02_04.faa', 'input_03_04.faa', and 'input_04_04.faa'. Then run the prediction command four times. The input is these four sub-files respectively, and use '--gpu_id' to specify different GPU index respectively.
You can use the CMD 'nvidia-smi' to list the serial numbers of the GPUs available to you and the running GPUs.