Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The previous implementation worked on Python 3.11 but had a host of issues with other versions. It boiled down to `triton._C` not being a regular package -- it doesn't have an `__init__.py` file. However, it can still be imported as a [namespace package][1]. Namespace packages can map to multiple locations on the filesystem, so we cannot get a path to the package contents without materializing the package. The solution is to look up the files of the top-level `triton` package instead, which is a regular package, and use that to find the location of the `_C` directory. I've tested that this approach works on 3.9 and 3.12 in macOS. Fixes #76. [1]: https://packaging.python.org/en/latest/guides/packaging-namespace-packages/#native-namespace-packages
- Loading branch information