-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Switched to static linking of llvm #100
base: main
Are you sure you want to change the base?
Conversation
@conda-forge-admin, please rerender |
Hi! This is the friendly automated conda-forge-linting service. I just wanted to let you know that I linted all conda-recipes in your PR ( |
ppc64le still broken, will look into it |
build works locally on cross-compile and goes further than action runner. Test fail (as expected) due to invalid binary format. |
I will try to dynamic link on ppc64le still. I think the native build has issues. The local crossbuild on my machine works though, but I don't want to sacrifice the tests, which I would need to do, if I let the github runner build on linux64. Reverted the PR to draft, because there will be some noise. |
@conda-forge-admin, please rerender |
Hi! This is the friendly automated conda-forge-webservice. I tried to rerender for you, but it looks like there was nothing to do. This message was generated by GitHub Actions workflow run https://github.com/conda-forge/conda-forge-webservices/actions/runs/13329229741. Examine the logs at this URL for more detail. |
05f65d3
to
7673ab6
Compare
…nda-forge-pinning 2025.02.12.20.08.11
7673ab6
to
2a97a9a
Compare
@jakirkham : This is now ready for review. ppc64le still builds shared, because I was unable to static link on a native ppc64le platform. |
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.
As already discussed at length previously ( #73 ), will not be accepting a change to static linking
Think we need to find a better way to address the issue users are encountering. One avenue may be changing the linker flags (stripping, symbol visibility, etc.)
My analysis showed that the cause of the issue might not be in llvmlite, so changing the flags here won't change much. The issue is that libllvm15 links into libllvm19, so I presume the right place for a fix is there. If my analysis is right libllvm15 should be in conflict with libllvm19, as it is not safe to have both in the same environment. Until this fix is found it is desastrous for the conda-forge ecosystem not to provide a workaround. Currently not merging this means that people using pytorch and numba in the same conda environment either
numba and pytorch is a very common combination. Therefore: Please reconsider merging this. It can be reverted once the issue is solved. |
Also in #73 you write: Not following the argument for static linking" The reason this is working is only because numba and pytorch-cuda required the same libllvm version at this precise time. When libllvm14 was used by llvmlite and libllvm15 was used by pytorch-cuda, it broke. Now the same thing happens with libllvm15 and 19. |
Pity you did not respond on the thread I opened in the core channel. I will bring this to a vote within core. |
If this is indeed an LLVM issue, let's file on that feedstock. If there was already an issue filed and it was closed prematurely, am happy to reopen (provided a link) |
This is the issue I opened on the llvm-dev feedstock: conda-forge/llvmdev-feedstock#312 |
I am happy to take on the maintenance burden of pushing updates to the llvm versions for static linking if that helps unblock this. |
OK friends. I have another idea on how to ease the maintenance burden of static linking so we can unblock this PR. I have added a new feature to the bot in this PR: regro/cf-scripts#3755. It allows the bot to update static libs according to an abstract spec as follows. In the extra:
static_linking_host_requirements:
- llvmdev 15.*
- llvm 15.* This specifies the abstract requirements for the static library you want in host. Then in your recipe, you list the exact packages you care about like this requirements:
host:
- python
- setuptools
- llvmdev 15.0.7 h2621b3d_4 # [osx and arm64]
- llvm 15.0.7 h4a7a88c_4 # [osx and arm64]
- llvmdev 15.0.7 hbedff68_4 # [osx and x86]
- llvm 15.0.7 hed0f868_4 # [osx and x86] The bot then does the following computation:
The result of this is an update to the host section like this: requirements:
host:
- python
- setuptools
- llvmdev 15.0.7 h4429f82_5 # [osx and arm64]
- llvm 15.0.7 h0cf516b_5 # [osx and arm64]
- llvmdev 15.0.7 hc29ff6c_5 # [osx and x86]
- llvm 15.0.7 hb21d583_5 # [osx and x86]
- zlib
- vs2015_runtime # [win] The bot stores the new static lib versions it used to update the feedstock as part of the PR info it has. This should prevent it from issuing duplicate PRs. Further, by bailing if not all of the versions+build numbers of the new static libs match, we should prevent PRs being issued in the middle of a build of the static libs on the backend. Finally, by restricting the search for updates to the static libs to the abstract specs in extra, the bot will only issue an update for increases in minor+patch versions and/or build numbers in the say If this is of interest to you all, let me know and I can finish up the bot PR, make a PR to this feedstock, and we can start trying it out. cc @isuruf @h-vetinari @jakirkham @conda-forge/llvmlite |
Thank you for trying to find a solution on this @beckermr! I'm fine with whatever setup that lets us get rid of the segfaults. To me the |
Let's move it to Can we also use something like - llvmdev 15.0.7 *_5
- llvm 15.0.7 *_5 instead to make it human updateable too? |
I'm not in favor of moving it to the bot section because then the recipe is not self-contained. Happy to make the changes on the hash. |
What do you mean by this? |
I mean when people look at the recipe, they won't see any hints/info on what exactly is going on in host if the abstract requirements are in a entirely separate file. At least by having the abstract requirements in the extra section of the same file, there is a clue that something different is going on. Also, that section gets imbedded in the final artifact which has additional advantages. |
You'd already have
which tells anyone looking at the recipe what is going on. |
No it does not. There is missing information as follows. The spec
The contents in |
Globs in the hash part of the build string are now working. The bot will use a glob if the recipe previously had one. Otherwise it will use the exact pin. |
We don't even have the pinnings from conda-forge-pinning in the recipe, so I don't see why we need to have it in the recipe explicitly here. |
We could also have
and have a migrator. This should make it work just like other migrators. |
It goes beyond this. With only the semi-exact pin (e.g., Assuming only the major version matters works for this feedstock, but won't work in general.
The migrator idea suffers from the same issue. The pinnings would need to list the exact package spec (eg For ABI migrations, the bot checks if the latest version of the package is outside the version range of the current pin. That won't work here since we want updates within a specific version series. So TL;DR; without something specifying that we want the latest package within |
Here is another idea for the API. We put a key in the bot:
update_static_libs: true and then in
The bot would know the difference between the "abstract" versus "pinned" requirement by the presence or absence of a full build string and/or a build number at the end of the build string. The trade-off here is between being explicit versus laundering information in the extra section. Neither is perfect, but we might prefer one over the other. |
I like this idea. |
Ok. The bot is ready, pending review and merge of the PR. Shall we proceed? |
@conda-forge-admin rerender |
@conda-forge-admin rerender |
…nda-forge-pinning 2025.02.27.07.39.47
Hi! This is the friendly automated conda-forge-linting service. I wanted to let you know that I linted all conda-recipes in your PR ( Here's what I've got... For recipe/meta.yaml:
This message was generated by GitHub Actions workflow run https://github.com/conda-forge/conda-forge-webservices/actions/runs/13569596802. Examine the logs at this URL for more detail. |
@isuruf ppc64le is not statically linked in these builds due to some error @timostrunk had when they tried above. |
PR to fix the linter: conda-forge/conda-smithy#2253 |
OK. This one is all green or will be soon. I do not want to merge when another maintainer has requested changes. @jakirkham Can you look at what we've done here and reconsider your review possibly? We've enabled fully automatic updates via the bot and I've added myself to the feedstock to manage things around that as I expect we'll encounter a few bugs along the way. |
I switched to static linking of libllvm here and added it to the ignore_run_exports on unix. I did not change the build behaviour on Windows as it seems to already build with default settings there and I have no means to test it.
This fixes #99 and #84.
Reasons against this PR:
Reasons to merge this PR:
Checklist
0
(if the version changed)conda-smithy
(Use the phrase@conda-forge-admin, please rerender
in a comment in this PR for automated rerendering)