From 2e3543c04c4b8e475966721ad8570544edd5b470 Mon Sep 17 00:00:00 2001 From: Samuel Johnson Date: Thu, 11 Jan 2024 21:41:18 -0600 Subject: [PATCH 1/5] [cmake] [CUDA] ignore CUDA-specific source files in non-CUDA builds (fixes #6267) (#6268) --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 36ceb22a9725..42183ab4fe5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -428,7 +428,10 @@ file( src/network/*.cpp src/treelearner/*.cpp src/utils/*.cpp -if(USE_CUDA) +) +file( + GLOB + LGBM_CUDA_SOURCES src/treelearner/*.cu src/boosting/cuda/*.cpp src/boosting/cuda/*.cu @@ -442,9 +445,12 @@ if(USE_CUDA) src/io/cuda/*.cpp src/cuda/*.cpp src/cuda/*.cu -endif() ) +if(USE_CUDA) + list(APPEND SOURCES ${LGBM_CUDA_SOURCES}) +endif() + add_library(lightgbm_objs OBJECT ${SOURCES}) if(BUILD_CLI) From ef2a49cd3bc595b55898c626a53c5519b24b5541 Mon Sep 17 00:00:00 2001 From: Dmitry Ulyanov Date: Fri, 12 Jan 2024 19:25:51 +0300 Subject: [PATCH 2/5] [CUDA] Add arch=8.9 to CUDA_ARCHS for RTX 40XX (#6272) --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 42183ab4fe5d..1ff289b9d045 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -215,6 +215,7 @@ if(USE_CUDA) list(APPEND CUDA_ARCHS "8.7") endif() if(CUDA_VERSION VERSION_GREATER_EQUAL "11.8") + list(APPEND CUDA_ARCHS "8.9") list(APPEND CUDA_ARCHS "9.0") endif() list(POP_BACK CUDA_ARCHS CUDA_LAST_SUPPORTED_ARCH) From 255c93b551c13b5d9b0bd8eff83ef828b14b9547 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 16 Jan 2024 21:27:59 -0800 Subject: [PATCH 3/5] [R-package] [ci] remove unnecessary include in linear_tree_learner (fixes #6264) (#6265) --- .ci/install-clang-devel.sh | 71 +++++++++++++++++++++++++++ .github/workflows/r_package.yml | 59 +++++++--------------- src/treelearner/linear_tree_learner.h | 1 - 3 files changed, 90 insertions(+), 41 deletions(-) create mode 100755 .ci/install-clang-devel.sh diff --git a/.ci/install-clang-devel.sh b/.ci/install-clang-devel.sh new file mode 100755 index 000000000000..a175617852c7 --- /dev/null +++ b/.ci/install-clang-devel.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +# [description] +# +# Installs a development version of clang and the other LLVM tools. +# + +set -e -E -u -o pipefail + +CLANG_VERSION=${1} + +apt-get autoremove -y --purge \ + clang-* \ + libclang-* \ + libunwind-* \ + llvm-* + +apt-get update -y +apt-get install --no-install-recommends -y \ + gnupg \ + lsb-release \ + software-properties-common \ + wget + +wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - + +# ref: https://apt.llvm.org/ +add-apt-repository -y "deb http://apt.llvm.org/unstable/ llvm-toolchain main" +add-apt-repository -y "deb-src http://apt.llvm.org/unstable/ llvm-toolchain main" + +apt-get install -y --no-install-recommends \ + clang-${CLANG_VERSION} \ + clangd-${CLANG_VERSION} \ + clang-format-${CLANG_VERSION} \ + clang-tidy-${CLANG_VERSION} \ + clang-tools-${CLANG_VERSION} \ + lldb-${CLANG_VERSION} \ + lld-${CLANG_VERSION} \ + llvm-${CLANG_VERSION}-dev \ + llvm-${CLANG_VERSION}-tools \ + libomp-${CLANG_VERSION}-dev \ + libc++-${CLANG_VERSION}-dev \ + libc++abi-${CLANG_VERSION}-dev \ + libclang-common-${CLANG_VERSION}-dev \ + libclang-${CLANG_VERSION}-dev \ + libclang-cpp${CLANG_VERSION}-dev \ + libunwind-${CLANG_VERSION}-dev + +# overwriting the stuff in /usr/bin is simpler and more reliable than +# updating PATH, LD_LIBRARY_PATH, etc. +cp --remove-destination /usr/lib/llvm-${CLANG_VERSION}/bin/* /usr/bin/ + +# per https://www.stats.ox.ac.uk/pub/bdr/Rconfig/r-devel-linux-x86_64-fedora-clang +# +# clang was built to use libc++: for a version built to default to libstdc++ +# (as shipped by Fedora/Debian/Ubuntu), add -stdlib=libc++ to CXX +# and install the libcxx-devel/libc++-dev package. +mkdir -p "${HOME}/.R" + +cat << EOF > "${HOME}/.R/Makevars" +CXX += -stdlib=libc++ +CXX11 += -stdlib=libc++ +CXX14 += -stdlib=libc++ +CXX17 += -stdlib=libc++ +CXX20 += -stdlib=libc++ +EOF + +echo "" +echo "done installing clang" +clang --version +echo "" diff --git a/.github/workflows/r_package.yml b/.github/workflows/r_package.yml index 4fa7f2ff8683..f154c822ecc6 100644 --- a/.github/workflows/r_package.yml +++ b/.github/workflows/r_package.yml @@ -258,10 +258,21 @@ jobs: cat ./tests.log exit ${exit_code} test-r-debian-clang: - name: r-package (debian, R-devel, clang) + name: r-package (debian, R-devel, clang-${{ matrix.clang-version }}) timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + # list of versions tested in CRAN "Additional Checks": + # https://cran.r-project.org/web/checks/check_issue_kinds.html + clang-version: + - 16 + - 17 + - 18 runs-on: ubuntu-latest container: rhub/debian-clang-devel + env: + DEBIAN_FRONTEND: noninteractive steps: - name: Install Git before checkout shell: bash @@ -276,46 +287,9 @@ jobs: with: fetch-depth: 5 submodules: true - - name: update to clang 15 - shell: bash + - name: install clang run: | - # remove clang stuff that comes installed in the image - apt-get autoremove -y --purge \ - clang-* \ - libclang-* \ - libunwind-* \ - llvm-* - # - # replace it all with clang-15 - apt-get update -y - apt-get install --no-install-recommends -y \ - gnupg \ - lsb-release \ - software-properties-common \ - wget - # - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - - # - add-apt-repository "deb http://apt.llvm.org/unstable/ llvm-toolchain main" - apt-get install -y --no-install-recommends \ - clang-15 \ - clangd-15 \ - clang-format-15 \ - clang-tidy-15 \ - clang-tools-15 \ - lldb-15 \ - lld-15 \ - llvm-15-dev \ - llvm-15-tools \ - libomp-15-dev \ - libc++-15-dev \ - libc++abi-15-dev \ - libclang-common-15-dev \ - libclang-15-dev \ - libclang-cpp15-dev \ - libunwind-15-dev - # overwrite everything in /usr/bin with the new v15 versions - cp --remove-destination /usr/lib/llvm-15/bin/* /usr/bin/ + ./.ci/install-clang-devel.sh ${{ matrix.clang-version }} - name: Install packages and run tests shell: bash run: | @@ -323,6 +297,11 @@ jobs: Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'testthat'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())" sh build-cran-package.sh R CMD check --as-cran --run-donttest lightgbm_*.tar.gz || exit -1 + echo "" + echo "install logs:" + echo "" + cat lightgbm.Rcheck/00install.out + echo "" if grep -q -E "NOTE|WARNING|ERROR" lightgbm.Rcheck/00check.log; then echo "NOTEs, WARNINGs, or ERRORs have been found by R CMD check" exit -1 diff --git a/src/treelearner/linear_tree_learner.h b/src/treelearner/linear_tree_learner.h index 770b18d133e5..e20a80ad42d3 100644 --- a/src/treelearner/linear_tree_learner.h +++ b/src/treelearner/linear_tree_learner.h @@ -5,7 +5,6 @@ #ifndef LIGHTGBM_TREELEARNER_LINEAR_TREE_LEARNER_H_ #define LIGHTGBM_TREELEARNER_LINEAR_TREE_LEARNER_H_ -#include #include #include #include From 2544d1ba64f37fac35b4de3d195a6cc05b5b49f6 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 22 Jan 2024 16:11:10 -0600 Subject: [PATCH 4/5] [ci] fix conda env creation in 'regular' CI job (fixes #6282) (#6283) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: José Morales --- .ci/test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/test.sh b/.ci/test.sh index 472fd7d8c6e5..685d0b87bc00 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -319,9 +319,9 @@ matplotlib.use\(\"Agg\"\)\ jupyter nbconvert --ExecutePreprocessor.timeout=180 --to notebook --execute --inplace *.ipynb || exit -1 # run all notebooks # importing the library should succeed even if all optional dependencies are not present - conda uninstall --force --yes \ + conda uninstall -n $CONDA_ENV --force --yes \ cffi \ - dask \ + dask-core \ distributed \ joblib \ matplotlib \ From 252828fd86627d7405021c3377534d6a8239dd69 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 24 Jan 2024 23:19:42 -0600 Subject: [PATCH 5/5] release v4.3.0 (#6277) --- .appveyor.yml | 2 +- R-package/configure | 18 +++++++++--------- R-package/cran-comments.md | 20 ++++++++++++++++++++ R-package/pkgdown/_pkgdown.yml | 2 +- VERSION.txt | 2 +- python-package/pyproject.toml | 2 +- 6 files changed, 33 insertions(+), 13 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 58a536d17a98..bb0c409f76b7 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,4 +1,4 @@ -version: 4.2.0.99.{build} +version: 4.3.0.{build} image: Visual Studio 2015 platform: x64 diff --git a/R-package/configure b/R-package/configure index 37dfdbfbf6c7..59a0b31a2632 100755 --- a/R-package/configure +++ b/R-package/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for lightgbm 4.2.0.99. +# Generated by GNU Autoconf 2.71 for lightgbm 4.3.0. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -607,8 +607,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='lightgbm' PACKAGE_TARNAME='lightgbm' -PACKAGE_VERSION='4.2.0.99' -PACKAGE_STRING='lightgbm 4.2.0.99' +PACKAGE_VERSION='4.3.0' +PACKAGE_STRING='lightgbm 4.3.0' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1211,7 +1211,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures lightgbm 4.2.0.99 to adapt to many kinds of systems. +\`configure' configures lightgbm 4.3.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1273,7 +1273,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of lightgbm 4.2.0.99:";; + short | recursive ) echo "Configuration of lightgbm 4.3.0:";; esac cat <<\_ACEOF @@ -1341,7 +1341,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -lightgbm configure 4.2.0.99 +lightgbm configure 4.3.0 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1378,7 +1378,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by lightgbm $as_me 4.2.0.99, which was +It was created by lightgbm $as_me 4.3.0, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -2454,7 +2454,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by lightgbm $as_me 4.2.0.99, which was +This file was extended by lightgbm $as_me 4.3.0, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -2509,7 +2509,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -lightgbm config.status 4.2.0.99 +lightgbm config.status 4.3.0 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff --git a/R-package/cran-comments.md b/R-package/cran-comments.md index 80f84b924a48..91b33f135e1a 100644 --- a/R-package/cran-comments.md +++ b/R-package/cran-comments.md @@ -1,5 +1,25 @@ # CRAN Submission History +## v4.3.0 - Submission 1 - (January 18, 2024) + +### CRAN response + +Accepted to CRAN + +### Maintainer Notes + +This submission was put up in response to CRAN saying the package would be archived if the following +warning was not fixed within 14 days. + +```text +/usr/local/clang-trunk/bin/../include/c++/v1/__fwd/string_view.h:22:41: +warning: 'char_traits' is deprecated: +char_traits for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. +It will be removed in LLVM 19, so please migrate off of it. [-Wdeprecated-declarations] +``` + +See https://github.com/microsoft/LightGBM/issues/6264. + ## v4.2.0 - Submission 1 - (December 7, 2023) ### CRAN response diff --git a/R-package/pkgdown/_pkgdown.yml b/R-package/pkgdown/_pkgdown.yml index 99a3b1010d41..1951ebc222ae 100644 --- a/R-package/pkgdown/_pkgdown.yml +++ b/R-package/pkgdown/_pkgdown.yml @@ -14,7 +14,7 @@ repo: user: https://github.com/ development: - mode: unreleased + mode: release authors: Yu Shi: diff --git a/VERSION.txt b/VERSION.txt index 67dae3929837..80895903a15c 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -4.2.0.99 +4.3.0 diff --git a/python-package/pyproject.toml b/python-package/pyproject.toml index d5586aa3857d..3cb9cdf34058 100644 --- a/python-package/pyproject.toml +++ b/python-package/pyproject.toml @@ -30,7 +30,7 @@ maintainers = [ name = "lightgbm" readme = "README.rst" requires-python = ">=3.6" -version = "4.2.0.99" +version = "4.3.0" [project.optional-dependencies] arrow = [