-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Refactor JIT and AOT build script (#567)
Previously, JIT and AOT packaging is a bit broken. This PR produces good sdist for JIT mode, and wheel for AOT mode. ## Changes Common changes: 1. Remove the symlinks. Symlinks causes lots of duplication when search in VSCode. 2. In package distribution (sdist or wheel), add data files to `python/flashinfer/data/`, i.e. inside the python package folder. This is strongly recommended by setuptools. * Data files include: `version.txt`, FlashInfer headers, Cutlass headers. * Symlinks will be created when building wheel, and will be removed when finished unless it's using `develop` command. 3. Exclude unneeded cutlass docs and files from wheel and sdist. AOT changes: 1. Remove `flashinfer-aot` dir. Contents are moved to `python/`. 2. Merge all kernels into one pybind. This is good for compilation speed. (`_kernels_sm90` is preserved as a separated `.so` file.) 3. AOT wheel can now be built with the following command: ```bash cd flashinfer/python TORCH_CUDA_ARCH_LIST="7.5 8.0 8.9 9.0a" python3 aot_setup.py bdist_wheel ls -la dist/ ``` 4. AOT wheel can also be built for editable install (develop purpose) ```bash cd flashinfer/python TORCH_CUDA_ARCH_LIST="7.5 8.0 8.9 9.0a" python3 aot_setup.py develop ``` JIT changes: 1. JIT mode can now be installed in various ways: ```bash cd flashinfer/python pip install -v . # Regular install from source pip install -v -e . # Editable install python -m build --sdist # Build sdist pip install dist/flashinfer-*.tar.gz # Install from sdist ``` ## Directory structure of built package See attached. [dir-wheel.txt](https://github.com/user-attachments/files/17562193/dir-wheel.txt) [dir-sdist.txt](https://github.com/user-attachments/files/17562194/dir-sdist.txt) ## Tests I was able to pass `pytest -sv test_norm.py test_bmm_fp8.py` using various way of installation: 1. Editable install 2. Regular install from source 3. Install from sdist 4. Install from wheel
- Loading branch information
1 parent
e46d9a7
commit 7df90dd
Showing
40 changed files
with
425 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# MANIFEST.in for AOT wheel | ||
|
||
prune */__pycache__ | ||
prune csrc | ||
prune csrc_aot | ||
exclude aot_setup.py | ||
exclude setup.py | ||
|
||
include flashinfer/data/version.txt | ||
graft flashinfer/data/csrc | ||
graft flashinfer/data/include | ||
graft flashinfer/data/cutlass/include | ||
graft flashinfer/data/cutlass/tools/util/include |
Oops, something went wrong.