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

Fix macOS Metal in Foldseek release 10 #53330

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion recipes/foldseek/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ esac
if [ $(uname -s) = "Darwin" ] && [ $(uname -m) = "arm64" ]; then
export MACOSX_DEPLOYMENT_TARGET=10.15
export MACOSX_SDK_VERSION=10.15
# make sure MetalKit.framework is not removed
export LDFLAGS=$(echo "${LDFLAGS}" | sed "s/-Wl,-dead_strip_dylibs//g")
fi

if [ -z "${ARCH_BUILD}" ]; then
Expand All @@ -24,7 +26,7 @@ fi

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DHAVE_TESTS=0 -DHAVE_MPI=0 ${ARCH_BUILD} -DVERSION_OVERRIDE="${PKG_VERSION}" \
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DHAVE_TESTS=0 -DHAVE_MPI=0 ${ARCH_BUILD} -DVERSION_OVERRIDE="${PKG_VERSION}" \
-DCMAKE_CUDA_ARCHITECTURES="75-real;80-real;86-real;89-real;90" -DENABLE_CUDA=${CUDA} ..
make -j${CPU_COUNT} ${VERBOSE_CM}
make install
6 changes: 4 additions & 2 deletions recipes/foldseek/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ package:
version: {{ version|replace("-", ".") }}

build:
number: 0
number: 1
run_exports:
- {{ pin_subpackage('foldseek', max_pin="x") }}

source:
url: https://github.com/steineggerlab/foldseek/archive/{{ version }}.tar.gz
sha256: {{ sha256 }}
patches:
# remove for next release
- prostt5-memory.patch

requirements:
build:
Expand All @@ -30,7 +33,6 @@ requirements:
- cuda-version >=12.6 # [linux]
- perl
host:
- gawk
- zlib
- bzip2
run:
Expand Down
23 changes: 23 additions & 0 deletions recipes/foldseek/prostt5-memory.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
commit 07932751e776dd71b224dadc94aea0922d08e653
Author: Milot Mirdita <[email protected]>
Date: Mon Jan 20 19:42:31 2025 +0900

Reduce ProstT5 memory requirements

diff --git a/src/strucclustutils/ProstT5.cpp b/src/strucclustutils/ProstT5.cpp
index 605ce300..28bc6c4b 100644
--- a/src/strucclustutils/ProstT5.cpp
+++ b/src/strucclustutils/ProstT5.cpp
@@ -168,9 +168,9 @@ ProstT5::ProstT5(ProstT5Model& model, int threads) : model(model) {
auto cparams = llama_context_default_params();
cparams.n_threads = threads;
cparams.n_threads_batch = threads;
- cparams.n_ubatch = 4096;
- cparams.n_batch = 4096;
- cparams.n_ctx = 4096;
+ cparams.n_ubatch = 2048;
+ cparams.n_batch = 2048;
+ cparams.n_ctx = 2048;
cparams.embeddings = true;
cparams.attention_type = LLAMA_ATTENTION_TYPE_NON_CAUSAL;