Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

habana imporvement #189

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions fastfold/habana/fastnn/custom_op/fusedsoftmax.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +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"
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
Expand Down
15 changes: 15 additions & 0 deletions habana/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 -