gregory-kyro / HAC-Net

HAC-Net: A Hybrid Attention-Based Convolutional Neural Network for Highly Accurate Protein-Ligand Binding Affinity Prediction
MIT License
50 stars 7 forks source link

Large-scale prediction #9

Open stan1233 opened 1 month ago

stan1233 commented 1 month ago

Hi!

I successfully deployed it on my computer, I tried to re-score the results of virtual screening, I only used a simple for loop, when there are thousands of results to be predicted, each prediction takes a few seconds, it will indeed take a lot of time, is there a better way to make large-scale predictions?

Thank you for sharing your work.

gregory-kyro commented 1 month ago

Batch processing should significantly speed up inference time for large-scale predictions. Please feel free to share your code and I will try to provide suggestions regarding how I would integrate batch processing.

Best, Gregory

stan1233 commented 1 month ago

Thank you for offering help.

I'm trying to modify def add_mol2_charges(pocket_mol2) in functions.py, Use ChargeFW2 as an alternative to online requests. So it can run locally to reduce the latency caused by the network. The current result is approximately 2.79ligand/s.

When I try to use multiprocessing for multi-process batch processing, the following error occurs. Is it because a single GPU cannot perform multiprocessing?

Best Guangyuan

CUDA error: initialization error
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1
Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.

https://github.com/gregory-kyro/HAC-Net/blob/c7d00e0037af543ad46fb8fc718435b49add9a3e/HACNet/functions.py#L417C3-L417C37