From 02a0575a85aafce1ca908edf563b5b68b0d487ee Mon Sep 17 00:00:00 2001 From: Aman Surkar <99606590+Aman-Surkar@users.noreply.github.com> Date: Tue, 9 Jan 2024 09:08:44 +0530 Subject: [PATCH] Refreshed to 2.0.3 (#59) --- config/build-config.yaml | 4 +- config/conda_build_config.yaml | 6 --- ...da-Unbundle-libxgboost.-dll-dylib-so.patch | 15 ------- .../0004-Use-central-cuda-capabilities.patch | 40 ------------------- .../0001-Use-central-cuda-capabilities.patch | 26 ++++++++++++ ...da-Unbundle-libxgboost.-dll-dylib-so.patch | 27 +++++++++++++ .../recipe/0002-Fix-R-package-PKGROOT.patch | 0 .../recipe/install-libxgboost.sh | 0 .../recipe/install-py-xgboost.sh | 7 +++- {xgboost-1.7 => xgboost-2.0}/recipe/meta.yaml | 4 +- .../recipe/test-py-xgboost.py | 0 11 files changed, 63 insertions(+), 66 deletions(-) delete mode 100644 config/conda_build_config.yaml delete mode 100644 xgboost-1.7/recipe/0001-conda-Unbundle-libxgboost.-dll-dylib-so.patch delete mode 100644 xgboost-1.7/recipe/0004-Use-central-cuda-capabilities.patch create mode 100644 xgboost-2.0/recipe/0001-Use-central-cuda-capabilities.patch create mode 100644 xgboost-2.0/recipe/0001-conda-Unbundle-libxgboost.-dll-dylib-so.patch rename {xgboost-1.7 => xgboost-2.0}/recipe/0002-Fix-R-package-PKGROOT.patch (100%) rename {xgboost-1.7 => xgboost-2.0}/recipe/install-libxgboost.sh (100%) rename {xgboost-1.7 => xgboost-2.0}/recipe/install-py-xgboost.sh (77%) rename {xgboost-1.7 => xgboost-2.0}/recipe/meta.yaml (98%) rename {xgboost-1.7 => xgboost-2.0}/recipe/test-py-xgboost.py (100%) diff --git a/config/build-config.yaml b/config/build-config.yaml index fa219fe..3caa7ce 100644 --- a/config/build-config.yaml +++ b/config/build-config.yaml @@ -1,4 +1,4 @@ recipes: - - name : xgboost-1.7 - path : xgboost-1.7/recipe + - name : xgboost-2.0 + path : xgboost-2.0/recipe diff --git a/config/conda_build_config.yaml b/config/conda_build_config.yaml deleted file mode 100644 index 3577128..0000000 --- a/config/conda_build_config.yaml +++ /dev/null @@ -1,6 +0,0 @@ -c_compiler_version: - - 8.4.0 # [x86_64 and cudatoolkit == '11.2'] - - 8.2.0 # [ppc64le and cudatoolkit == '11.2'] -cxx_compiler_version: - - 8.4.0 # [x86_64 and cudatoolkit == '11.2'] - - 8.2.0 # [ppc64le and cudatoolkit == '11.2'] diff --git a/xgboost-1.7/recipe/0001-conda-Unbundle-libxgboost.-dll-dylib-so.patch b/xgboost-1.7/recipe/0001-conda-Unbundle-libxgboost.-dll-dylib-so.patch deleted file mode 100644 index db3d9e5..0000000 --- a/xgboost-1.7/recipe/0001-conda-Unbundle-libxgboost.-dll-dylib-so.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/python-package/xgboost/libpath.py b/python-package/xgboost/libpath.py -index 8ca53fa..9b43213 100644 ---- a/python-package/xgboost/libpath.py -+++ b/python-package/xgboost/libpath.py -@@ -30,6 +30,10 @@ def find_lib_path(): - ] - - if sys.platform == 'win32': -+ dll_path = [os.path.join(sys.prefix, 'Library', 'mingw-w64', 'bin')] -+ else: -+ dll_path = [os.path.join(sys.prefix, 'lib')] -+ if sys.platform == 'win32': - if platform.architecture()[0] == '64bit': - dll_path.append( - os.path.join(curr_path, '../../windows/x64/Release/')) diff --git a/xgboost-1.7/recipe/0004-Use-central-cuda-capabilities.patch b/xgboost-1.7/recipe/0004-Use-central-cuda-capabilities.patch deleted file mode 100644 index 401cc5c..0000000 --- a/xgboost-1.7/recipe/0004-Use-central-cuda-capabilities.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 674b1e1eafd3ddbcabbd990d7da3c82eb539d851 Mon Sep 17 00:00:00 2001 -From: Deepali Chourasia -Date: Tue, 8 Nov 2022 07:44:57 +0000 -Subject: [PATCH] use centralized cuda capabilities - ---- - cmake/Utils.cmake | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake -index f28c1f27..f0b6f1b2 100644 ---- a/cmake/Utils.cmake -+++ b/cmake/Utils.cmake -@@ -90,8 +90,13 @@ function(format_gencode_flags flags out) - endif() - # Set up architecture flags - if(NOT flags) -- if (CUDA_VERSION VERSION_GREATER_EQUAL "11.1") -- set(flags "50;60;70;80") -+ if (CUDA_VERSION VERSION_GREATER_EQUAL "11.4") -+ string(REPLACE "," ";" tmpflags "$ENV{cuda_levels}") -+ string(REPLACE "." "" flags "${tmpflags}") -+ elseif (CUDA_VERSION VERSION_GREATER_EQUAL "11.1") -+ #set(flags "52;60;61;70;75;80;86") -+ string(REPLACE "," ";" tmpflags "$ENV{cuda_levels}") -+ string(REPLACE "." "" flags "${tmpflags};8.6") - elseif (CUDA_VERSION VERSION_GREATER_EQUAL "11.0") - set(flags "50;60;70;80") - elseif(CUDA_VERSION VERSION_GREATER_EQUAL "10.0") -@@ -101,6 +106,7 @@ function(format_gencode_flags flags out) - else() - set(flags "35;50;60") - endif() -+ message(STATUS "Using Open-CE Centralized CUDA Capabilities: ${flags}") - endif() - - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.18") --- -2.34.1 - diff --git a/xgboost-2.0/recipe/0001-Use-central-cuda-capabilities.patch b/xgboost-2.0/recipe/0001-Use-central-cuda-capabilities.patch new file mode 100644 index 0000000..6db533a --- /dev/null +++ b/xgboost-2.0/recipe/0001-Use-central-cuda-capabilities.patch @@ -0,0 +1,26 @@ +From f93655fdf7ea1bc125c6e943399c7ee7ecbb5d3c Mon Sep 17 00:00:00 2001 +From: Aman-Surkar +Date: Mon, 8 Jan 2024 12:59:09 +0000 +Subject: [PATCH] Use-central-cuda-capabilities + +--- + cmake/Utils.cmake | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake +index 08050205c..700bf86b0 100644 +--- a/cmake/Utils.cmake ++++ b/cmake/Utils.cmake +@@ -91,7 +91,8 @@ function(format_gencode_flags flags out) + # Set up architecture flags + if(NOT flags) + if (CUDA_VERSION VERSION_GREATER_EQUAL "11.8") +- set(flags "50;60;70;80;90") ++ string(REPLACE "," ";" tmpflags "$ENV{cuda_levels}") ++ string(REPLACE "." "" flags "${tmpflags}") + elseif (CUDA_VERSION VERSION_GREATER_EQUAL "11.0") + set(flags "50;60;70;80") + elseif(CUDA_VERSION VERSION_GREATER_EQUAL "10.0") +-- +2.40.1 + diff --git a/xgboost-2.0/recipe/0001-conda-Unbundle-libxgboost.-dll-dylib-so.patch b/xgboost-2.0/recipe/0001-conda-Unbundle-libxgboost.-dll-dylib-so.patch new file mode 100644 index 0000000..b20d305 --- /dev/null +++ b/xgboost-2.0/recipe/0001-conda-Unbundle-libxgboost.-dll-dylib-so.patch @@ -0,0 +1,27 @@ +From fe9487352675c8b0be26f30be9e9e2af0c103fab Mon Sep 17 00:00:00 2001 +From: Aman-Surkar +Date: Mon, 8 Jan 2024 13:00:50 +0000 +Subject: [PATCH] conda-Unbundle-libxgboost.-dll-dylib-so + +--- + python-package/xgboost/libpath.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/python-package/xgboost/libpath.py b/python-package/xgboost/libpath.py +index 58c78df09..bb682b929 100644 +--- a/python-package/xgboost/libpath.py ++++ b/python-package/xgboost/libpath.py +@@ -31,6 +31,10 @@ def find_lib_path() -> List[str]: + ] + + if sys.platform == "win32": ++ dll_path = [os.path.join(sys.prefix, 'Library', 'mingw-w64', 'bin')] ++ else: ++ dll_path = [os.path.join(sys.prefix, 'lib')] ++ if sys.platform == 'win32': + # On Windows, Conda may install libs in different paths + dll_path.extend( + [ +-- +2.40.1 + diff --git a/xgboost-1.7/recipe/0002-Fix-R-package-PKGROOT.patch b/xgboost-2.0/recipe/0002-Fix-R-package-PKGROOT.patch similarity index 100% rename from xgboost-1.7/recipe/0002-Fix-R-package-PKGROOT.patch rename to xgboost-2.0/recipe/0002-Fix-R-package-PKGROOT.patch diff --git a/xgboost-1.7/recipe/install-libxgboost.sh b/xgboost-2.0/recipe/install-libxgboost.sh similarity index 100% rename from xgboost-1.7/recipe/install-libxgboost.sh rename to xgboost-2.0/recipe/install-libxgboost.sh diff --git a/xgboost-1.7/recipe/install-py-xgboost.sh b/xgboost-2.0/recipe/install-py-xgboost.sh similarity index 77% rename from xgboost-1.7/recipe/install-py-xgboost.sh rename to xgboost-2.0/recipe/install-py-xgboost.sh index 3a46277..41ef7d5 100644 --- a/xgboost-1.7/recipe/install-py-xgboost.sh +++ b/xgboost-2.0/recipe/install-py-xgboost.sh @@ -18,5 +18,10 @@ . activate "${PREFIX}" pushd ${SRC_DIR}/python-package - ${PYTHON} setup.py install --single-version-externally-managed --record=record.txt + if [[ $build_type == "cuda" ]] + then + ${PYTHON} -m pip install -v . --no-deps --ignore-installed --config-settings use_cuda=True --config-settings use_nccl=True + else + ${PYTHON} -m pip install -v . --no-deps --ignore-installed + fi popd diff --git a/xgboost-1.7/recipe/meta.yaml b/xgboost-2.0/recipe/meta.yaml similarity index 98% rename from xgboost-1.7/recipe/meta.yaml rename to xgboost-2.0/recipe/meta.yaml index 407af8d..0af5269 100644 --- a/xgboost-1.7/recipe/meta.yaml +++ b/xgboost-2.0/recipe/meta.yaml @@ -1,5 +1,5 @@ # Builds the CPU and CUDA variants of libxgboost and xgboost packages -{% set version = "1.7.6" %} +{% set version = "2.0.3" %} {% set build_ext_version = version %} {% set proc_build_number = "1" %} @@ -16,7 +16,7 @@ source: # xgboost patches - 0001-conda-Unbundle-libxgboost.-dll-dylib-so.patch - 0002-Fix-R-package-PKGROOT.patch - - 0004-Use-central-cuda-capabilities.patch #[build_type == 'cuda'] + - 0001-Use-central-cuda-capabilities.patch #[build_type == 'cuda'] build: number: 1 diff --git a/xgboost-1.7/recipe/test-py-xgboost.py b/xgboost-2.0/recipe/test-py-xgboost.py similarity index 100% rename from xgboost-1.7/recipe/test-py-xgboost.py rename to xgboost-2.0/recipe/test-py-xgboost.py