[CI] Use native arm64 worker in GHAction to build M1 wheel (#10225)

* [CI] Use native arm64 worker in GHAction to build M1 wheel

* Set up Conda

* Use mamba

* debug

* fix

* fix

* fix

* fix

* fix

* Temporarily disable other tests

* Fix prefix

* Use micromamba

* Use conda-incubator/setup-miniconda

* Use mambaforge

* Fix

* Fix prefix

* Don't use deprecated set-output

* Add verbose output from build

* verbose

* Specify arch

* Bump setup-miniconda to v3

* Use Python 3.9

* Restore deleted files

* WAR.

---------

Co-authored-by: Jiaming Yuan <jm.yuan@outlook.com>
This commit is contained in:
Philip Hyunsu Cho
2024-04-26 10:16:55 -07:00
committed by GitHub
parent a81b78e56b
commit edb945d59b
4 changed files with 25 additions and 25 deletions

View File

@@ -25,16 +25,16 @@ if [[ "$platform_id" == macosx_* ]]; then
# arm64 builds must cross compile because CI is on x64
# cibuildwheel will take care of cross-compilation.
wheel_tag=macosx_12_0_arm64
cpython_ver=38
setup_env_var='CIBW_TARGET_OSX_ARM64=1' # extra flag to be passed to xgboost.packager backend
export PYTHON_CROSSENV=1
cpython_ver=39
cibw_archs=arm64
export MACOSX_DEPLOYMENT_TARGET=12.0
#OPENMP_URL="https://anaconda.org/conda-forge/llvm-openmp/11.1.0/download/osx-arm64/llvm-openmp-11.1.0-hf3c4609_1.tar.bz2"
OPENMP_URL="https://xgboost-ci-jenkins-artifacts.s3.us-west-2.amazonaws.com/llvm-openmp-11.1.0-hf3c4609_1-osx-arm64.tar.bz2"
elif [[ "$platform_id" == macosx_x86_64 ]]; then
# MacOS, Intel
wheel_tag=macosx_10_15_x86_64.macosx_11_0_x86_64.macosx_12_0_x86_64
cpython_ver=38
cpython_ver=39
cibw_archs=x86_64
export MACOSX_DEPLOYMENT_TARGET=10.15
#OPENMP_URL="https://anaconda.org/conda-forge/llvm-openmp/11.1.0/download/osx-64/llvm-openmp-11.1.0-hda6cdc1_1.tar.bz2"
OPENMP_URL="https://xgboost-ci-jenkins-artifacts.s3.us-west-2.amazonaws.com/llvm-openmp-11.1.0-hda6cdc1_1-osx-64.tar.bz2"
@@ -44,13 +44,13 @@ if [[ "$platform_id" == macosx_* ]]; then
fi
# Set up environment variables to configure cibuildwheel
export CIBW_BUILD=cp${cpython_ver}-${platform_id}
export CIBW_ARCHS=all
export CIBW_ARCHS=${cibw_archs}
export CIBW_ENVIRONMENT=${setup_env_var}
export CIBW_TEST_SKIP='*-macosx_arm64'
export CIBW_BUILD_VERBOSITY=3
sudo conda create -n build $OPENMP_URL
PREFIX="/usr/local/miniconda/envs/build"
mamba create -n build $OPENMP_URL
PREFIX="$HOME/miniconda3/envs/build"
# Set up build flags for cibuildwheel
# This is needed to bundle libomp lib we downloaded earlier

View File

@@ -113,8 +113,8 @@ def run_with_dask_array(DMatrixT: Type, client: Client) -> None:
cp.cuda.runtime.setDevice(0)
X, y, _ = generate_array()
X = X.map_blocks(cp.asarray)
y = y.map_blocks(cp.asarray)
X = X.map_blocks(cp.asarray) # type: ignore
y = y.map_blocks(cp.asarray) # type: ignore
dtrain = DMatrixT(client, X, y)
out = dxgb.train(
client,
@@ -648,8 +648,8 @@ async def run_from_dask_array_asyncio(scheduler_address: str) -> dxgb.TrainRetur
import cupy as cp
X, y, _ = generate_array()
X = X.map_blocks(cp.array)
y = y.map_blocks(cp.array)
X = X.map_blocks(cp.array) # type: ignore
y = y.map_blocks(cp.array) # type: ignore
m = await xgb.dask.DaskQuantileDMatrix(client, X, y)
output = await xgb.dask.train(