python-wheel-build / fromager

Build your own wheels
https://fromager.readthedocs.io/en/latest/
Apache License 2.0
5 stars 9 forks source link

Change variant name to platform triple / quadruple? #369

Open tiran opened 2 weeks ago

tiran commented 2 weeks ago

In Fromager <= 0.28, the variant name is an arbitrary string. By convention, we are using names like cpu or cuda-ubi9. The first part of the string is the GPU-specific library and the second part is missing or the nick name of the build environment. The approach is good enough for now, because we only test on Linux x86_64 for UBI9 / CentOS 9. In the future, we are going to support more platforms and hardware architectures. Some combinations may require specific patches or settings.

Compilers like gcc, llvm/clang, and Rust use platform triple(e) to express platform support and target:

We could use a similar approach in Fromager and define an inheritance order for settings, e.g. GPU arch > CPU arch > OS > default.

dimensions

Some dimensions are implied by others, e.g. ubi9 implies Linux with glibc and el9 ABI. The OS and CPU arch can be retrieved at runtime (platform module).

Triple syntax

<arch>-<vendor>-<sys>-<abi>

Example (Fedora 39):

$ clang -dumpmachine
x86_64-redhat-linux-gnu
$ gcc -dumpmachine
x86_64-redhat-linux

Suggestion

dhellmann commented 2 weeks ago

I think we could standardize on a format downstream, but I hesitate to impose a standard like that upstream. It gets us into the same situation we are with wheel build tags, where the creators of the standard didn't anticipate future needs and now we don't have a way to express GPU-specific builds.