-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CI] Build a CPU-only wheel under name xgboost-cpu
#10603
Merged
Merged
Changes from 12 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ef77a68
Simplify build-manylinux2014 script
hcho3 9212e1c
Mark the script as executable
hcho3 edfcc5e
Fix i386
hcho3 7eb15fb
Try building xgboost-cpu
hcho3 3a41d45
Fix patch
hcho3 09dcdac
Fix
hcho3 394c599
Fix
hcho3 3e66f50
Remove dupe wheel
hcho3 fc509d5
Merge branch 'master' into cpu_only_pkg
hcho3 922dcbf
Merge branch 'master' into cpu_only_pkg
hcho3 7876a45
Re-order fields in pyproject.toml, to minimize diff
hcho3 f5ec1fb
Refine patch
hcho3 8018e7f
Refine patch
hcho3 7b2b25d
Refine patch
hcho3 001cdc2
Split patch
hcho3 91c9d2e
Remove NCCL dep from sdist
hcho3 f8e6a6d
Update README.rst for xgboost-cpu wheel
hcho3 ac2bdfd
Update install doc
hcho3 0c0009b
Remove commented lines
hcho3 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,13 +7,13 @@ build-backend = "packager.pep517" | |
|
||
[project] | ||
name = "xgboost" | ||
version = "2.2.0-dev" | ||
description = "XGBoost Python Package" | ||
readme = { file = "README.rst", content-type = "text/x-rst" } | ||
authors = [ | ||
{ name = "Hyunsu Cho", email = "[email protected]" }, | ||
{ name = "Jiaming Yuan", email = "[email protected]" } | ||
] | ||
description = "XGBoost Python Package" | ||
readme = { file = "README.rst", content-type = "text/x-rst" } | ||
version = "2.2.0-dev" | ||
requires-python = ">=3.8" | ||
license = { text = "Apache-2.0" } | ||
classifiers = [ | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
if [ $# -ne 1 ]; then | ||
echo "Usage: $0 {x86_64,aarch64}" | ||
exit 1 | ||
fi | ||
|
||
arch=$1 | ||
|
||
source tests/buildkite/conftest.sh | ||
|
||
WHEEL_TAG="manylinux2014_${arch}" | ||
command_wrapper="tests/ci_build/ci_build.sh ${WHEEL_TAG}" | ||
python_bin="/opt/python/cp310-cp310/bin/python" | ||
|
||
echo "--- Build binary wheel for ${WHEEL_TAG}" | ||
# Patch to add warning about manylinux2014 variant | ||
patch -p0 < tests/buildkite/manylinux2014_warning.patch | ||
$command_wrapper bash -c \ | ||
"cd python-package && ${python_bin} -m pip wheel --no-deps -v . --wheel-dir dist/" | ||
git checkout python-package/pyproject.toml python-package/xgboost/core.py # discard the patch | ||
|
||
$command_wrapper auditwheel repair --plat ${WHEEL_TAG} python-package/dist/*.whl | ||
$command_wrapper ${python_bin} tests/ci_build/rename_whl.py \ | ||
--wheel-path wheelhouse/*.whl \ | ||
--commit-hash ${BUILDKITE_COMMIT} \ | ||
--platform-tag ${WHEEL_TAG} | ||
rm -rf python-package/dist/ | ||
mkdir python-package/dist/ | ||
mv -v wheelhouse/*.whl python-package/dist/ | ||
|
||
echo "--- Build binary wheel for ${WHEEL_TAG} (CPU only)" | ||
patch -p0 < tests/buildkite/cpu_only_pypkg.patch | ||
$command_wrapper bash -c \ | ||
"cd python-package && ${python_bin} -m pip wheel --no-deps -v . --wheel-dir dist/" | ||
git checkout python-package/pyproject.toml # discard the patch | ||
|
||
$command_wrapper auditwheel repair --plat ${WHEEL_TAG} python-package/dist/xgboost_cpu-*.whl | ||
$command_wrapper ${python_bin} tests/ci_build/rename_whl.py \ | ||
--wheel-path wheelhouse/xgboost_cpu-*.whl \ | ||
--commit-hash ${BUILDKITE_COMMIT} \ | ||
--platform-tag ${WHEEL_TAG} | ||
rm -v python-package/dist/xgboost_cpu-*.whl | ||
mv -v wheelhouse/xgboost_cpu-*.whl python-package/dist/ | ||
|
||
echo "--- Upload Python wheel" | ||
for wheel in python-package/dist/*.whl | ||
do | ||
buildkite-agent artifact upload "${wheel}" | ||
done | ||
# if [[ ($is_pull_request == 0) && ($is_release_branch == 1) ]] | ||
# then | ||
for wheel in python-package/dist/*.whl | ||
do | ||
aws s3 cp "${wheel}" s3://xgboost-nightly-builds/${BRANCH_NAME}/ \ | ||
--acl public-read --no-progress | ||
done | ||
# fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
diff --git python-package/pyproject.toml python-package/pyproject.toml | ||
index 8835def25..b9cbebe11 100644 | ||
--- python-package/pyproject.toml | ||
+++ python-package/pyproject.toml | ||
@@ -6,7 +6,7 @@ backend-path = ["."] | ||
build-backend = "packager.pep517" | ||
|
||
[project] | ||
-name = "xgboost" | ||
+name = "xgboost-cpu" | ||
description = "XGBoost Python Package" | ||
readme = { file = "README.rst", content-type = "text/x-rst" } | ||
authors = [ | ||
@@ -30,8 +30,7 @@ classifiers = [ | ||
] | ||
dependencies = [ | ||
"numpy", | ||
- "scipy", | ||
- "nvidia-nccl-cu12 ; platform_system == 'Linux' and platform_machine != 'aarch64'" | ||
+ "scipy" | ||
] | ||
|
||
[project.urls] | ||
@@ -48,6 +47,9 @@ pyspark = ["pyspark", "scikit-learn", "cloudpickle"] | ||
|
||
[tool.hatch.build.targets.wheel.hooks.custom] | ||
|
||
+[tool.hatch.build.targets.wheel] | ||
+packages = ["xgboost/"] | ||
+ | ||
[tool.isort] | ||
profile = "black" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving this line here, so that the patch
cpu_only_pypkg.patch
doesn't contain the version number.