feat(toolchain): support freethreaded toolchains#2372
feat(toolchain): support freethreaded toolchains#2372aignas merged 27 commits intobazel-contrib:mainfrom
Conversation
|
Seems like this PR is working to build XLA with Python free-threading using the following command: bazel build \
--@rules_python//python/config_settings:py_freethreaded="yes" \
--define=use_enabled_free_threading=true \
--test_output=all --spawn_strategy=sandboxed \
--override_repository=rules_python=/rules_python \
//xla/...It downloads however two versions of python: I assume that free-threaded version is used for building python extensions... |
|
@vfdev-5, I am not fully sure about why you have the toolchain in your cache. Could you please check it with |
|
In my tests I deleted completely the cache and run xla build from the very beginning. In the console I saw it downloading python for platform |
aignas
left a comment
There was a problem hiding this comment.
Done with the self-review.
rickeylev
left a comment
There was a problem hiding this comment.
So if I remember the toolchain generation logic, then all one has to do is set the flag, and it'll trigger downloading and usage of the free-threaded interpreter?
Otherwise just some small comments, LGTM
| # Unused shared libraries. `python` executable and the `:libpython` target | ||
| # depend on `libpython{python_version}.so.1.0`. | ||
| "lib/libpython{major}.{minor}.so".format(**version_dict), | ||
| "lib/libpython{major}.{minor}*.so".format(**version_dict), |
There was a problem hiding this comment.
Just checking/curious: I'm guessing the libX.Y* pattern works because the extracted standalone interpreters only contain appropriately relevant .so files?
There was a problem hiding this comment.
This is for exclusion, that is why libX.Y*.so is just as good as libX.Y.so.
Before this PR freethreaded toolchains were not possible to be used,
this adds the minimum plumbing to get the things working. Coverage
support is also added.
Whilst at it:
Tested:
Closes #2129.
Work towards #2386.