Skip to content
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

WIP: [ci] [python-package] add arm64 macOS wheels #6391

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

jameslamb
Copy link
Collaborator

@jameslamb jameslamb commented Mar 29, 2024

Contributes to #5328.

Adds arm64 macOS wheels for the Python package.

Notes for Reviewers

This is not ready for review.

It seems that Azure DevOps does not support arm64 macOS runners... only GitHub Actions: actions/runner-images#8971.

We'll have to build and publish that particular wheel on GitHub Actions.

How I tested this

Get a run ID from CI, looking at the URL.

e.g. for this build: https://github.com/microsoft/LightGBM/actions/runs/8963252466/job/24613276364?pr=6391

the run id is 8963252466.

Then, following https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts?tool=cli, use the GitHub CLI to download the wheels. A fine-grained access token with just read-only permission on Actions should be enough.

From the root of the repo:

rm -rf ./whl-tmp
mkdir -p ./whl-tmp

RUN_ID=8963252466
gh run download \
    --repo microsoft/LightGBM \
    "${RUN_ID}" \
    -n macosx-arm64-wheel \
    --dir ./whl-tmp

Inspected it with pydistcheck.

pydistcheck \
    --inspect ./whl-tmp/lightgbm-4.3.0.99-py3-none-macosx_14_0_arm64.whl
checking './whl-tmp/lightgbm-4.3.0.99-py3-none-macosx_14_0_arm64.whl'
----- package inspection summary -----
file size
  * compressed size: 1.5M
  * uncompressed size: 6.5M
  * compression space saving: 76.7%
contents
  * directories: 0
  * files: 16 (1 compiled)
size by extension
  * .dylib - 6.0M (93.3%)
  * .py - 0.4M (6.4%)
  * no-extension - 21.5K (0.3%)
  * .txt - 9.0B (0.0%)
  * .typed - 0.0B (0.0%)
largest files
  * (6.0M) lightgbm/lib/lib_lightgbm.dylib
  * (0.2M) lightgbm/basic.py
  * (65.4K) lightgbm/dask.py
  * (62.7K) lightgbm/sklearn.py
  * (34.4K) lightgbm/engine.py
------------ check results -----------
errors found while checking: 0

==================== done running pydistcheck ===============

Installed from the wheel (on my M2 mac, using macOS 14.4.1).

pip install \
    --no-deps \
    ./whl-tmp/lightgbm-4.3.0.99-py3-none-macosx_14_0_arm64.whl

Ran some tests.

pytest tests/python_package_test

That failed for that particular run (tests segfault), but just documenting how I'm testing.

@jameslamb jameslamb mentioned this pull request May 1, 2024
30 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant