[BUILD] Use build-system requires to install pybind11#4450
[BUILD] Use build-system requires to install pybind11#4450ThomasRaoux merged 1 commit intotriton-lang:mainfrom
Conversation
|
CC @SomeoneSerge |
|
I wonder why we didn't adopt this approach? Seems like pybind11 has been available on pypi for a long time @ThomasRaoux @ptillet |
|
I wondered that, too, @Jokeren . The old approach probably worked fine for you and you never ran into problems. I'm working on downstream packaging of the Python deep learning and AI stack for Fedora ecosystem. Just like nixOS, we have to generate packages from offline artifacts and without any access to the internet. It's part of our supply chain security and reproducible build policy. Triton is a ... challenge. I had a bunch of downstream patches. #4414 got rid of several patches. This PR is another low-hanging fruit from my patch set. |
|
Thanks @tiran. Indeed we'd benefit from this patch too, our current PR works around the pybind11 situation in a very ad hoc way |
2f41196 to
fae93cb
Compare
fae93cb to
6e37f2f
Compare
|
@Jokeren @ThomasRaoux @ptillet please take a look again and approve CI run. |
|
@tiran see the installation problem on mac |
`pybind11` is now a build-system requirement. The package is no longer
downloaded in `setup.py`. Instead the build system automatically
installs the build dependency `pybind11` before it runs `setup.py`. This
simplifies offline builds and makes the build requirement visible in
standard packaging tools.
I kept support support for `PYBIND11_SYSPATH`. The code can be
simplified even more if the feature is no longer needed:
```python
cmake_args = [
...
f"-DPYBIND11_INCLUDE_DIR={pybind11.get_include()}",
...
]
```
See: triton-lang#4414
Signed-off-by: Christian Heimes <christian@python.org>
6e37f2f to
d622426
Compare
I have fixed the |
`pybind11` is now a build-system requirement. The package is no longer
downloaded in `setup.py`. Instead the build system automatically
installs the build dependency `pybind11` before it runs `setup.py`. This
simplifies offline builds and makes the build requirement visible in
standard packaging tools.
I kept support support for `PYBIND11_SYSPATH`. The code can be
simplified even more if the feature is no longer needed:
```python
cmake_args = [
...
f"-DPYBIND11_INCLUDE_DIR={pybind11.get_include()}",
...
]
```
See: triton-lang#4414
The core Triton is a small number of people, and we receive many PRs
(thank
you!). To help us review your code more quickly, **if you are a new
contributor (less than 3 PRs merged) we ask that you complete the
following
tasks and include the filled-out checklist in your PR description.**
Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them.
- [x] I am not making a trivial change, such as fixing a typo in a
comment.
- [x] I have written a PR description following these
[rules](https://cbea.ms/git-commit/#why-not-how).
- [x] I have run `pre-commit run --from-ref origin/main --to-ref HEAD`.
- Select one of the following.
- [ ] I have added tests.
- `/test` for `lit` tests
- `/unittest` for C++ tests
- `/python/test` for end-to-end tests
- [x] This PR does not need a test because it modifies the build system
in a backwards compatible way.
- Select one of the following.
- [x] I have not added any `lit` tests.
- [ ] The `lit` tests I have added follow these [best
practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices),
including the "tests should be minimal" section. (Usually running Python
code
and using the instructions it generates is not minimal.)
Signed-off-by: Christian Heimes <christian@python.org>
pybind11is now a build-system requirement. The package is no longer downloaded insetup.py. Instead the build system automatically installs the build dependencypybind11before it runssetup.py. This simplifies offline builds and makes the build requirement visible in standard packaging tools.I kept support support for
PYBIND11_SYSPATH. The code can be simplified even more if the feature is no longer needed:See: #4414
The core Triton is a small number of people, and we receive many PRs (thank
you!). To help us review your code more quickly, if you are a new
contributor (less than 3 PRs merged) we ask that you complete the following
tasks and include the filled-out checklist in your PR description.
Complete the following tasks before sending your PR, and replace
[ ]with[x]to indicate you have done them.I am not making a trivial change, such as fixing a typo in a comment.
I have written a PR description following these
rules.
I have run
pre-commit run --from-ref origin/main --to-ref HEAD.Select one of the following.
/testforlittests/unittestfor C++ tests/python/testfor end-to-end testsSelect one of the following.
littests.littests I have added follow these best practices,including the "tests should be minimal" section. (Usually running Python code
and using the instructions it generates is not minimal.)