-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (64 loc) · 2.71 KB
/
lightgbm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: lightgbm
# https://lightgbm.readthedocs.io/en/latest/Installation-Guide.html#id18
# https://github.com/microsoft/LightGBM/tree/master/python-package#build-gpu-version
on:
push:
branches:
- lightgbm
workflow_dispatch:
jobs:
build:
runs-on: windows-2022
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: boost
uses: MarkusJx/install-boost@main
id: install-boost
with:
platform_version: 2022
boost_version: 1.86.0
toolset: msvc
cache: false
- name: cuda-toolkit
uses: Jimver/cuda-toolkit@master
id: cuda-toolkit
# https://docs.nvidia.com/cuda/archive/12.6.2/cuda-installation-guide-microsoft-windows/index.html#id3
with:
# cuda: 12.1.1
method: local
# sub-packages: '["nvcc", "visual_studio_integration"]'
sub-packages: '["nvcc", "cudart"]'
# Nice spot. I did not realize msvc worked without the VS integration of CUDA.
# https://github.com/bitsandbytes-foundation/bitsandbytes/pull/1055
# https://github.com/Jimver/cuda-toolkit/issues/253
# Disable caching of the CUDA binaries, since it does not give us any significant performance improvement
use-github-cache: false
use-local-cache: false
# 在GITHUB_ENV中输出CUDA_PATH
- name: echo version
run: |
nvcc -V
echo ${{ steps.cuda-toolkit.outputs.cuda }}
echo "${{ env.CUDA_PATH }}"
echo ${{ steps.install-boost.outputs.BOOST_VER }}
- name: Configure build
run: |
# cmake -B build -S . -A x64 -DUSE_GPU=1 -DBOOST_ROOT=$BOOST_ROOT
# cmake -B build -S . -A x64 -DUSE_GPU=1 -DBOOST_ROOT=BOOST_ROOT -DOpenCL_LIBRARY="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0/lib/x64/OpenCL.lib" -DOpenCL_INCLUDE_DIR="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0/include"
python -V
# pip wheel lightgbm --config-settings=cmake.define.Boost_ROOT=$BOOST_ROOT
# pip wheel lightgbm --config-settings=cmake.define.USE_GPU=ON --config-settings=cmake.define.OpenCL_INCLUDE_DIR="$CUDA_PATH/include"--config-settings=cmake.define.Boost_ROOT=$BOOST_ROOT
git clone --recursive https://github.com/Microsoft/LightGBM
cd LightGBM
sh ./build-python.sh bdist_wheel --gpu --boost-include-dir=$BOOST_ROOT ----opencl-include-dir="$CUDA_PATH/include"
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
- run: tree LightGBM/dist
# - name: Upload all wheel files
# uses: actions/upload-artifact@v4
# with:
# name: lightgbm-wheels
# path: ' d:\a\win-whl\win-whl\*lightgbm*.whl'
# if-no-files-found: error