-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add torchaudio #27715
add torchaudio #27715
Changes from 7 commits
264666a
5c06f57
4c391cf
3078b4e
67e56b5
43be3b7
ffe289f
ef0c734
a8cd229
d054089
db0183c
df8ad65
bbc4c2f
1becc34
66b0c26
013a142
722a832
d6f462e
3bcbce9
0f0739c
3618216
87859da
f2dfc8d
710cb99
110ab56
d0c3aaf
3f91b04
6ce9f55
134dbfc
172843b
8f073f9
07569a2
3778715
826dd50
5988179
5b7d0f6
ac7d7bc
1d21508
4098634
ac4b49d
d802a77
7999fea
85793f0
2154c08
ae73876
1763fd5
8b701fd
c39e7a0
befe6b0
869700b
4d01e36
64fdf3a
dbe3eb9
12ba915
d361e0b
5516bb6
d7c5ef6
777196b
69a0116
e62b41f
796a15c
459d54e
c01e56a
137bcbc
894a89f
240eab8
f3ae343
4162e17
415e262
c17800d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
if [[ ${cuda_compiler_version} != "None" ]]; then | ||
# Set the CUDA arch list from | ||
# https://github.com/conda-forge/pytorch-cpu-feedstock/blob/main/recipe/build_pytorch.sh | ||
|
||
if [[ ${cuda_compiler_version} == 11.8 ]]; then | ||
export TORCH_CUDA_ARCH_LIST="3.5;5.0;6.0;6.1;7.0;7.5;8.0;8.6;8.9+PTX" | ||
export CUDA_TOOLKIT_ROOT_DIR=$CUDA_HOME | ||
elif [[ ${cuda_compiler_version} == 12.0 ]]; then | ||
export TORCH_CUDA_ARCH_LIST="5.0;6.0;6.1;7.0;7.5;8.0;8.6;8.9;9.0+PTX" | ||
# $CUDA_HOME not set in CUDA 12.0. Using $PREFIX | ||
export CUDA_TOOLKIT_ROOT_DIR="${PREFIX}" | ||
else | ||
echo "unsupported cuda version. edit build.sh" | ||
exit 1 | ||
fi | ||
|
||
export USE_ROCM="true" | ||
export USE_CUDA="true" | ||
export BUILD_CUDA_CTC_DECODER="true" | ||
|
||
else | ||
export USE_ROCM="false" | ||
export USE_CUDA="false" | ||
export BUILD_CUDA_CTC_DECODER="false" | ||
fi | ||
|
||
export BUILD_CPP_TEST="false" | ||
export BUILD_SOX="true" | ||
export BUILD_RIR="true" | ||
export BUILD_RNNT="true" | ||
export BUILD_ALIGN="true" | ||
export USE_FFMPEG="true" | ||
export USE_OPENMP="true" | ||
|
||
export CMAKE_C_COMPILER="$CC" | ||
export CMAKE_CXX_COMPILER="$CXX" | ||
export CMAKE_GENERATOR="Ninja" | ||
|
||
python -m pip install . -vv |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/tools/setup_helpers/extension.py b/tools/setup_helpers/extension.py | ||
index 2415bbae..f724c4b8 100644 | ||
--- a/tools/setup_helpers/extension.py | ||
+++ b/tools/setup_helpers/extension.py | ||
@@ -124,8 +124,9 @@ class CMakeBuild(build_ext): | ||
|
||
cmake_args = [ | ||
f"-DCMAKE_BUILD_TYPE={cfg}", | ||
- f"-DCMAKE_PREFIX_PATH={torch.utils.cmake_prefix_path}", | ||
- f"-DCMAKE_INSTALL_PREFIX={extdir}", | ||
+ f"-DCMAKE_PREFIX_PATH={os.environ['PREFIX']}", | ||
+ f"-DCMAKE_LIBRARY_PREFIX={os.environ['PREFIX']}", | ||
+ f"-DCMAKE_INSTALL_PREFIX={os.environ['SP_DIR']}/torch/lib", | ||
"-DCMAKE_VERBOSE_MAKEFILE=ON", | ||
f"-DPython_INCLUDE_DIR={distutils.sysconfig.get_python_inc()}", | ||
f"-DBUILD_CPP_TEST={'ON' if _BUILD_CPP_TEST else 'OFF'}", |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
context: | ||
name: torchaudio | ||
version: "2.4.1" | ||
build_number: 0 | ||
cuda_build_string: cuda_${{ cuda_version | version_to_buildstring }} | ||
string_prefix: ${{ cuda_build_string if cuda else "cpu_" }} | ||
|
||
package: | ||
name: ${{ name|lower }} | ||
version: ${{ version }} | ||
|
||
source: | ||
- url: https://github.com/pytorch/audio/archive/refs/tags/v${{ version }}.tar.gz | ||
sha256: a6b7e1b606ae353b9c4db1c8e754263f53f0457e9ab538e9669c0af0c46a0d5c | ||
patches: | ||
- patches/0001-point-to-correct-prefix.patch | ||
|
||
build: | ||
number: ${{ build_number}} | ||
skip: | ||
- win | ||
string: ${{ string_prefix }}py${{ python | version_to_buildstring }}h${{ hash }}_${{ build_number }} | ||
variant: | ||
use_keys: | ||
# use cuda from the variant config, e.g. to build multiple CUDA variants | ||
- cuda | ||
# this will down-prioritize the cuda variant versus other variants of the package | ||
down_prioritize_variant: ${{ 1 if cuda else 0 }} | ||
hadim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
dynamic_linking: | ||
rpaths: | ||
- lib/ | ||
hadim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
script: | ||
file: build | ||
env: | ||
cuda_compiler_version: ${{ cuda_version | default('None') }} | ||
|
||
requirements: | ||
build: | ||
- if: build_platform != target_platform | ||
then: | ||
- python | ||
- cross-python_{{ target_platform }} | ||
|
||
- ${{ compiler('cxx') }} | ||
- ${{ stdlib("c") }} | ||
- cmake | ||
- ninja | ||
|
||
- if: cuda | ||
then: | ||
- ${{ compiler('cuda') }} | ||
- cuda-version ==${{ cuda_version }} | ||
|
||
- if: cuda and match(cuda_version, ">=12") and build_platform != target_platform | ||
then: | ||
- cuda-driver-dev | ||
- cuda-cudart-dev | ||
- cuda-nvrtc-dev | ||
- cuda-nvtx-dev | ||
- cuda-nvml-dev | ||
- libcublas-dev | ||
- libcufft-dev | ||
- libcurand-dev | ||
- libcusolver-dev | ||
- libcusparse-dev | ||
|
||
host: | ||
- python | ||
- pip | ||
- setuptools | ||
- pytorch | ||
- ${{ "pytorch =*=cuda*" if cuda == "yes" }} | ||
- ${{ "pytorch =*=cpu*" if cuda == "no" }} | ||
|
||
- bzip2 | ||
- kaldi | ||
- pybind11 | ||
- sox | ||
- xz | ||
- zlib | ||
|
||
- ${{ "cuda-version =={{ cuda_version }}" if cuda }} | ||
|
||
- if: cuda and match(cuda_version, ">=12") | ||
then: | ||
- cuda-driver-dev | ||
- cuda-cudart-dev | ||
- cuda-nvrtc-dev | ||
- cuda-nvtx-dev | ||
- cuda-nvml-dev | ||
- libcublas-dev | ||
- libcufft-dev | ||
- libcurand-dev | ||
- libcusolver-dev | ||
- libcusparse-dev | ||
run: | ||
- python | ||
- numpy | ||
- kaldi | ||
- ${{ "pytorch =*=cuda*" if cuda == "yes" }} | ||
- ${{ "pytorch =*=cpu*" if cuda == "no" }} | ||
|
||
ignore_run_exports: | ||
from_package: | ||
- if: cuda and match(cuda_version, ">=12") | ||
then: | ||
- cuda-nvrtc-dev | ||
- cuda-nvtx-dev | ||
- libcublas-dev | ||
- libcufft-dev | ||
- libcurand-dev | ||
- libcusolver-dev | ||
- libcusparse-dev | ||
|
||
tests: | ||
- python: | ||
imports: | ||
- torchaudio | ||
- torchaudio.backend | ||
- torchaudio.compliance | ||
- torchaudio.datasets | ||
- torchaudio.functional | ||
- torchaudio.models | ||
- torchaudio.pipelines | ||
- torchaudio.kaldi_io | ||
- torchaudio.utils | ||
- torchaudio.sox_effects | ||
- torchaudio.transforms | ||
pip_check: true | ||
|
||
- requirements: | ||
run: | ||
- pytest | ||
- scipy | ||
- numpy | ||
- librosa | ||
- expecttest | ||
- requests | ||
- hypothesis | ||
- inflect | ||
- kaldi_io | ||
- parameterized | ||
- pysoundfile | ||
- transformers | ||
- unidecode | ||
- inflect | ||
files: | ||
source: | ||
- test/ | ||
- examples/ | ||
script: | ||
# remove example tests that are not importable out-of-tree | ||
# - rm -rf test/torchaudio_unittest/example | ||
# - CI=true pytest -v test/ | ||
|
||
# Note: Tests take too long to run and some are not importable out-of-tree | ||
- echo "Hello World" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to see some result of running the test suite (and efforts to get it to run) before we decide to skip it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I enabled them, let's see what happens. |
||
|
||
about: | ||
homepage: https://github.com/pytorch/audio | ||
license: BSD-2-Clause | ||
license_file: LICENSE | ||
summary: Data manipulation and transformation for audio signal processing, powered by PyTorch | ||
|
||
extra: | ||
recipe-maintainers: | ||
- hadim |
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
Sorry, something went wrong.