[CI] Set up CI for Mac M1 (#9699)
This commit is contained in:
parent
791de7789b
commit
5e6cb63a56
@ -23,7 +23,7 @@ Comm::Comm(std::string const& host, std::int32_t port, std::chrono::seconds time
|
||||
retry_{retry},
|
||||
tracker_{host, port, -1},
|
||||
task_id_{std::move(task_id)},
|
||||
loop_{std::make_shared<Loop>(timeout)} {}
|
||||
loop_{std::shared_ptr<Loop>{new Loop{timeout}}} {}
|
||||
|
||||
Result ConnectTrackerImpl(proto::PeerInfo info, std::chrono::seconds timeout, std::int32_t retry,
|
||||
std::string const& task_id, TCPSocket* out, std::int32_t rank,
|
||||
|
||||
8
tests/buildkite/pipeline-mac-m1.yml
Normal file
8
tests/buildkite/pipeline-mac-m1.yml
Normal file
@ -0,0 +1,8 @@
|
||||
steps:
|
||||
- block: ":rocket: Run this test job"
|
||||
if: build.pull_request.id != null || build.branch =~ /^dependabot\//
|
||||
- label: ":macos: Build and Test XGBoost for MacOS M1 with Clang 11"
|
||||
command: "tests/buildkite/test-macos-m1-clang11.sh"
|
||||
key: mac-m1-appleclang11
|
||||
agents:
|
||||
queue: mac-mini-m1
|
||||
33
tests/buildkite/test-macos-m1-clang11.sh
Executable file
33
tests/buildkite/test-macos-m1-clang11.sh
Executable file
@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
source tests/buildkite/conftest.sh
|
||||
|
||||
# Display system info
|
||||
echo "--- Display system information"
|
||||
set -x
|
||||
system_profiler SPSoftwareDataType
|
||||
sysctl -n machdep.cpu.brand_string
|
||||
uname -m
|
||||
set +x
|
||||
|
||||
# Create new Conda env
|
||||
echo "--- Set up Conda env"
|
||||
. $HOME/mambaforge/etc/profile.d/conda.sh
|
||||
. $HOME/mambaforge/etc/profile.d/mamba.sh
|
||||
conda_env=xgboost_dev_$(uuidgen | tr '[:upper:]' '[:lower:]' | tr -d '-')
|
||||
mamba create -y -n ${conda_env} python=3.8
|
||||
conda activate ${conda_env}
|
||||
mamba env update -n ${conda_env} --file tests/ci_build/conda_env/macos_cpu_test.yml
|
||||
|
||||
# Ensure that XGBoost can be built with Clang 11
|
||||
echo "--- Build and Test XGBoost with MacOS M1, Clang 11"
|
||||
set -x
|
||||
LLVM11_PATH=$(brew --prefix llvm\@11)
|
||||
mkdir build
|
||||
pushd build
|
||||
cmake .. -GNinja -DCMAKE_C_COMPILER=${LLVM11_PATH}/bin/clang \
|
||||
-DCMAKE_CXX_COMPILER=${LLVM11_PATH}/bin/clang++ -DGOOGLE_TEST=ON \
|
||||
-DUSE_DMLC_GTEST=ON
|
||||
ninja -v
|
||||
@ -32,11 +32,10 @@ dependencies:
|
||||
- jsonschema
|
||||
- boto3
|
||||
- awscli
|
||||
- py-ubjson
|
||||
- cffi
|
||||
- pyarrow
|
||||
- pyspark>=3.4.0
|
||||
- cloudpickle
|
||||
- pip:
|
||||
- sphinx_rtd_theme
|
||||
- datatable
|
||||
- py-ubjson
|
||||
|
||||
@ -53,7 +53,7 @@ class AllreduceWorker : public WorkerForTest {
|
||||
Context ctx;
|
||||
std::vector<std::uint32_t> data(comm_.World(), 0);
|
||||
data[comm_.Rank()] = ~std::uint32_t{0};
|
||||
auto pcoll = std::make_shared<Coll>();
|
||||
auto pcoll = std::shared_ptr<Coll>{new Coll{}};
|
||||
auto rc = pcoll->Allreduce(&ctx, comm_, EraseType(common::Span{data.data(), data.size()}),
|
||||
ArrayInterfaceHandler::kU4, Op::kBitwiseOR);
|
||||
ASSERT_TRUE(rc.OK()) << rc.Report();
|
||||
|
||||
@ -41,7 +41,7 @@ class LoopTest : public ::testing::Test {
|
||||
rc = pair_.first.NonBlocking(true);
|
||||
ASSERT_TRUE(rc.OK());
|
||||
|
||||
loop_ = std::make_shared<Loop>(timeout);
|
||||
loop_ = std::shared_ptr<Loop>{new Loop{timeout}};
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user