Skip to content

Commit

Permalink
refactor: modernize packaging (#643)
Browse files Browse the repository at this point in the history
According to [Python Packaging User
Guide](https://packaging.python.org/en/latest/discussions/setup-py-deprecated/),
`python setup.py` and the use of `setup.py` as a command line tool are
deprecated.

This PR unifies `setup.py` and `aot_setup.py` and moves static fields to
`pyproject.toml`.
  • Loading branch information
ur4t authored Dec 9, 2024
1 parent 1b998c3 commit 8e3d258
Show file tree
Hide file tree
Showing 89 changed files with 739 additions and 1,006 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/release_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,74 +43,72 @@ jobs:
- name: Build wheel
run: |
chown -R $CI_UID:$CI_GID "$GITHUB_WORKSPACE"
version="$(cat version.txt)"
docker run --rm -t \
-v "$CI_RUNNER_CACHE_DIR":/ci-cache \
-v "$GITHUB_WORKSPACE":/app \
-e FLASHINFER_CI_PYTHON_VERSION=${{ matrix.python }} \
-e FLASHINFER_CI_CUDA_VERSION=${{ matrix.cuda }} \
-e FLASHINFER_CI_TORCH_VERSION=${{ matrix.torch }} \
-e FLASHINFER_BUILD_VERSION=$version \
-e TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST" \
-e MAX_JOBS=128 \
--user $CI_UID:$CI_GID \
pytorch/manylinux-builder:cuda${{ matrix.cuda }} \
bash /app/scripts/run-ci-build-wheel.sh
timeout-minutes: 120
- run: du -h python/dist/*
- run: du -h dist/*

- uses: actions/upload-artifact@v4
with:
name: wheel-cuda${{ matrix.cuda }}-torch${{ matrix.torch }}-python${{ matrix.python }}
path: python/dist/*
path: dist/*

release:
needs: build
runs-on: [self-hosted]
steps:
- uses: actions/download-artifact@v4
with:
path: python/dist/
path: dist/
merge-multiple: true
pattern: wheel-*

- run: ls -lah python/dist/
- run: ls -lah dist/

- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ inputs.tag_name }}
files: |
python/dist/flashinfer*cp38*.whl
dist/flashinfer*cp38*.whl
- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ inputs.tag_name }}
files: |
python/dist/flashinfer*cp39*.whl
dist/flashinfer*cp39*.whl
- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ inputs.tag_name }}
files: |
python/dist/flashinfer*cp310*.whl
dist/flashinfer*cp310*.whl
- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ inputs.tag_name }}
files: |
python/dist/flashinfer*cp311*.whl
dist/flashinfer*cp311*.whl
- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ inputs.tag_name }}
files: |
python/dist/flashinfer*cp312*.whl
dist/flashinfer*cp312*.whl
- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ inputs.tag_name }}
files: |
python/dist/flashinfer-*.tar.gz
dist/flashinfer-*.tar.gz
- name: Clone wheel index
run: git clone https://oauth2:${WHL_TOKEN}@github.com/flashinfer-ai/whl.git flashinfer-whl
Expand Down
24 changes: 7 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
# ci
flashinfer-whl/
python/dist
dist/

# Compile commands json file
compile_commands.json

# Generated inst files
src/dispatch.inc

# Generated cu files
# Generated files
csrc/generated/
docs/generated/
flashinfer/_build_meta.py
flashinfer/data/
flashinfer/jit/aot_config.py
src/generated/
python/csrc/generated/
python/flashinfer/_build_meta.py
python/flashinfer/jit/aot_config.py
python/csrc-aot/generated/

# Package files
python/flashinfer/data/
python/flashinfer/version.txt
python/MANIFEST.in

# Generated documentation files
docs/generated

# DS_Store files
.DS_store
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ repos:
- id: clang-format
types_or: [c++, c, cuda]
exclude: |
(?x)^(3rdparty/.* src/generated/.* python/flashinfer/jit/aot_config.py)$
(?x)^(3rdparty/.* src/generated/.* flashinfer/jit/aot_config.py)$
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
Expand Down
Loading

0 comments on commit 8e3d258

Please sign in to comment.