-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Provide binary python package for macOS M1 #5328
Comments
If you use conda install -c conda-forge lightgbm Otherwise, we already have some feature requests for providing binaries for the M1 Macs:
Unfortunately, we're blocked on this until we're able to build and test arm64 wheels on M1 Macs in a free CI service (#4843 (comment)). Without that ability to test, we can't take on this support. |
@jameslamb Hello! |
They are using Which we have been hesitant to rely on in this project because we don't have a way to actually test that wheels produced that way work on a real M1.
It's also possible that LightGBM might not be able to use If you'd like to help with this issue, we're open to proposals and can answer questions as you try to develop. But providing M1 binaries in this project unfortunately won't be as easy as just copying that GitHub Actions config from Otherwise, you can subscribe to this issue for updates. |
@shiyu1994 Github Actions now supports a GitHub-hosted Apple Silicon runner: actions/runner-images#8439 It isn't available for free though. Could you look into getting Microsoft to sponsor such a runner for this project, so we can build Python wheels targeting the M1/M2 Macs? |
Are there any updates for LightGBM to fully work on M1/M2 Macs? From an outsider perspective it's a bit weird that now it looks that the blocking is github actions not been free but both GitHub and LightGBM are Microsoft companies/projects 🤔 |
I have tried several approaches over the last 2 years to get support from Microsoft or GitHub for native M1/M2 macOS builds in this project... so far none of those attenpts have resulted in any financial or development support towards resolving this. I personally have an M2 laptop now (thanks to @guolinke !), so we may give up on native builds and attempt cross-compiling wheels in the near future...at least I'd be able to test them on that laptop. Until then, you will have to continue building from source, and we're here to help with any issues you encounter doing that. |
So sad there hasn't been any financial support from them yet :/ I really appreciate your work and all the time you have put into this! |
@jameslamb thank you for the effort here. Is the issue purely financial? And if you don't mind me asking do you know roughly how much it might cost to add the M1 runners? I am interested to see if I can help find a solution to this. |
@jameslamb You can try FlyCI's M1 and M2 runners. They are on average 2x faster and 2x cheaper than GitHub's AND we have a free tier for OSS projects (see below). Install Instructions
jobs:
ci:
- runs-on: macos-latest
+ runs-on: flyci-macos-large-latest-m1
steps:
- name: 👀 Checkout repo
uses: actions/checkout@v4 500 mins/month Free for Public ReposSince your repo is public, FlyCI offers 500 mins/month of free M1 runner usage with the Don't hesitate to contact us in case the free tier doesn't suit your needs or you experience any issues with the runners. Our team is here to support you! Best Regards, |
No. Even with budget and CI resources, this project is still facing a significant lack of people-hours doing work to move the project forward.
I don't know for sure. Here's what I've seen looking into this:
Thanks very much! I think the best path available to us is to pay for CirrusCI and run a single job there that builds wheels + runs the tests natively on an However... I don't want to wait around any longer not working on this, waiting for financial support. I'd like to focus on improved macOS support in the next release of LightGBM (after v4.3.0) I think LightGBM should pursue cross-compilation. That's what @stephenpardy do you or others from your organization have some capacity to help with adding To start, I'd welcome some help generating a reproducible example for #5269 to help narrow down some of the build issues and to be able to test fixes (even if those fixes are only run interactively on our laptops). |
@radeva thanks very much for your post. I saw a similar on on XGBoost as well (dmlc/xgboost#9570 (comment)). At this time, I don't support adding FlyCI to LightGBM's CI setup. I'm nervous about the security implications of using an externally-provided hosted runner with GitHub Actions. I looked at https://www.flyci.net/ and don't see the things I'd expect from a company that's offering CI services compliant with Apple's licensing terms for offering M1/M2/M3 services, like:
For example
To be clear, I'm not looking for answers to these questions. I am just mentioning some examples of reasons that I am not open to investing this project's maintainers' limited time and attention into using FlyCI at this time. I'd be happy to explore it in the future if some of those things were addressed. |
Thank you @jameslamb for the detailed feedback. We really appreciate it! |
We could look at using cibuildwheel, I've used it in a couple of projects and it's worked great for me. It also allows to customize the build process, for example scikit-learn packages conda's OpenMP for MacOs in their wheels. |
Definitely could be an option! Although I don't think we should resort to bundling and redistributing a copy of OpenMP lightly, as that can cause other portability and legal issues. I don't think we should pursue |
It looks like GitHub is now providing free, GitHub-hosted macOS M1 runners! I'll test that in the next few days 😁 (thanks @leofang for telling me about this 😊 ) |
Well that statement from January turned out to not be true, for most definitions of "next few days" 😬 I am working actively on this now. For anyone subscribed to this issue, please stay subscribed... when we have wheels that I feel are ready, I'll push them to test-PyPI and ask for volunteers to try installing them. |
Just to document: GitHub recently on 2024-04-22 upgraded the GitHub Actions I got the following failure during build time:
Example: https://github.com/jayqi/github-actions-sandbox/actions/runs/8881677094/job/24384594174 Installing OpenMP explicitly beforehand solves the problem, e.g.,
Example: https://github.com/jayqi/github-actions-sandbox/actions/runs/8881677094/job/24384593509 Full job source: https://github.com/jayqi/github-actions-sandbox/blob/bf292c1afd105ce77f4c855893f4d1d1b0e99da9/.github/workflows/lightgbm-macos.yml#L53-L79 Thanks to @jameslamb for helping me debug this offline. |
I just published LightGBM's first arm64 wheels for macOS 😁 To test, install like this: pip install 'lightgbm>=4.4.0'
I'll leave this open for a few days to allow for feedback, in case we've made some mistake and issues are discovered. But I think that as of Thank you all for your patience. We'd welcome contributions in the future if you'd like to come help out some more with LightGBM. |
Awesome, thanks for the hard work!! |
This issue has been automatically closed because it has been awaiting a response for too long. When you have time to to work with the maintainers to resolve this issue, please post a new comment and it will be re-opened. If the issue has been locked for editing by the time you return to it, please open a new issue and reference this one. Thank you for taking the time to improve LightGBM! |
Summary
pip install lightgm
requires building from sources in my MBP (ARM Monterey 12.4), that wasn't the case in my previous MBP (Intel Big Sur). I assume the problem is with the ARM vs Intel part, not the Monterey vs Big Sur one.Motivation
Building from sources requires previous installation of wheel, additional non-python dependencies (cmake) and is slower.
Description
pip install lightgbm
should install binaries OOB.The text was updated successfully, but these errors were encountered: