-
Notifications
You must be signed in to change notification settings - Fork 136
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 build CI failure on MacOS #1685
Conversation
9cd8cc7
to
fe91a0f
Compare
Currently k-NN native libraries can completely make build in
|
.github/workflows/CI.yml
Outdated
sed -i -e 's/__aarch64__/__undefine_aarch64__/g' external/faiss/faiss/utils/distances_simd.cpp | ||
sed -i -e 's/pragma message WARN/pragma message /g' external/nmslib/similarity_search/src/distcomp_scalar.cc | ||
sed -i -e 's/-march=native/-mcpu=apple-m1/g' external/nmslib/similarity_search/CMakeLists.txt | ||
sed -i -e 's/-mcpu=apple-a14/-mcpu=apple-m1/g' external/nmslib/python_bindings/setup.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we dont use python bindings so this should be unnecessary.
.github/workflows/CI.yml
Outdated
sed -i -e 's/pragma message WARN/pragma message /g' external/nmslib/similarity_search/src/distcomp_scalar.cc | ||
sed -i -e 's/-march=native/-mcpu=apple-m1/g' external/nmslib/similarity_search/CMakeLists.txt | ||
sed -i -e 's/-mcpu=apple-a14/-mcpu=apple-m1/g' external/nmslib/python_bindings/setup.py | ||
if sysctl -n machdep.cpu.features | grep -i AVX2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We dont need this if runner is arm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as below
.github/workflows/CI.yml
Outdated
export CC=/opt/homebrew/opt/llvm/bin/clang | ||
export CXX=/opt/homebrew/opt/llvm/bin/clang++ | ||
cd jni | ||
sed -i -e 's/\/usr\/local\/opt\/libomp\//\/opt\/homebrew\/opt\/llvm\//g' cmake/init-faiss.cmake |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just add this check in cmake?
.github/workflows/CI.yml
Outdated
export CXX=/opt/homebrew/opt/llvm/bin/clang++ | ||
cd jni | ||
sed -i -e 's/\/usr\/local\/opt\/libomp\//\/opt\/homebrew\/opt\/llvm\//g' cmake/init-faiss.cmake | ||
sed -i -e 's/__aarch64__/__undefine_aarch64__/g' external/faiss/faiss/utils/distances_simd.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be possible to avoid. In faiss, I think they are building it without patches: facebookresearch/faiss#3411.
.github/workflows/CI.yml
Outdated
cd jni | ||
sed -i -e 's/\/usr\/local\/opt\/libomp\//\/opt\/homebrew\/opt\/llvm\//g' cmake/init-faiss.cmake | ||
sed -i -e 's/__aarch64__/__undefine_aarch64__/g' external/faiss/faiss/utils/distances_simd.cpp | ||
sed -i -e 's/pragma message WARN/pragma message /g' external/nmslib/similarity_search/src/distcomp_scalar.cc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need to switch the WARN message?
.github/workflows/CI.yml
Outdated
sed -i -e 's/\/usr\/local\/opt\/libomp\//\/opt\/homebrew\/opt\/llvm\//g' cmake/init-faiss.cmake | ||
sed -i -e 's/__aarch64__/__undefine_aarch64__/g' external/faiss/faiss/utils/distances_simd.cpp | ||
sed -i -e 's/pragma message WARN/pragma message /g' external/nmslib/similarity_search/src/distcomp_scalar.cc | ||
sed -i -e 's/-march=native/-mcpu=apple-m1/g' external/nmslib/similarity_search/CMakeLists.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that native should be fine. We shouldnt need this
Thank @jmazanec15 for comments. For the arm setup, I followed steps from k-NN developer guide doc. But currently the it has another new error happened during k-NN run time in integ test when we use the |
Signed-off-by: Junqiu Lei <[email protected]>
Signed-off-by: Junqiu Lei <[email protected]>
After we just changed the label to use |
.github/workflows/CI.yml
Outdated
brew reinstall gcc | ||
export FC=/usr/local/Cellar/gcc/12.2.0/bin/gfortran | ||
brew install llvm | ||
brew install openblas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw this message in logs:
2024-05-03T00:54:26.3237060Z openblas is keg-only, which means it was not symlinked into /opt/homebrew,
2024-05-03T00:54:26.3237780Z because macOS provides BLAS in Accelerate.framework.
Can we skip this?
.github/workflows/CI.yml
Outdated
run: | | ||
git submodule update --init --recursive | ||
brew reinstall gcc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're using clang, I dont think we need gcc
Signed-off-by: Junqiu Lei <[email protected]> (cherry picked from commit 73d5425)
Description
Fix build CI failure for MacOS. The github CI runner for
macos-latest
changed to use ARM platform recently, updating to usemacos-12
with x86_64 architecture to pass the CI.Issues Resolved
#1660
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.