-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c0604f5
Showing
20 changed files
with
968 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Apply patches | ||
|
||
inputs: | ||
name: | ||
required: true | ||
type: string | ||
|
||
path: | ||
default: . | ||
type: string | ||
|
||
version: | ||
default: ~ | ||
type: string | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: Apply patches | ||
shell: bash | ||
run: | | ||
set -e | ||
# Constants | ||
readonly CONTENT_PATH="patches/${{ inputs.name }}" | ||
readonly VERSION="${{ inputs.version }}" | ||
# API endpoint template | ||
contents() { | ||
echo "/repos/${{ github.repository }}/contents/$1?ref=${{ github.sha }}" | ||
} | ||
# Function to apply patch | ||
apply() { | ||
# Apply patch | ||
if [[ "$1" == *.patch ]]; then | ||
# Log patch name | ||
echo "Applying patch $1..." | ||
# Apply | ||
gh api "$(contents $CONTENT_PATH/$1)" --jq '.content' | base64 -d | patch -p1 | ||
fi | ||
# Apply script | ||
if [[ "$1" == *.sh ]]; then | ||
# Log script name | ||
echo "Applying script $1..." | ||
# Apply | ||
gh api "$(contents $CONTENT_PATH/$1)" --jq '.content' | base64 -d | bash | ||
fi | ||
} | ||
# Is version-specific patches present? | ||
HAS_VERSION_DIR=0 | ||
# Go to directory | ||
cd "${{ inputs.path }}" | ||
# Apply patches | ||
for name in $(gh api "$(contents $CONTENT_PATH)" --jq '.[].name'); do | ||
# If directory with current version name present, apply patches in directory later | ||
if [[ "$name" == "$VERSION" ]]; then | ||
HAS_VERSION_DIR=1 | ||
fi | ||
# Apply patch | ||
apply "$name" | ||
done | ||
# Apply patches for current version | ||
if [[ "$HAS_VERSION_DIR" == "1" ]]; then | ||
for name in $(gh api "$(contents $CONTENT_PATH/$VERSION)" --jq '.[].name'); do | ||
apply "$VERSION/$name" | ||
done | ||
fi | ||
env: | ||
GH_TOKEN: ${{ github.token }} |
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,77 @@ | ||
name: Build Triton wheels | ||
|
||
inputs: | ||
name: | ||
default: triton | ||
type: string | ||
|
||
patches_version: | ||
default: ~ | ||
type: string | ||
|
||
python_version: | ||
required: true | ||
type: string | ||
|
||
ref: | ||
default: main | ||
type: string | ||
|
||
repository: | ||
default: triton-lang/triton | ||
type: string | ||
|
||
version: | ||
default: ~ | ||
type: string | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: Normalize wheel name | ||
shell: bash | ||
run: echo WHEEL_NAME=${WHEEL_NAME/-/_} >> "$GITHUB_ENV" | ||
env: | ||
WHEEL_NAME: "${{ inputs.name }}" | ||
|
||
- name: Checkout ${{ inputs.repository }} (${{ inputs.ref }}) | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
repository: ${{ inputs.repository }} | ||
path: ${{ env.WHEEL_NAME }} | ||
|
||
- if: inputs.patches_version != '' | ||
name: Apply patches (${{ inputs.patches_version }}) | ||
uses: ./.github/actions/apply-patches | ||
with: | ||
name: ${{ env.WHEEL_NAME }} | ||
path: ${{ env.WHEEL_NAME }} | ||
version: ${{ inputs.patches_version }} | ||
|
||
- name: Resolve SOURCE_DATE_EPOCH | ||
shell: bash | ||
run: echo "SOURCE_DATE_EPOCH=$(git log -1 --format=%ct)" | tee "$GITHUB_ENV" | ||
|
||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.18.0 | ||
with: | ||
package-dir: ${{ env.WHEEL_NAME }}/python | ||
env: | ||
CIBW_BUILD: cp${{ inputs.python_version }}-manylinux_x86_64 | ||
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: quay.io/pypa/manylinux2014_x86_64:latest | ||
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2014_x86_64:latest | ||
SOURCE_DATE_EPOCH: ${{ env.SOURCE_DATE_EPOCH }} | ||
|
||
- name: Repackage wheels | ||
uses: ./.github/actions/repackage-wheels | ||
with: | ||
name: ${{ env.WHEEL_NAME }} | ||
version: ${{ inputs.wheel_version }} | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.WHEEL_NAME }}-cp${{ inputs.python_version }} | ||
path: wheelhouse/*.whl |
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,81 @@ | ||
name: Build vLLM wheels | ||
|
||
inputs: | ||
name: | ||
default: vllm | ||
type: string | ||
|
||
patches_version: | ||
default: ~ | ||
type: string | ||
|
||
ref: | ||
default: main | ||
type: string | ||
|
||
repository: | ||
default: vllm-project/vllm | ||
type: string | ||
|
||
version: | ||
default: ~ | ||
type: string | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: Normalize wheel name | ||
shell: bash | ||
run: echo WHEEL_NAME=${WHEEL_NAME/-/_} >> "$GITHUB_ENV" | ||
env: | ||
WHEEL_NAME: "${{ inputs.name }}" | ||
|
||
- name: Clear cache | ||
shell: bash | ||
run: rm -fr /opt/hostedtoolcache | ||
|
||
- name: Checkout ${{ inputs.repository }} (${{ inputs.ref }}) | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
repository: ${{ inputs.repository }} | ||
path: ${{ env.WHEEL_NAME }} | ||
|
||
- if: inputs.patches_version != '' | ||
name: Apply patches (${{ inputs.patches_version }}) | ||
uses: ./.github/actions/apply-patches | ||
with: | ||
name: ${{ env.WHEEL_NAME }} | ||
path: ${{ env.WHEEL_NAME }} | ||
version: ${{ inputs.patches_version }} | ||
|
||
- name: Resolve SOURCE_DATE_EPOCH | ||
shell: bash | ||
run: echo "SOURCE_DATE_EPOCH=$(git log -1 --format=%ct)" | tee "$GITHUB_ENV" | ||
|
||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.18.0 | ||
with: | ||
package-dir: ${{ env.WHEEL_NAME }} | ||
env: | ||
CIBW_BUILD: cp38-manylinux_x86_64 | ||
CIBW_ENVIRONMENT: > | ||
CMAKE_BUILD_TYPE=Release | ||
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: ghcr.io/sasha0552/manylinux2014_x86_64-cuda:latest | ||
CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/sasha0552/manylinux2014_x86_64-cuda:latest | ||
CIBW_REPAIR_WHEEL_COMMAND: ~ | ||
SOURCE_DATE_EPOCH: ${{ env.SOURCE_DATE_EPOCH }} | ||
|
||
- name: Repackage wheels | ||
uses: ./.github/actions/repackage-wheels | ||
with: | ||
name: ${{ env.WHEEL_NAME }} | ||
version: ${{ inputs.wheel_version }} | ||
tags: cp38-abi3-manylinux1_x86_64 | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.WHEEL_NAME }} | ||
path: wheelhouse/*.whl |
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,28 @@ | ||
name: Publish wheels | ||
|
||
inputs: | ||
prefix: | ||
required: true | ||
type: string | ||
|
||
runs: | ||
using: "composite" | ||
|
||
steps: | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
|
||
- name: Remove previous wheels | ||
uses: mknejp/delete-release-assets@v1 | ||
with: | ||
assets: "${{ inputs.prefix }}*.whl" | ||
fail-if-no-assets: false | ||
fail-if-no-release: false | ||
tag: wheels | ||
token: ${{ github.token }} | ||
|
||
- name: Upload wheels | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: "**/${{ inputs.prefix }}*.whl" | ||
tag_name: wheels |
Oops, something went wrong.