Skip to content

Commit

Permalink
torch npu version
Browse files Browse the repository at this point in the history
  • Loading branch information
hjchen2 committed Dec 2, 2024
1 parent c2b12aa commit f1c3e94
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ on:
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
Expand All @@ -52,6 +57,11 @@ on:
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:
Expand All @@ -76,6 +86,7 @@ jobs:
- 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)
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ on:
required: true
default: "2.1.0"
description: "Build pytorch version. Example: 2.1.0"
torch_npu_version:
type: string
required: true
default: "2.1.0.post3"
description: "Build torch-npu version. Example: 2.1.0.post3"
workflow_dispatch:
inputs:
silicondiff_tag:
Expand All @@ -38,6 +43,11 @@ on:
required: true
default: "2.1.0"
description: "Build pytorch version. Example: 2.1.0"
torch_npu_version:
type: string
required: true
default: "2.1.0.post3"
description: "Build torch-npu version. Example: 2.1.0.post3"

permissions:
contents: read
Expand Down Expand Up @@ -65,6 +75,7 @@ jobs:
python: ${{ matrix.python }}
silicondiff_tag: ${{ inputs.silicondiff_tag }}
torch_version: ${{ inputs.torch_version }}
torch_npu_version: ${{ inputs.torch_npu_version }}
secrets:
GH_PRIV_TOKEN: ${{ secrets.GH_PRIV_TOKEN }}

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ environment-pass = [
"PIP_NO_BUILD_ISOLATION",
"PY",
"TORCH_VERSION",
"TORCH_NPU_VERSION",
]
before-build = [
"bash {project}/downloads/silicondiff-npu-releases/scripts/install_deps.sh",
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ set -Eeuo pipefail
which python
which pip

pip install -U setuptools_scm ninja Cython "torch==${TORCH_VERSION}" -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu --no-cache-dir
pip install -U setuptools_scm ninja Cython "torch==${TORCH_VERSION}" "torch-npu==${TORCH_NPU_VERSION}" -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu --no-cache-dir

0 comments on commit f1c3e94

Please sign in to comment.