From 31a2066bfbd178f3cff661bafc1577f162f2c6d7 Mon Sep 17 00:00:00 2001 From: baocheny Date: Fri, 23 Feb 2024 16:38:35 +0800 Subject: [PATCH 1/3] use a more general path --- fastfold/habana/fastnn/custom_op/fusedsoftmax.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fastfold/habana/fastnn/custom_op/fusedsoftmax.py b/fastfold/habana/fastnn/custom_op/fusedsoftmax.py index 8f2166e1..6d3abd2c 100644 --- a/fastfold/habana/fastnn/custom_op/fusedsoftmax.py +++ b/fastfold/habana/fastnn/custom_op/fusedsoftmax.py @@ -4,9 +4,10 @@ import torch import os +from glob import glob import habana_frameworks.torch.core -custom_fusedsoftmax_op_lib_path = "./build/lib.linux-x86_64-3.8/hpu_fusedsoftmax.cpython-38-x86_64-linux-gnu.so" +custom_fusedsoftmax_op_lib_path = glob('./build/lib.*/*.so')[0] my_dir = os.path.realpath(__file__) my_len = my_dir.rfind('/') base_dir = my_dir[:my_len] From 6e80826d967278e7b40ef7ddf3c58c1eeac1b415 Mon Sep 17 00:00:00 2001 From: baocheny Date: Fri, 23 Feb 2024 16:58:58 +0800 Subject: [PATCH 2/3] fix a error; simplify code --- fastfold/habana/fastnn/custom_op/fusedsoftmax.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fastfold/habana/fastnn/custom_op/fusedsoftmax.py b/fastfold/habana/fastnn/custom_op/fusedsoftmax.py index 6d3abd2c..d309a674 100644 --- a/fastfold/habana/fastnn/custom_op/fusedsoftmax.py +++ b/fastfold/habana/fastnn/custom_op/fusedsoftmax.py @@ -7,11 +7,7 @@ from glob import glob import habana_frameworks.torch.core -custom_fusedsoftmax_op_lib_path = glob('./build/lib.*/*.so')[0] -my_dir = os.path.realpath(__file__) -my_len = my_dir.rfind('/') -base_dir = my_dir[:my_len] -torch.ops.load_library(os.path.join(base_dir, custom_fusedsoftmax_op_lib_path)) +torch.ops.load_library(glob.glob(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'build/lib.*/*.so'))[0]) class FusedSoftmaxFunction(torch.autograd.Function): @staticmethod From f6ceea4a7c3ef6dcd45bfcc00535eb4425c16a16 Mon Sep 17 00:00:00 2001 From: baocheny Date: Fri, 23 Feb 2024 17:13:57 +0800 Subject: [PATCH 3/3] add 1.14.0 habana docker --- habana/docker/Dockerfile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 habana/docker/Dockerfile diff --git a/habana/docker/Dockerfile b/habana/docker/Dockerfile new file mode 100644 index 00000000..36578bea --- /dev/null +++ b/habana/docker/Dockerfile @@ -0,0 +1,15 @@ +FROM vault.habana.ai/gaudi-docker/1.14.0/ubuntu22.04/habanalabs/pytorch-installer-2.1.1:latest + +RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && bash Miniconda3-latest-Linux-x86_64.sh -b +RUN source ${HOME}/miniconda3/etc/profile.d/conda.sh && conda create -n habana python=3.10.12 && conda activate habana && conda install openmm=7.7.0 pdbfixer -c conda-forge -y \ + && conda install hmmer==3.3.2 hhsuite=3.3.0 kalign2=2.04 -c bioconda -y + +RUN source ${HOME}/miniconda3/etc/profile.d/conda.sh && conda activate habana && python -m pip install biopython==1.79 dm-tree==0.1.6 ml-collections==0.1.0 \ +scipy==1.7.1 ray pyarrow pandas einops colossalai + +ENV PYTHONPTAH=$PYTHONPATH:/usr/local/lib/python3.10/dist-packages + +Run source ${HOME}/miniconda3/etc/profile.d/conda.sh && conda activate habana && git clone https://github.com/hpcaitech/FastFold.git \ + && cd ./FastFold \ + && python setup.py install \ + && cd fastfold/habana/fastnn/custom_op/ && python ./setup2.py build && cd -