1
+ name : Docs
2
+
3
+ on :
4
+ push :
5
+ branches : [ main ]
6
+ pull_request :
7
+
8
+ permissions :
9
+ id-token : write
10
+ contents : write
11
+
12
+ defaults :
13
+ run :
14
+ shell : bash -l -eo pipefail {0}
15
+
16
+ jobs :
17
+ generate-matrix :
18
+ uses : pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
19
+ with :
20
+ package-type : wheel
21
+ os : linux
22
+ test-infra-repository : pytorch/test-infra
23
+ test-infra-ref : main
24
+ with-cpu : disable
25
+ with-xpu : disable
26
+ with-rocm : disable
27
+ with-cuda : enable
28
+ build-python-only : " disable"
29
+ build :
30
+ needs : generate-matrix
31
+ strategy :
32
+ fail-fast : false
33
+ name : Build and Upload wheel
34
+ uses : pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main
35
+ with :
36
+ repository : pytorch/audio
37
+ ref : " "
38
+ test-infra-repository : pytorch/test-infra
39
+ test-infra-ref : main
40
+ build-matrix : ${{ needs.generate-matrix.outputs.matrix }}
41
+ package-name : torchaudio
42
+ trigger-event : ${{ github.event_name }}
43
+ build-platform : " python-build-package"
44
+ build-command : " python -m build --wheel -vvv --no-isolation"
45
+
46
+ build-docs :
47
+ runs-on : linux.4xlarge.nvidia.gpu
48
+ strategy :
49
+ fail-fast : false
50
+ matrix :
51
+ # 3.10 corresponds to the minimum python version for which we build
52
+ # the wheel unless the label cliflow/binaries/all is present in the
53
+ # PR.
54
+ python-version : ['3.10']
55
+ cuda-version : ['12.6']
56
+ ffmpeg-version-for-tests : ['7']
57
+ container :
58
+ image : " pytorch/manylinux2_28-builder:cuda${{ matrix.cuda-version }}"
59
+ options : " --gpus all -e NVIDIA_DRIVER_CAPABILITIES=video,compute,utility"
60
+ needs : build
61
+ steps :
62
+ - name : Setup env vars
63
+ run : |
64
+ cuda_version_without_periods=$(echo "${{ matrix.cuda-version }}" | sed 's/\.//g')
65
+ echo cuda_version_without_periods=${cuda_version_without_periods} >> $GITHUB_ENV
66
+ python_version_without_periods=$(echo "${{ matrix.python-version }}" | sed 's/\.//g')
67
+ echo python_version_without_periods=${python_version_without_periods} >> $GITHUB_ENV
68
+ - uses : actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
69
+ with :
70
+ name : pytorch_audio__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64
71
+ path : pytorch/audio/dist/
72
+ - name : Setup miniconda using test-infra
73
+ uses : pytorch/test-infra/.github/actions/setup-miniconda@main
74
+ with :
75
+ python-version : ${{ matrix.python-version }}
76
+ # We install conda packages at the start because otherwise conda may have conflicts with dependencies.
77
+ default-packages : " nvidia/label/cuda-${{ matrix.cuda-version }}.0::libnpp nvidia::cuda-nvrtc=${{ matrix.cuda-version }} nvidia::cuda-toolkit=${{ matrix.cuda-version }} nvidia::cuda-cudart=${{ matrix.cuda-version }} nvidia::cuda-driver-dev=${{ matrix.cuda-version }} conda-forge::ffmpeg=${{ matrix.ffmpeg-version-for-tests }}"
78
+ - name : Check env
79
+ run : |
80
+ ${CONDA_RUN} env
81
+ ${CONDA_RUN} conda info
82
+ ${CONDA_RUN} nvidia-smi
83
+ ${CONDA_RUN} conda list
84
+ - name : Assert ffmpeg exists
85
+ run : |
86
+ ${CONDA_RUN} ffmpeg -buildconf
87
+ - name : Update pip
88
+ run : ${CONDA_RUN} python -m pip install --upgrade pip
89
+ - name : Install PyTorch
90
+ run : |
91
+ ${CONDA_RUN} python -m pip install --pre torch torchcodec --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }}
92
+ ${CONDA_RUN} python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}"); print(f"{torch.cuda.is_available()=}")'
93
+ - name : Install torchaudio from the wheel
94
+ run : |
95
+ wheel_path=`find pytorch/audio/dist -type f -name "*cu${{ env.cuda_version_without_periods }}-cp${{ env.python_version_without_periods }}*.whl"`
96
+ echo Installing $wheel_path
97
+ ${CONDA_RUN} python -m pip install $wheel_path -vvv
98
+
99
+ - name : Check out repo
100
+ uses : actions/checkout@v3
101
+
102
+ - name : Install doc dependencies
103
+ run : |
104
+ cd docs
105
+ ${CONDA_RUN} python -m pip install -r requirements.txt -r requirements-tutorials.txt
106
+ - name : Build docs
107
+ run : |
108
+ cd docs
109
+ ${CONDA_RUN} make html
110
+ - uses : actions/upload-artifact@v4
111
+ with :
112
+ name : Built-Docs
113
+ path : docs/build/html/
0 commit comments