-
Notifications
You must be signed in to change notification settings - Fork 197
153 lines (138 loc) · 5.2 KB
/
Copy pathpublish.yaml
File metadata and controls
153 lines (138 loc) · 5.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# This workflow will:
# - Create a new Github release
# - Build wheels for supported architectures
# - Deploy the wheels to the Github release
# - Release the static code to PyPi
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Build wheels and deploy
on:
create:
tags:
- v*
jobs:
setup_release:
name: Create Release
runs-on: ubuntu-latest
outputs:
release-version: ${{ steps.extract_branch.outputs.branch }}
steps:
- name: Get the tag version
id: extract_branch
run: echo ::set-output name=branch::${GITHUB_REF#refs/tags/}
shell: bash
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.extract_branch.outputs.branch }}
release_name: ${{ steps.extract_branch.outputs.branch }}
build_wheels:
name: Build Wheel
needs: setup_release
strategy:
fail-fast: false
matrix:
# Using ubuntu-22.04 instead of 24.04 for more compatibility (glibc). Ideally we'd use the
# manylinux docker image, but I haven't figured out how to install CUDA on manylinux.
os: [ubuntu-22.04, ubuntu-22.04-arm]
python-version: ["3.10", "3.11", "3.12", "3.13"]
torch-version: ["2.6.0", "2.7.1", "2.8.0", "2.9.1", "2.10.0"]
cuda-version: ["11.8.0", "12.9.1", "13.0.1"]
# We need separate wheels that either uses C++11 ABI (-D_GLIBCXX_USE_CXX11_ABI) or not.
# Pytorch wheels currently don't use it, but nvcr images have Pytorch compiled with C++11 ABI.
# Without this we get import error (undefined symbol: _ZN3c105ErrorC2ENS_14SourceLocationESs)
# when building without C++11 ABI and using it on nvcr images.
cxx11_abi: ["FALSE", "TRUE"]
exclude:
# CUDA 11.8 is not supported by PyTorch 2.8+
- torch-version: "2.8.0"
cuda-version: "11.8.0"
- torch-version: "2.9.1"
cuda-version: "11.8.0"
- torch-version: "2.10.0"
cuda-version: "11.8.0"
# CUDA 13.0 is only supported by PyTorch 2.9+
- torch-version: "2.6.0"
cuda-version: "13.0.1"
- torch-version: "2.7.1"
cuda-version: "13.0.1"
- torch-version: "2.8.0"
cuda-version: "13.0.1"
# No aarch64 PyTorch wheels for 2.6.0, or 2.7.1+cu118
- torch-version: "2.6.0"
os: ubuntu-22.04-arm
- torch-version: "2.7.1"
cuda-version: "11.8.0"
os: ubuntu-22.04-arm
# PyTorch 2.7+ pip wheels use CXX11_ABI=1 by default, no need for FALSE
- torch-version: "2.7.1"
cxx11_abi: "FALSE"
- torch-version: "2.8.0"
cxx11_abi: "FALSE"
- torch-version: "2.9.1"
cxx11_abi: "FALSE"
- torch-version: "2.10.0"
cxx11_abi: "FALSE"
uses: ./.github/workflows/_build.yml
with:
runs-on: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
cuda-version: ${{ matrix.cuda-version }}
torch-version: ${{ matrix.torch-version }}
cxx11_abi: ${{ matrix.cxx11_abi }}
release-version: ${{ needs.setup_release.outputs.release-version }}
upload-to-release: true
check_for_ngc_images:
runs-on: ubuntu-latest
outputs:
images: ${{ steps.check_for_ngc_images.outputs.IMAGES }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check for NGC PyTorch images
id: check_for_ngc_images
run: |
bash ./.github/scripts/check_for_ngc_images.sh
echo "IMAGES=$(cat ngc_images.json| jq -cr)" >> $GITHUB_OUTPUT
build_ngc_wheels:
name: Build Wheel for NGC PyTorch
needs: [setup_release, check_for_ngc_images]
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-22.04-arm]
container-image: ${{ fromJson(needs.check_for_ngc_images.outputs.images) }}
uses: ./.github/workflows/_build_in_container.yml
with:
runs-on: ${{ matrix.os }}
container-image: ${{ matrix.container-image }}
release-version: ${{ needs.setup_release.outputs.release-version }}
upload-to-release: true
publish_package:
name: Publish package
needs: [build_wheels, build_ngc_wheels]
runs-on: ubuntu-latest
if: always() && !cancelled()
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install ninja packaging setuptools wheel twine
# We don't want to download anything CUDA-related here
pip install torch --index-url https://download.pytorch.org/whl/cpu
- name: Build core package
env:
CAUSAL_CONV1D_SKIP_CUDA_BUILD: "TRUE"
run: |
python setup.py sdist --dist-dir=dist
- name: Deploy
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m twine upload dist/*