Build #120
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
--- | |
name: Build | |
on: | |
schedule: | |
- cron: 0 10 * * * | |
push: | |
branches: [main] | |
workflow_call: | |
inputs: | |
os: | |
type: string | |
required: true | |
default: "ubuntu-20.04" | |
description: "Build OS. Example: ubuntu-20.04 or windows-2019" | |
python: | |
type: string | |
required: true | |
default: "3.10" | |
description: "Build python version. Example: 3.10" | |
silicondiff_tag: | |
type: string | |
required: true | |
default: "main" | |
description: "Build silicondiff-npu version. Example: main or v2.1.0, v2.1.0.post3" | |
torch_version: | |
type: string | |
required: true | |
default: "2.1.0" | |
description: "Build pytorch version. Example: 2.3.0" | |
torch_npu_version: | |
type: string | |
required: true | |
default: "2.1.0.post3" | |
description: "Build torch-npu version. Example: 2.1.0.post3" | |
secrets: | |
GH_PRIV_TOKEN: | |
required: true | |
workflow_dispatch: | |
inputs: | |
os: | |
type: string | |
required: true | |
default: "ubuntu-20.04" | |
description: "Build OS. Example: ubuntu-20.04 or windows-2019" | |
python: | |
type: string | |
required: true | |
default: "3.10" | |
description: "Build python version. Example: 3.10" | |
silicondiff_tag: | |
type: string | |
required: true | |
default: "main" | |
description: "Build silicondiff-npu version. Example: main or v2.1.0, v2.1.0.post3" | |
torch_version: | |
type: string | |
required: true | |
default: "2.1.0" | |
description: "Build pytorch version. Example: 2.3.0" | |
torch_npu_version: | |
type: string | |
required: true | |
default: "2.1.0.post3" | |
description: "Build torch-npu version. Example: 2.1.0.post3" | |
jobs: | |
build: | |
name: ${{ inputs.os }}-py${{ inputs.python }}-torch${{ inputs.torch_version }} | |
runs-on: ${{ inputs.os }} | |
steps: | |
- name: Checkout private silicondiff-npu | |
uses: actions/checkout@v3 | |
with: | |
repository: siliconflow/silicondiff-npu | |
ref: ${{ inputs.silicondiff_tag }} | |
token: ${{ secrets.GH_PRIV_TOKEN }} | |
path: "." | |
- name: Checkout silicondiff-npu-releases | |
uses: actions/checkout@v3 | |
with: | |
repository: siliconflow/silicondiff-npu-releases | |
path: downloads/silicondiff-npu-releases | |
- name: Install dependencies | |
run: | | |
echo "TORCH_VERSION=${{ inputs.torch_version }}" >> ${GITHUB_ENV} | |
echo "TORCH_NPU_VERSION=${{ inputs.torch_npu_version }}" >> ${GITHUB_ENV} | |
major=$(echo ${{ inputs.python }} | cut -d. -f1) | |
minor=$(echo ${{ inputs.python }} | cut -d. -f2) | |
# Generate the pattern cp<MAJOR><MINOR>-* | |
# where <MAJOR> is the major version without the dot | |
# and <MINOR> is the minor version | |
echo "CIBW_BUILD=cp${major}${minor}-*" >> ${GITHUB_ENV} | |
- name: Set up QEMU | |
if: runner.os == 'Linux' | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: all | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel==2.18.1 | |
- name: Build wheels | |
env: | |
CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation" | |
CIBW_ARCHS_LINUX: auto aarch64 | |
run: python -m cibuildwheel --config-file downloads/silicondiff-npu-releases/pyproject.toml --output-dir wheelhouse | |
- uses: actions/upload-artifact@v3 | |
with: | |
path: wheelhouse/*.whl |