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

Update SWIG version, cleaner setup and fix PoCL installation #34

Merged
merged 5 commits into from
Jul 14, 2024
Merged

Conversation

StrikerRUS
Copy link
Collaborator

@StrikerRUS StrikerRUS commented Jul 14, 2024

Cross-reference: microsoft/LightGBM#6541.

@@ -91,31 +92,34 @@ RUN git clone --depth 1 --branch v1.8 https://github.com/pocl/pocl.git \
-DENABLE_POCLCC=OFF \
-DENABLE_TESTS=OFF \
-DENABLE_EXAMPLES=OFF \
-DLLC_HOST_CPU=generic \
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the following error:

#9 10.85 -- Find out LLC target triple (for host x86_64-unknown-linux-gnu)
#9 10.86 -- Find out LLC host CPU with /usr/local/bin/llc
#9 10.87 CMake Error at cmake/LLVM.cmake:721 (message):
#9 10.87   LLVM could not recognize your CPU model automatically.  Please run CMake
#9 10.87   with -DLLC_HOST_CPU=<cpu> (you can find valid names with: llc -mcpu=help)
#9 10.87 Call Stack (most recent call first):
#9 10.87   CMakeLists.txt:472 (include)
#9 10.87 
#9 10.87 
#9 10.87 -- Configuring incomplete, errors occurred!
#9 10.87 See also "/pocl/build/CMakeFiles/CMakeOutput.log".

Copy link
Collaborator Author

@StrikerRUS StrikerRUS Jul 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generic results in Aborted (core dumped). x86-64 seems to be OK.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me based on the description at https://portablecl.org/docs/html/install.html

-DLLC_HOST_CPU=<something> Defaults to auto-detection via llc. Run llc -mcpu=help for valid values. The CPU type is required to compile the “target” (kernel library) part of CPU backend.

This variable overrides LLVM’s autodetected host CPU at configure time. Useful when llc fails to detect the CPU (often happens on non-x86 platforms, or x86 with CPU newer than LLVM).

For as long as we are still using pocl 1.8 (microsoft/LightGBM#5596), LLVM is pinned to v11:

# building clang
#
# [why v11.1.0?]
#
# - LightGBM is incompatible with libomp v12 and v13 (https://github.com/microsoft/LightGBM/issues/4229)
# - PoCL v1.8 requires LLVM+clang, but only supports v6-v13 (https://github.com/pocl/pocl/blob/3f420ef735672e439097d020db605778dbc4a6a1/cmake/LLVM.cmake#L209)
# - so v11.x is the latest version that will work with the these constraints, and v11.1.0 was the last release in the v11 series

LLVM 11.1.0 came out in February 2021 (release history), so I guess it's possible that GitHub's hosted runners could have a newer CPU than that.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the investigation!

@StrikerRUS
Copy link
Collaborator Author

tests/c_api_test/test_.py ./__w/1/s/.ci/test.sh: line 288: 1422 Aborted (core dumped) pytest ./tests
https://dev.azure.com/lightgbm-ci/lightgbm-ci/_build/results?buildId=16615&view=logs&j=9ce42e5d-f31a-544a-a6de-dc42f8c013ed&t=b696def5-78ae-590c-4234-04332342ba2d&l=470

@StrikerRUS
Copy link
Collaborator Author

@StrikerRUS StrikerRUS marked this pull request as ready for review July 14, 2024 19:10
@StrikerRUS StrikerRUS changed the title [WIP] Update SWIG version, cleaner setup and fix PoCL installation Update SWIG version, cleaner setup and fix PoCL installation Jul 14, 2024
Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, thank you!

@jameslamb jameslamb merged commit a48df07 into master Jul 14, 2024
2 checks passed
@jameslamb jameslamb deleted the swig branch July 14, 2024 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants