Skip to content

Commit 6cf6818

Browse files
BUILD: Change default buildtype from debug to release (#869)
1 parent 6e36cfa commit 6cf6818

File tree

9 files changed

+32
-13
lines changed

9 files changed

+32
-13
lines changed

.ci/jenkins/lib/build-container-matrix.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ steps:
8888
--base-image-tag "${BASE_IMAGE_TAG}" \
8989
--tag "${LOCAL_TAG_BASE}${arch}" \
9090
--arch "${arch}" \
91+
--build-type debug \
9192
--no-cache
9293
9394
- name: Add Version Info
@@ -174,7 +175,7 @@ steps:
174175
echo "benchmark/nixlbench/contrib/build.sh --base-image ${BASE_IMAGE} --base-image-tag ${BASE_IMAGE_TAG} --tag local-test-tag --arch ${arch} --no-cache --nixl \$WORKSPACE --ucx \$WORKSPACE/ucx-src"
175176
else
176177
echo "export UCX_REF=${UCX_VERSION}"
177-
echo "contrib/build-container.sh --base-image ${BASE_IMAGE} --base-image-tag ${BASE_IMAGE_TAG} --tag local-test-tag --arch ${arch} --no-cache"
178+
echo "contrib/build-container.sh --base-image ${BASE_IMAGE} --base-image-tag ${BASE_IMAGE_TAG} --tag local-test-tag --arch ${arch} --build-type debug --no-cache"
178179
fi
179180
180181
pipeline_stop:

.ci/jenkins/lib/build-matrix.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,4 @@ steps:
8989
ln -sfT $(type -p podman) /usr/bin/docker
9090
# install git for building container image
9191
yum install -y git
92-
contrib/build-container.sh --no-cache
92+
contrib/build-container.sh --build-type debug --no-cache

.gitlab/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export CMAKE_PREFIX_PATH="${INSTALL_DIR}:${CMAKE_PREFIX_PATH}"
227227
export UCX_TLS=^cuda_ipc
228228

229229
# shellcheck disable=SC2086
230-
meson setup nixl_build --prefix=${INSTALL_DIR} -Ducx_path=${UCX_INSTALL_DIR} -Dbuild_docs=true -Drust=false ${EXTRA_BUILD_ARGS} -Dlibfabric_path="${LIBFABRIC_INSTALL_DIR}"
230+
meson setup nixl_build --prefix=${INSTALL_DIR} -Ducx_path=${UCX_INSTALL_DIR} -Dbuild_docs=true -Drust=false ${EXTRA_BUILD_ARGS} -Dlibfabric_path="${LIBFABRIC_INSTALL_DIR}" --buildtype=debug
231231
ninja -j"$NPROC" -C nixl_build && ninja -j"$NPROC" -C nixl_build install
232232
mkdir -p dist && cp nixl_build/src/bindings/python/nixl-meta/nixl-*.whl dist/
233233

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,16 @@ $ ninja install
115115

116116
### Build Options
117117

118-
#### Release build
118+
#### Release build (default)
119119

120120
```bash
121-
$ meson setup <name_of_build_dir> --buildtype=release
121+
$ meson setup <name_of_build_dir>
122122
```
123123

124-
#### Debug build (default)
124+
#### Debug build
125125

126126
```bash
127-
$ meson setup <name_of_build_dir>
127+
$ meson setup <name_of_build_dir> --buildtype=debug
128128
```
129129

130130
#### NIXL-specific build options
@@ -202,7 +202,7 @@ For Python examples, see [examples/python/](examples/python/).
202202
### Rust Bindings
203203
#### Build
204204
- Use `-Drust=true` meson option to build rust bindings.
205-
- Use `-Ddebug=false` for a release build.
205+
- Use `--buildtype=debug` for a debug build (default is release).
206206
- Or build manually:
207207
```bash
208208
$ cargo build --release

contrib/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ ARG NPROC
3232
ARG WHL_DEFAULT_PYTHON_VERSIONS="3.12"
3333
ARG LIBFABRIC_VERSION="v1.21.0"
3434
ARG LIBFABRIC_INSTALL_PATH="/usr/local"
35+
ARG BUILD_TYPE="release"
3536

3637
# Install build dependencies from Ubuntu repository
3738
RUN apt-get update -y && \
@@ -201,7 +202,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends pybind11-dev
201202
ENV NIXL_PREFIX=$NIXL_PREFIX
202203
RUN rm -rf build && \
203204
mkdir build && \
204-
meson setup -Dlibfabric_path=$LIBFABRIC_INSTALL_PATH build/ --prefix=$NIXL_PREFIX && \
205+
meson setup -Dlibfabric_path=$LIBFABRIC_INSTALL_PATH build/ --prefix=$NIXL_PREFIX --buildtype=$BUILD_TYPE && \
205206
cd build && \
206207
ninja && \
207208
ninja install

contrib/Dockerfile.manylinux

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ ARG DEFAULT_PYTHON_VERSION="3.12"
2222
ARG ARCH="x86_64"
2323
ARG UCX_REF="v1.20.x"
2424
ARG LIBFABRIC_VERSION="v1.21.0"
25+
ARG BUILD_TYPE="release"
2526

2627
RUN yum groupinstall -y 'Development Tools' && \
2728
dnf install -y almalinux-release-synergy && \
@@ -248,7 +249,7 @@ WORKDIR /workspace/nixl
248249

249250
RUN rm -rf build && \
250251
mkdir build && \
251-
meson setup build/ --prefix=/usr/local/nixl --buildtype=release \
252+
meson setup build/ --prefix=/usr/local/nixl --buildtype=$BUILD_TYPE \
252253
-Dcudapath_lib="/usr/local/cuda/lib64" \
253254
-Dcudapath_inc="/usr/local/cuda/include" && \
254255
cd build && \

contrib/build-container.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ WHL_PYTHON_VERSIONS="3.12"
3838
UCX_REF=${UCX_REF:-v1.20.x}
3939
OS="ubuntu24"
4040
NPROC=${NPROC:-$(nproc)}
41+
if [ "$CI" = "true" ]; then
42+
BUILD_TYPE="debug"
43+
else
44+
BUILD_TYPE="release"
45+
fi
4146

4247
get_options() {
4348
while :; do
@@ -81,6 +86,14 @@ get_options() {
8186
--no-cache)
8287
NO_CACHE=" --no-cache"
8388
;;
89+
--build-type)
90+
if [ "$2" ]; then
91+
BUILD_TYPE=$2
92+
shift
93+
else
94+
missing_requirement $1
95+
fi
96+
;;
8497
--tag)
8598
if [ "$2" ]; then
8699
TAG="--tag $2"
@@ -156,6 +169,7 @@ show_build_options() {
156169
echo "Python Versions for wheel build: ${WHL_PYTHON_VERSIONS}"
157170
echo "Wheel Platform: ${WHL_PLATFORM}"
158171
echo "UCX Ref: ${UCX_REF}"
172+
echo "Build Type: ${BUILD_TYPE}"
159173
}
160174

161175
show_help() {
@@ -165,6 +179,7 @@ show_help() {
165179
echo " [--wheel-base base platform for wheel builds]"
166180
echo " [--no-cache disable docker build cache]"
167181
echo " [--os [ubuntu24|ubuntu22] to select Ubuntu version]"
182+
echo " [--build-type [debug|release] to select build type (default: release)]"
168183
echo " [--tag tag for image]"
169184
echo " [--python-versions python versions to build for, comma separated]"
170185
echo " [--ucx-upstream use ucx master branch]"
@@ -196,6 +211,7 @@ BUILD_ARGS+=" --build-arg ARCH=$ARCH"
196211
BUILD_ARGS+=" --build-arg UCX_REF=$UCX_REF"
197212
BUILD_ARGS+=" --build-arg NPROC=$NPROC"
198213
BUILD_ARGS+=" --build-arg OS=$OS"
214+
BUILD_ARGS+=" --build-arg BUILD_TYPE=$BUILD_TYPE"
199215

200216
show_build_options
201217

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# limitations under the License.
1515

1616
project('nixl', 'CPP', version: '0.7.1',
17-
default_options: ['buildtype=debug',
17+
default_options: ['buildtype=release',
1818
'werror=true',
1919
'cpp_std=c++17',
2020
'prefix=/opt/nvidia/nvda_nixl'],

src/plugins/gpunetio/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ NIXL bench also has the option to specify the DOCA GPUNetIO backend. An example
5151

5252
## Caveats
5353

54-
By default NIXL is built with `buildtype=debug` option. This is ok for correctness and debugging.
55-
To run for performace (e.g. with NIXL bench) t's hightly recommended to build NIXL with `buildtype=release`.
54+
To run for performance (e.g. with NIXL bench) it's highly recommended to build NIXL with `buildtype=release`.
55+
For debugging purposes, NIXL can be built with `buildtype=debug`.

0 commit comments

Comments
 (0)