File tree Expand file tree Collapse file tree 5 files changed +47
-9
lines changed Expand file tree Collapse file tree 5 files changed +47
-9
lines changed Original file line number Diff line number Diff line change 1
- FROM us-docker.pkg.dev/colab-images/public/runtime:latest
1
+ ARG BASE_IMAGE \
2
+ BASE_IMAGE_TAG \
3
+ LIGHTGBM_VERSION
4
+
5
+ {{ if eq .Accelerator "gpu" }}
6
+ FROM gcr.io/kaggle-images/python-lightgbm-whl:${BASE_IMAGE_TAG}-${LIGHTGBM_VERSION} AS lightgbm_whl
7
+ {{ end }}
8
+ FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG}
2
9
3
10
ADD kaggle_requirements.txt /kaggle_requirements.txt
4
11
@@ -49,6 +56,17 @@ RUN update-alternatives --set cuda /usr/local/cuda-$CUDA_MAJOR_VERSION.$CUDA_MIN
49
56
50
57
RUN uv pip install --system "pycuda"
51
58
59
+ # b/381256047 Remove once installed in Colabs base image.
60
+ # Install LightGBM
61
+ COPY --from=lightgbm_whl /tmp/whl/*.whl /tmp/lightgbm/
62
+ # Install OpenCL (required by LightGBM GPU version)
63
+ RUN apt-get install -y ocl-icd-libopencl1 clinfo && \
64
+ mkdir -p /etc/OpenCL/vendors && \
65
+ echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd && \
66
+ uv pip install --system /tmp/lightgbm/*.whl && \
67
+ rm -rf /tmp/lightgbm && \
68
+ /tmp/clean-layer.sh
69
+
52
70
# Remove CUDA_VERSION from non-GPU image.
53
71
{{ else }}
54
72
ENV CUDA_VERSION=""
Original file line number Diff line number Diff line change @@ -21,6 +21,29 @@ pipeline {
21
21
}
22
22
23
23
stages {
24
+ stage(' Pre-build Packages from Source' ) {
25
+ stages {
26
+ stage(' lightgbm' ) {
27
+ options {
28
+ timeout(time : 10 , unit : ' MINUTES' )
29
+ }
30
+ steps {
31
+ sh ''' #!/bin/bash
32
+ set -exo pipefail
33
+ source config.txt
34
+ cd packages/
35
+ ./build_package --base-image $BASE_IMAGE:$BASE_IMAGE_TAG \
36
+ --package lightgbm \
37
+ --version $LIGHTGBM_VERSION \
38
+ --build-arg CUDA_MAJOR_VERSION=$CUDA_MAJOR_VERSION \
39
+ --build-arg CUDA_MINOR_VERSION=$CUDA_MINOR_VERSION \
40
+ --push
41
+ '''
42
+ }
43
+ }
44
+ }
45
+ }
46
+
24
47
stage(' Build/Test/Diff' ) {
25
48
parallel {
26
49
stage(' CPU' ) {
Original file line number Diff line number Diff line change
1
+ BASE_IMAGE=us-docker.pkg.dev/colab-images/public/runtime
2
+ BASE_IMAGE_TAG=release-colab_20240920-060127_RC00
3
+ LIGHTGBM_VERSION=4.5.0
1
4
CUDA_MAJOR_VERSION=12
2
5
CUDA_MINOR_VERSION=2
Original file line number Diff line number Diff line change @@ -115,12 +115,8 @@ if [[ -z "$DOCKERFILE" ]]; then
115
115
exit 1
116
116
fi
117
117
118
- # Keep only `tf2-gpu.2-6:m80` in `gcr.io/deeplearning-platform-release/tf2-gpu.2-6:m80`
119
- TAG=${BASE_IMAGE/ gcr.io\/ deeplearning-platform-release\/ / }
120
- # Keep only `python:v108` in `gcr.io/kaggle-images/python:v108`
121
- TAG=${TAG/ gcr.io\/ kaggle-images\/ / }
122
- # Replace the `:` in `tf2-gpu.2-6:m80` by `-`
123
- TAG=${TAG/:/ -}
118
+ # Keep only `release-colab_20240920-060127_RC00` in `us-docker.pkg.dev/colab-images/public/runtime:release-colab_20240920-060127_RC00`
119
+ TAG=$( echo $BASE_IMAGE | cut -d ' :' -f 2)
124
120
# Append the package version
125
121
TAG=$TAG -$PACKAGE_VERSION
126
122
# Add the gcr repo.
Original file line number Diff line number Diff line change @@ -34,9 +34,7 @@ def test_cpu(self):
34
34
35
35
self .assertEqual (1 , gbm .best_iteration )
36
36
37
- # TODO(b/381256047): Colab needs to install GPU-enabled lightgbm.
38
37
@gpu_test
39
- @unittest .skip ("Skipping this test until b/381256047 is resolved." )
40
38
def test_gpu (self ):
41
39
lgb_train , lgb_eval = self .load_datasets ()
42
40
You can’t perform that action at this time.
0 commit comments