From b56b80c65b724a7b72fc7ca1c3de7d60744c2eff Mon Sep 17 00:00:00 2001 From: pavelToman Date: Thu, 18 Dec 2025 16:11:11 +0100 Subject: [PATCH 01/21] adding easyconfigs: WhisperX-3.7.4-foss-2024a-CUDA-12.6.0.eb, ONNX-Runtime-1.23.2-foss-2024a-CUDA-12.6.0.eb, ONNX-1.20.0-gfbf-2024a.eb, CTranslate2-4.5.0-foss-2024a-CUDA-12.6.0.eb, cpu_features-0.10.1-GCCcore-13.3.0.eb, pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb, torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb, Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb, PyTorch-Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb, bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb and patches: ONNX-Runtime-1.23.2_gpu-package-name.patch, torchaudio-2.6.0_fix_tests_gpu.patch --- ...sandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb | 54 ++++++++++ ...Translate2-4.5.0-foss-2024a-CUDA-12.6.0.eb | 89 +++++++++++++++ .../cpu_features-0.10.1-GCCcore-13.3.0.eb | 32 ++++++ .../Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb | 29 +++++ ...X-Runtime-1.23.2-foss-2024a-CUDA-12.6.0.eb | 91 ++++++++++++++++ ...ONNX-Runtime-1.23.2_gpu-package-name.patch | 13 +++ .../o/ONNX/ONNX-1.20.0-gfbf-2024a.eb | 46 ++++++++ ...-Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb | 45 ++++++++ ...note.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb | 101 ++++++++++++++++++ .../torchaudio-2.6.0_fix_tests_gpu.patch | 64 +++++++++++ ...torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb | 71 ++++++++++++ .../WhisperX-3.7.4-foss-2024a-CUDA-12.6.0.eb | 57 ++++++++++ 12 files changed, 692 insertions(+) create mode 100644 easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb create mode 100644 easybuild/easyconfigs/c/CTranslate2/CTranslate2-4.5.0-foss-2024a-CUDA-12.6.0.eb create mode 100644 easybuild/easyconfigs/c/cpu_features/cpu_features-0.10.1-GCCcore-13.3.0.eb create mode 100644 easybuild/easyconfigs/l/Lightning/Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb create mode 100644 easybuild/easyconfigs/o/ONNX-Runtime/ONNX-Runtime-1.23.2-foss-2024a-CUDA-12.6.0.eb create mode 100644 easybuild/easyconfigs/o/ONNX-Runtime/ONNX-Runtime-1.23.2_gpu-package-name.patch create mode 100644 easybuild/easyconfigs/o/ONNX/ONNX-1.20.0-gfbf-2024a.eb create mode 100644 easybuild/easyconfigs/p/PyTorch-Lightning/PyTorch-Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb create mode 100644 easybuild/easyconfigs/p/pyannote.audio/pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb create mode 100644 easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix_tests_gpu.patch create mode 100644 easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb create mode 100644 easybuild/easyconfigs/w/WhisperX/WhisperX-3.7.4-foss-2024a-CUDA-12.6.0.eb diff --git a/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb new file mode 100644 index 000000000000..3b64a69686cf --- /dev/null +++ b/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb @@ -0,0 +1,54 @@ +easyblock = 'CMakeMake' + +name = 'bitsandbytes' +version = '0.46.1' +versionsuffix = '-CUDA-%(cudaver)s' + +homepage = 'https://huggingface.co/docs/bitsandbytes/main/en/index' +description = "bitsandbytes enables accessible large language models via k-bit quantization for PyTorch." +github_account = 'bitsandbytes-foundation' + +toolchain = {'name': 'foss', 'version': '2024a'} + +source_urls = [GITHUB_LOWER_SOURCE] +sources = ['%(version)s.tar.gz'] +checksums = ['8326835082ad5590e4eab2cc51129bf55dd1c16e3d3038bc23431371c24b47da'] + +builddependencies = [ + ('CMake', '3.29.3'), + ('pkgconf', '2.2.0'), + ('scikit-build-core', '0.10.6'), +] + +dependencies = [ + ('CUDA', '12.6.0', '', SYSTEM), + ('Python', '3.12.3'), + ('PyTorch', '2.7.1', versionsuffix), + ('SciPy-bundle', '2024.05'), +] + +configopts = "-DCOMPUTE_BACKEND=cuda" + +# skip install step in CMakeMake, but we still need install step in extension +install_cmd = 'exit' + +exts_defaultclass = 'PythonPackage' +exts_list = [ + (name, version, { + 'source_urls': ['https://github.com/%(github_account)s/%(namelower)s/archive'], + 'sources': ['%(version)s.tar.gz'], + 'start_dir': '%(builddir)s/bitsandbytes-%(version)s/', + 'checksums': ['8326835082ad5590e4eab2cc51129bf55dd1c16e3d3038bc23431371c24b47da'], + }), +] + +sanity_check_paths = { + 'files': [f'lib/python%(pyshortver)s/site-packages/bitsandbytes/libbitsandbytes_cpu.{SHLIB_EXT}'], + 'dirs': ['lib/python%(pyshortver)s/site-packages'], +} + +sanity_check_commands = [ + "python -c 'import bitsandbytes'", +] + +moduleclass = 'ai' diff --git a/easybuild/easyconfigs/c/CTranslate2/CTranslate2-4.5.0-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/c/CTranslate2/CTranslate2-4.5.0-foss-2024a-CUDA-12.6.0.eb new file mode 100644 index 000000000000..ce1e5782d7b3 --- /dev/null +++ b/easybuild/easyconfigs/c/CTranslate2/CTranslate2-4.5.0-foss-2024a-CUDA-12.6.0.eb @@ -0,0 +1,89 @@ +easyblock = 'CMakeMake' + +name = 'CTranslate2' +version = '4.5.0' +versionsuffix = '-CUDA-%(cudaver)s' + +homepage = 'https://opennmt.net/CTranslate2/' +description = "Fast inference engine for Transformer models." + +toolchain = {'name': 'foss', 'version': '2024a'} +toolchainopts = {'extra_cxxflags': '-D_AMXTILEINTRIN_H_INCLUDED'} +# '-D_AMXTILEINTRIN_H_INCLUDED' flag is required to avoid the following errors, +# likely due to an incompatibility between the GCC 13.3.0 and NVCC CUDA 12.6.0: +# [...]/GCCcore/13.3.0/lib/gcc/x86_64-pc-linux-gnu/13.3.0/include/amxtileintrin.h(42): +# error: identifier "__builtin_ia32_ldtilecfg" is undefined +# from ec: LAMMPS-29Aug2024_update2-foss-2024a-kokkos-CUDA-12.6.0.eb + +source_urls = ['https://github.com/OpenNMT/CTranslate2/archive/'] +sources = [{ + "download_filename": "v%(version)s.tar.gz", + "filename": SOURCE_TAR_GZ, +}] +patches = [ + 'CTranslate2-4.5.0_fix-third-party.patch', + 'CTranslate2-4.5.0_fix-tests.patch', + 'CTranslate2-4.5.0_replace-cxxopts.patch', +] +checksums = [ + {'CTranslate2-4.5.0.tar.gz': 'f3040c7c3da5dde022fdc16906c279f3f936c6e79f3df8f998c908bb01a77cfe'}, + {'CTranslate2-4.5.0_fix-third-party.patch': '45ab6d19954010dc5d515498a0827f0b13992d88b9691ab73ab27fee1114e3e3'}, + {'CTranslate2-4.5.0_fix-tests.patch': '73123eafe612538354be5aa96c750199e1a219a5316800848c3894c1cc6ca2ad'}, + {'CTranslate2-4.5.0_replace-cxxopts.patch': 'e378969c2968e2fd57863956a4d2f267731a49d1b890dcc45593d6a310531271'}, +] + +builddependencies = [ + ('CMake', '3.31.8'), + ('pybind11', '2.12.0'), + ('cxxopts', '3.0.0', '', SYSTEM), + ('spdlog', '1.15.3'), + ('cpu_features', '0.10.1'), +] + +dependencies = [ + ('CUDA', '12.6.0', '', SYSTEM), + ('Python', '3.12.3'), + ('SciPy-bundle', '2024.05'), + ('googletest', '1.15.2'), + ('PyYAML', '6.0.2'), + ('cuDNN', '9.5.1.17', versionsuffix, SYSTEM), +] + +# make sure that CTranslate2 libraries are linked to FlexiBLAS, not OpenBLAS +preconfigopts = "export CMAKE_INCLUDE_PATH=$EBROOTFLEXIBLAS/include/flexiblas:${CMAKE_INCLUDE_PATH} && " +preconfigopts += "sed -i 's/openblas/flexiblas/g' %(start_dir)s/CMakeLists.txt && " + +configopts = '-DOPENMP_RUNTIME=COMP -DWITH_CUDA=ON -DWITH_MKL=OFF ' +configopts += '-DOPENBLAS_INCLUDE_DIR="$EBROOTFLEXIBLAS/include" -DWITH_OPENBLAS=ON ' +configopts += '-DWITH_CUDNN=ON ' +configopts += '-DENABLE_CPU_DISPATCH=OFF ' + +prebuildopts = 'export CT2_VERBOSE=3 && ' + +exts_defaultclass = 'PythonPackage' +exts_default_options = { + 'source_urls': [PYPI_SOURCE], + 'installopts': '', + 'runtest': False, +} + +exts_list = [ + ('ctranslate2', version, { + 'sources': ['CTranslate2-%(version)s.tar.gz'], + 'start_dir': 'python', + 'checksums': ['f3040c7c3da5dde022fdc16906c279f3f936c6e79f3df8f998c908bb01a77cfe'], + }), +] + +sanity_check_paths = { + 'files': ['bin/ct2-translator', 'lib/libctranslate2.%s' % SHLIB_EXT], + 'dirs': ['include/ctranslate2', 'lib/python%(pyshortver)s/site-packages'], +} + +sanity_check_commands = [ + "ct2-translator --help", + "python -c 'import ctranslate2'", + "python -m pip check", +] + +moduleclass = 'ai' diff --git a/easybuild/easyconfigs/c/cpu_features/cpu_features-0.10.1-GCCcore-13.3.0.eb b/easybuild/easyconfigs/c/cpu_features/cpu_features-0.10.1-GCCcore-13.3.0.eb new file mode 100644 index 000000000000..dcd84f2fafd0 --- /dev/null +++ b/easybuild/easyconfigs/c/cpu_features/cpu_features-0.10.1-GCCcore-13.3.0.eb @@ -0,0 +1,32 @@ +# This file is an EasyBuild reciPY as per https://github.com/easybuilders/easybuild +# Author: Denis Kristak, update: Pavel Tománek +easyblock = 'CMakeMake' + +name = 'cpu_features' +version = '0.10.1' + +homepage = 'https://github.com/google/cpu_features' +description = """A cross-platform C library to retrieve CPU features (such as available instructions) at runtime.""" + +toolchain = {'name': 'GCCcore', 'version': '13.3.0'} +toolchainopts = {'pic': True} + +source_urls = ['https://github.com/google/cpu_features/archive/'] +sources = ['v%(version)s.tar.gz'] +checksums = ['52639b380fced11d738f8b151dbfee63fb94957731d07f1966c812e5b90cbad4'] + +builddependencies = [ + ('CMake', '3.31.8'), + ('binutils', '2.42'), +] + +modextrapaths = {MODULE_LOAD_ENV_HEADERS: 'include/cpu_features'} + +sanity_check_paths = { + 'files': ['bin/list_cpu_features', 'lib/libcpu_features.a'], + 'dirs': ['include/cpu_features/'] +} + +sanity_check_commands = ['list_cpu_features'] + +moduleclass = 'tools' diff --git a/easybuild/easyconfigs/l/Lightning/Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/l/Lightning/Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb new file mode 100644 index 000000000000..e5960d8f9af5 --- /dev/null +++ b/easybuild/easyconfigs/l/Lightning/Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb @@ -0,0 +1,29 @@ +easyblock = 'PythonPackage' + +name = 'Lightning' +version = '2.5.6' +versionsuffix = '-CUDA-%(cudaver)s' + +homepage = 'https://github.com/Lightning-AI/pytorch-lightning' +description = """ +The deep learning framework to pretrain, finetune and deploy AI models. +Lightning has 4 core packages: + PyTorch Lightning: Train and deploy PyTorch at scale. + Lightning Fabric: Expert control. + Lightning Data: Blazing fast, distributed streaming of training data from cloud storage. + Lightning Apps: Build AI products and ML workflows. +""" + +toolchain = {'name': 'foss', 'version': '2024a'} + +sources = [SOURCELOWER_TAR_GZ] +checksums = ['57b6abe87080895bc237fb7f36b7b4abaa2793760cbca00e3907e56607e0ed27'] + +dependencies = [ + ('CUDA', '12.6.0', '', SYSTEM), + ('Python', '3.12.3'), + ('PyTorch', '2.7.1', versionsuffix), + ('PyTorch-Lightning', version, versionsuffix), +] + +moduleclass = 'tools' diff --git a/easybuild/easyconfigs/o/ONNX-Runtime/ONNX-Runtime-1.23.2-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/o/ONNX-Runtime/ONNX-Runtime-1.23.2-foss-2024a-CUDA-12.6.0.eb new file mode 100644 index 000000000000..59546f166000 --- /dev/null +++ b/easybuild/easyconfigs/o/ONNX-Runtime/ONNX-Runtime-1.23.2-foss-2024a-CUDA-12.6.0.eb @@ -0,0 +1,91 @@ +easyblock = 'PythonBundle' + +name = 'ONNX-Runtime' +version = '1.23.2' +versionsuffix = '-CUDA-%(cudaver)s' + +homepage = 'https://onnxruntime.ai' +description = """ONNX Runtime inference can enable faster customer experiences and lower costs, +supporting models from deep learning frameworks such as PyTorch and +TensorFlow/Keras as well as classical machine learning libraries such as +scikit-learn, LightGBM, XGBoost, etc. ONNX Runtime is compatible with different +hardware, drivers, and operating systems, and provides optimal performance by +leveraging hardware accelerators where applicable alongside graph optimizations +and transforms.""" + +toolchain = {'name': 'foss', 'version': '2024a'} + +builddependencies = [ + ('CMake', '3.31.8'), + ('Ninja', '1.12.1'), + ('Eigen', '3.4.0'), +] +dependencies = [ + ('CUDA', '12.6.0', '', SYSTEM), + ('cuDNN', '9.5.1.17', versionsuffix, SYSTEM), + ('Python', '3.12.3'), + ('SciPy-bundle', '2024.05'), + ('ONNX', '1.20.0'), + ('flatbuffers-python', '24.3.25'), + ('sympy', '1.13.3'), + ('Abseil', '20240722.0'), +] + +# CUSTOM BUILD +local_onnx_buildcmd = "" +# do not fetch and install Abseil - use installed one from the module +# https://github.com/microsoft/onnxruntime/blob/v1.23.2/cmake/external/abseil-cpp.cmake#L39 +local_onnx_buildcmd += "sed -i 's/20250512/20240722/g' %(start_dir)s/cmake/external/abseil-cpp.cmake && " +# the build command for onnx-runtime wheels +# creates /build/Linux/Release/dist/onnxruntime-1.23.2-cp312-cp312-linux_x86_64.whl +local_onnx_buildcmd += """ +./build.sh \ +--config Release \ +--update --build \ +--parallel %(parallel)s \ +--use_cuda \ +--cuda_home="$EBROOTCUDA" \ +--cudnn_home="$EBROOTCUDNN" \ +--cuda_version=%(cudashortver)s \ +--skip_tests \ +--build_shared_lib \ +--build_wheel \ +--skip_submodule_sync \ +--cmake_generator Ninja \ +--compile_no_warning_as_error \ +--cmake_extra_defines \ +absl_DIR=$EBROOTABSEIL/lib/cmake/absl \ +"CMAKE_CUDA_ARCHITECTURES=%(cuda_cc_cmake)s" \ +ONNXRUNTIME_VERSION=%(version)s +""" + +exts_list = [ + ('humanfriendly', '10.0', { + 'checksums': ['6b0b831ce8f15f7300721aa49829fc4e83921a9a301cc7f606be6686a2288ddc'], + }), + ('coloredlogs', '15.0.1', { + 'checksums': ['7c991aa71a4577af2f82600d8f8f3a89f936baeaf9b50a9c197da014e5bf16b0'], + }), + (name, version, { + 'modulename': 'onnxruntime', + 'buildcmd': local_onnx_buildcmd, + 'install_src': '%(start_dir)s/build/Linux/Release/dist/*.whl', + 'source_urls': ['https://github.com/microsoft/onnxruntime/archive/'], + 'sources': [{'download_filename': 'v%(version)s.tar.gz', 'filename': SOURCE_TAR_GZ}], + 'patches': ['ONNX-Runtime-1.23.2_gpu-package-name.patch'], + 'checksums': [ + {'ONNX-Runtime-1.23.2.tar.gz': '99bcf964ce4e869d823c99b2294562a9050cbfa8e76ec81c8683cb3c7e19c2b4'}, + {'ONNX-Runtime-1.23.2_gpu-package-name.patch': + 'f0b80ae45878be371a1c5ef2b917dc34095af9351dfb379450b7be798f6d43bd'}, + ], + }), +] + +sanity_check_commands = ["python -c 'import onnxruntime; onnxruntime.get_available_providers()'"] + +sanity_check_paths = { + 'files': ['bin/onnxruntime_test'], + 'dirs': ['lib'], +} + +moduleclass = 'devel' diff --git a/easybuild/easyconfigs/o/ONNX-Runtime/ONNX-Runtime-1.23.2_gpu-package-name.patch b/easybuild/easyconfigs/o/ONNX-Runtime/ONNX-Runtime-1.23.2_gpu-package-name.patch new file mode 100644 index 000000000000..6fcf18c8cb4c --- /dev/null +++ b/easybuild/easyconfigs/o/ONNX-Runtime/ONNX-Runtime-1.23.2_gpu-package-name.patch @@ -0,0 +1,13 @@ +This patch fixes the name of the wheels and the package from onnxruntime-gpu to onnxruntime. +Author: Pavel Tomanek (Inuits) +--- setup.py.orig 2025-12-16 13:25:52.996185000 +0100 ++++ setup.py 2025-12-16 13:26:05.009368000 +0100 +@@ -797,7 +797,7 @@ + elif qnn_version: + f.write(f"qnn_version = '{qnn_version}'\n") + +- ++package_name = "onnxruntime" + save_build_and_package_info(package_name, version_number, cuda_version, rocm_version, qnn_version) + + extras_require = {} diff --git a/easybuild/easyconfigs/o/ONNX/ONNX-1.20.0-gfbf-2024a.eb b/easybuild/easyconfigs/o/ONNX/ONNX-1.20.0-gfbf-2024a.eb new file mode 100644 index 000000000000..a13cea0a64a6 --- /dev/null +++ b/easybuild/easyconfigs/o/ONNX/ONNX-1.20.0-gfbf-2024a.eb @@ -0,0 +1,46 @@ +easyblock = 'PythonPackage' + +name = 'ONNX' +version = '1.20.0' + +homepage = 'https://onnx.ai' +description = """ +Open Neural Network Exchange (ONNX) is an open ecosystem that empowers AI +developers to choose the right tools as their project evolves. ONNX provides an +open source format for AI models, both deep learning and traditional ML. It +defines an extensible computation graph model, as well as definitions of +built-in operators and standard data types. Currently we focus on the +capabilities needed for inferencing (scoring).""" + +toolchain = {'name': 'gfbf', 'version': '2024a'} + +sources = [SOURCELOWER_TAR_GZ] +checksums = ['1a93ec69996b4556062d552ed1aa0671978cfd3c17a40bf4c89a1ae169c6a4ad'] + +builddependencies = [ + ('CMake', '3.31.8'), +] + +dependencies = [ + ('Python', '3.12.3'), + ('SciPy-bundle', '2024.05'), + ('protobuf-python', '5.28.0'), + ('ml_dtypes', '0.5.0'), + ('setuptools', '80.9.0'), +] + +preinstallopts = "export CMAKE_ARGS='-DONNX_USE_PROTOBUF_SHARED_LIBS=ON' && " +preinstallopts += 'env MAX_JOBS="%(parallel)s"' + +sanity_check_paths = { + 'files': ['bin/check-model', 'bin/check-node', 'bin/backend-test-tools'], + 'dirs': ['lib/python%(pyshortver)s/site-packages'], +} + +sanity_check_commands = [ + ('check-model', '-h'), + ('check-node', '-h'), + ('backend-test-tools', '-h'), +] + +moduleclass = 'devel' diff --git a/easybuild/easyconfigs/p/PyTorch-Lightning/PyTorch-Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/p/PyTorch-Lightning/PyTorch-Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb new file mode 100644 index 000000000000..2ea29b7803b9 --- /dev/null +++ b/easybuild/easyconfigs/p/PyTorch-Lightning/PyTorch-Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb @@ -0,0 +1,45 @@ +easyblock = 'PythonBundle' + +name = 'PyTorch-Lightning' +version = '2.5.6' +versionsuffix = '-CUDA-%(cudaver)s' + +homepage = 'https://pytorchlightning.ai' +description = "PyTorch Lightning is the lightweight PyTorch wrapper for ML researchers." + +toolchain = {'name': 'foss', 'version': '2024a'} + +dependencies = [ + ('Python', '3.12.3'), + ('CUDA', '12.6.0', '', SYSTEM), + # dependencies from requirements/pytorch/base.txt + ('PyTorch', '2.7.1', versionsuffix), + ('tqdm', '4.66.5'), + ('PyYAML', '6.0.2'), + ('typing-extensions', '4.11.0'), + # optional dependencies from requirements/pytorch/extra.txt + ('bitsandbytes', '0.46.1', versionsuffix), + ('tensorboardX', '2.6.4'), + ('matplotlib', '3.9.2'), + ('Hydra', '1.3.2'), +] + +exts_list = [ + ('jsonargparse', '4.40.2', { + 'use_pip_extras': 'signatures,jsonnet', + 'checksums': ['91e775b4ffba72bc5bbdab39d2f3efeb8ca84285def706d534edeed621cf0cb7'], + }), + ('lightning-utilities', '0.15.2', { + 'source_tmpl': 'lightning_utilities-%(version)s.tar.gz', + 'checksums': ['cdf12f530214a63dacefd713f180d1ecf5d165338101617b4742e8f22c032e24'], + }), + ('torchmetrics', '1.8.2', { + 'checksums': ['cf64a901036bf107f17a524009eea7781c9c5315d130713aeca5747a686fe7a5'], + }), + ('pytorch-lightning', version, { + 'source_tmpl': 'pytorch_lightning-%(version)s.tar.gz', + 'checksums': ['c428faaceef74be50b870814d0d7e9f9c6ee748b8769a2afd3366bc69daf3a0f'], + }), +] + +moduleclass = 'ai' diff --git a/easybuild/easyconfigs/p/pyannote.audio/pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/p/pyannote.audio/pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb new file mode 100644 index 000000000000..09fe6b4980ff --- /dev/null +++ b/easybuild/easyconfigs/p/pyannote.audio/pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb @@ -0,0 +1,101 @@ +easyblock = 'PythonBundle' + +name = 'pyannote.audio' +version = '3.4.0' +versionsuffix = '-CUDA-%(cudaver)s' +local_pytorch_version = '2.7.1' + +homepage = 'https://github.com/pyannote' +description = "pyannote is an open-source toolkit for speaker diarization." + +toolchain = {'name': 'foss', 'version': '2024a'} + +builddependencies = [ + ('PDM', '2.18.2'), + ('Java', '21', '', SYSTEM), + ('CMake', '3.31.8'), +] +dependencies = [ + ('CUDA', '12.6.0', '', SYSTEM), + ('Python', '3.12.3'), + ('PyTorch', local_pytorch_version, versionsuffix), + ('torchaudio', local_pytorch_version, versionsuffix), + ('Lightning', '2.5.6', versionsuffix), + ('SciPy-bundle', '2024.05'), + ('tensorboardX', '2.6.4'), + ('Optuna', '4.1.0'), + ('einops', '0.8.1'), + ('ruamel.yaml', '0.18.6'), + ('huggingface_hub', '0.34.4'), + ('scikit-learn', '1.5.2'), + ('tqdm', '4.66.5'), + ('PyYAML', '6.0.2'), + ('SentencePiece', '0.2.1'), +] + +# fix versioneer.py for python 3.12 +local_preinstallopts_versioneer = ( + "sed -i -e 's/SafeConfigParser/ConfigParser/g' -e 's/readfp/read_file/g' versioneer.py && " +) + +exts_list = [ + ('primePy', '1.3', { + 'modulename': 'primePy', + 'checksums': ['25fd7e25344b0789a5984c75d89f054fcf1f180bef20c998e4befbac92de4669'], + }), + ('typer', '0.20.0', { + 'checksums': ['1aaf6494031793e4876fb0bacfa6a912b551cf43c1e63c800df8b1a866720c37'], + }), + ('torch_pitch_shift', '1.2.5', { + 'checksums': ['6e1c7531f08d0f407a4c55e5ff8385a41355c5c5d27ab7fa08632e51defbd0ed'], + }), + ('julius', '0.2.7', { + 'checksums': ['3c0f5f5306d7d6016fcc95196b274cae6f07e2c9596eed314e4e7641554fbb08'], + }), + ('torch_audiomentations', '0.12.0', { + 'checksums': ['b02d4c5eb86376986a53eb405cca5e34f370ea9284411237508e720c529f7888'], + }), + ('HyperPyYAML', '1.2.2', { + 'checksums': ['bdb734210d18770a262f500fe5755c7a44a5d3b91521b06e24f7a00a36ee0f87'], + }), + ('speechbrain', '1.0.3', { + 'checksums': ['fcab3c6e90012cecb1eed40ea235733b550137e73da6bfa2340ba191ec714052'], + }), + ('soundfile', '0.13.1', { + 'checksums': ['b2c68dab1e30297317080a5b43df57e302584c49e2942defdde0acccc53f0e5b'], + }), + ('semver', '3.0.4', { + 'checksums': ['afc7d8c584a5ed0a11033af086e8af226a9c0b206f313e0301f8dd7b6b589602'], + }), + ('pytorch-metric-learning', '2.9.0', { + 'checksums': ['27a626caf5e2876a0fd666605a78cb67ef7597e25d7a68c18053dd503830701f'], + }), + ('asteroid-filterbanks', '0.4.0', { + 'checksums': ['415f89d1dcf2b13b35f03f7a9370968ac4e6fa6800633c522dac992b283409b9'], + }), + ('omegaconf', '2.3.0', { + 'checksums': ['d5d4b6d29955cc50ad50c46dc269bcd92c6e00f5f90d23ab5fee7bfca4ba4cc7'], + }), + ('pyannote.core', '5.0.0', { + 'preinstallopts': local_preinstallopts_versioneer, + 'checksums': ['1a55bcc8bd680ba6be5fa53efa3b6f3d2cdd67144c07b6b4d8d66d5cb0d2096f'], + }), + ('pyannote.database', '5.1.3', { + 'checksums': ['0eaf64c1cc506718de60d2d702f1359b1ae7ff252ee3e4799f1c5e378cd52c31'], + }), + ('pyannote.metrics', '3.2.1', { + 'preinstallopts': local_preinstallopts_versioneer, + 'checksums': ['08024255a3550e96a8e9da4f5f4af326886548480de891414567c8900920ee5c'], + }), + ('pyannote.pipeline', '3.0.1', { + 'preinstallopts': local_preinstallopts_versioneer, + 'checksums': ['021794e26a2cf5d8fb5bb1835951e71f5fac33eb14e23dfb7468e16b1b805151'], + }), + (name, version, { + 'source_urls': ['https://github.com/pyannote/pyannote-audio/archive/'], + 'sources': [{'download_filename': '%(version)s.tar.gz', 'filename': SOURCE_TAR_GZ}], + 'checksums': ['9fc8b4c96457733945d399559c328e07237a037ab7151443a81fe8473ea104ab'], + }), +] + +moduleclass = 'tools' diff --git a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix_tests_gpu.patch b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix_tests_gpu.patch new file mode 100644 index 000000000000..dcaca9c14043 --- /dev/null +++ b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix_tests_gpu.patch @@ -0,0 +1,64 @@ +Increase the atol and rtol for tests that fail with some elements exceeding default tolerances on GPU +Remove failing version check for librosa-0.10.2.post1 +Author: Samuel Moors (Vrije Universiteit Brussel) + +diff -ur audio-2.6.0.orig/test/torchaudio_unittest/functional/librosa_compatibility_test_impl.py audio-2.6.0/test/torchaudio_unittest/functional/librosa_compatibility_test_impl.py +--- audio-2.6.0.orig/test/torchaudio_unittest/functional/librosa_compatibility_test_impl.py 2025-01-29 02:11:55.000000000 +0100 ++++ audio-2.6.0/test/torchaudio_unittest/functional/librosa_compatibility_test_impl.py 2025-12-03 16:55:39.426408000 +0100 +@@ -1,5 +1,4 @@ + import unittest +-from distutils.version import StrictVersion + + import torch + import torchaudio.functional as F +@@ -77,8 +76,6 @@ + def test_create_mel_fb( + self, n_mels=40, sample_rate=22050, n_fft=2048, fmin=0.0, fmax=8000.0, norm=None, mel_scale="htk" + ): +- if norm == "slaney" and StrictVersion(librosa.__version__) < StrictVersion("0.7.2"): +- self.skipTest("Test is known to fail with older versions of librosa.") + if self.device != "cpu": + self.skipTest("No need to run this test on CUDA") + +diff -ur audio-2.6.0.orig/test/torchaudio_unittest/transforms/batch_consistency_test.py audio-2.6.0/test/torchaudio_unittest/transforms/batch_consistency_test.py +--- audio-2.6.0.orig/test/torchaudio_unittest/transforms/batch_consistency_test.py 2025-01-29 02:11:55.000000000 +0100 ++++ audio-2.6.0/test/torchaudio_unittest/transforms/batch_consistency_test.py 2025-12-04 09:30:50.369565944 +0100 +@@ -89,7 +89,7 @@ + waveform = waveform.reshape(3, 2, -1) + transform = T.Spectrogram() + +- self.assert_batch_consistency(transform, waveform) ++ self.assert_batch_consistency(transform, waveform, atol=1e-7, rtol=1e-4) + + def test_batch_inverse_spectrogram(self): + waveform = common_utils.get_whitenoise(sample_rate=8000, duration=1, n_channels=6) +@@ -97,7 +97,7 @@ + specgram = specgram.reshape(3, 2, specgram.shape[-2], specgram.shape[-1]) + transform = T.InverseSpectrogram(n_fft=400) + +- self.assert_batch_consistency(transform, specgram) ++ self.assert_batch_consistency(transform, specgram, atol=1e-7, rtol=1e-3) + + def test_batch_melspectrogram(self): + waveform = common_utils.get_whitenoise(sample_rate=8000, duration=1, n_channels=6) +@@ -162,7 +162,7 @@ + waveform = waveform.reshape(3, 2, -1) + transform = T.PitchShift(sample_rate, n_steps, n_fft=400) + +- self.assert_batch_consistency(transform, waveform) ++ self.assert_batch_consistency(transform, waveform, atol=1e-5, rtol=1e-2) + + def test_batch_PSD(self): + waveform = common_utils.get_whitenoise(sample_rate=8000, duration=1, n_channels=6) +diff -ur audio-2.6.0.orig/test/torchaudio_unittest/functional/functional_impl.py audio-2.6.0/test/torchaudio_unittest/functional/functional_impl.py +--- audio-2.6.0.orig/test/torchaudio_unittest/functional/functional_impl.py 2025-01-29 02:11:55.000000000 +0100 ++++ audio-2.6.0/test/torchaudio_unittest/functional/functional_impl.py 2025-12-05 17:35:01.410008278 +0100 +@@ -68,7 +68,7 @@ + a_coeffs = torch.tensor([1, 0, 0, 0], dtype=self.dtype, device=self.device) + output_waveform = F.lfilter(waveform, a_coeffs, b_coeffs) + +- self.assertEqual(output_waveform[:, 3:], waveform[:, 0:-3], atol=1e-5, rtol=1e-5) ++ self.assertEqual(output_waveform[:, 3:], waveform[:, 0:-3], atol=1e-3, rtol=1e-3) + + def test_lfilter_clamp(self): + input_signal = torch.ones(1, 44100 * 1, dtype=self.dtype, device=self.device) \ No newline at end of file diff --git a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb new file mode 100644 index 000000000000..47e48e1a6992 --- /dev/null +++ b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb @@ -0,0 +1,71 @@ +easyblock = 'PythonBundle' + +name = 'torchaudio' +version = '2.7.1' +versionsuffix = '-CUDA-%(cudaver)s' + +homepage = 'https://github.com/pyannote' +description = "pyannote is an open-source toolkit for speaker diarization." + +toolchain = {'name': 'foss', 'version': '2024a'} + +builddependencies = [ + ('CMake', '3.31.8'), + ('Ninja', '1.12.1'), + ('parameterized', '0.9.0'), # for tests + ('scikit-learn', '1.5.2'), # for tests + ('librosa', '0.10.2.post1'), # for tests +] +dependencies = [ + ('CUDA', '12.6.0', '', SYSTEM), + ('Python', '3.12.3'), + ('PyTorch', version, versionsuffix), + ('FFmpeg', '7.0.2'), + ('SoX', '14.4.2'), +] + +local_preinstall_opts = ' '.join([ + 'USE_SYSTEM_LIBS=1', + 'USE_OPENMP=1', + 'USE_CUDA=1', + 'USE_CUDNN=1', + 'TORCH_CUDA_ARCH_LIST="%(cuda_cc_semicolon_sep)s"', + 'USE_FFMPEG=1', 'FFMPEG_ROOT="$EBROOTFFMPEG"', + 'CMAKE_BUILD_PARALLEL_LEVEL=%(parallel)s', +]) + +exts_list = [ + (name, version, { + 'installopts': '-v', + 'patches': [ + 'torchaudio-2.6.0_use_ffmpeg7.patch', + 'torchaudio-2.6.0_fix_tests_gpu.patch', + ], + 'preinstallopts': ( + 'unset BUILD_VERSION && rm -r third_party/{sox,ffmpeg/multi}; ' # runs twice when testinstall + 'BUILD_SOX=0 ' + ) + local_preinstall_opts, + 'source_urls': ['https://github.com/pytorch/audio/archive'], + 'sources': [{'download_filename': 'v%(version)s.tar.gz', 'filename': SOURCE_TAR_GZ}], + 'runtest': ( + 'export OMP_NUM_THREADS=%(parallel)s && ' + 'pytest test/torchaudio_unittest/' + ' -k "not TestProcessPoolExecutor"' # hang maybe related https://github.com/pytorch/audio/issues/1021 + '" and not FilterGraphWithCudaAccel"' # requires FFmpeg with CUDA support + '" and not kaldi_io_test"' # requires kaldi_io + '" and not test_dup_hw_acel"' # requires special render device permissions + '" and not test_h264_cuvid"' # requires special render device permissions + '" and not test_hevc_cuvid"' # requires special render device permissions + '" and not TestAutogradLfilterCUDA"' # requires PyTorch’s nondeterministic algorithms mode + ), + 'testinstall': True, + 'checksums': [ + {'torchaudio-2.7.1.tar.gz': 'fc8159476d1b3b5978d5e66746fc34be168170800ff4c5e356433d8c9c57cbea'}, + {'torchaudio-2.6.0_use_ffmpeg7.patch': '1a2f7505efee9852ef393e6f4583cef209ad302db241171bf41be8d4a88920bd'}, + {'torchaudio-2.6.0_fix_tests_gpu.patch': + '3a728b033c4d568934a127ac1d573a385eeea8326e111ecc5aafaff7b5407d59'}, + ], + }), +] + +moduleclass = 'ai' diff --git a/easybuild/easyconfigs/w/WhisperX/WhisperX-3.7.4-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/w/WhisperX/WhisperX-3.7.4-foss-2024a-CUDA-12.6.0.eb new file mode 100644 index 000000000000..2ab104e11040 --- /dev/null +++ b/easybuild/easyconfigs/w/WhisperX/WhisperX-3.7.4-foss-2024a-CUDA-12.6.0.eb @@ -0,0 +1,57 @@ +easyblock = 'PythonBundle' + +name = 'WhisperX' +version = '3.7.4' +versionsuffix = '-CUDA-%(cudaver)s' +local_pytorch_version = '2.7.1' + +homepage = 'https://github.com/m-bain/whisperx' +description = "Automatic Speech Recognition with Word-level Timestamps (& Diarization)." + +toolchain = {'name': 'foss', 'version': '2024a'} + +builddependencies = [('Cython', '3.0.10')] +dependencies = [ + ('CUDA', '12.6.0', '', SYSTEM), + ('Python', '3.12.3'), + ('PyTorch', '2.7.1', versionsuffix), + ('SciPy-bundle', '2024.05'), + ('CTranslate2', '4.5.0', versionsuffix), + ('NLTK', '3.9.1'), + ('Transformers', '4.55.0'), + ('FFmpeg', '7.0.2'), + ('ONNX-Runtime', '1.23.2', versionsuffix), + ('pyannote.audio', '3.4.0', versionsuffix), +] + +# unpin versions of dependencies in WhisperX +local_whisperx_preinstallopts = ( + "sed -E -i " + r""" '/^[[:space:]]*dependencies[[:space:]]*=[[:space:]]*[[]/""" + r""",/^[[:space:]]*]/{s/"([^"<>!=~;[:space:]]+)[^"]*"/"\1"/g}' """ + "pyproject.toml && " +) + +exts_list = [ + ('faster-whisper', '1.2.0', { + 'checksums': ['56b20d616a575049a79f33b04f02db0868ce38c5d057a0b816d36ca59a6d2598'], + }), + ('av', '14.0.1', { + 'checksums': ['2b0a17301af469ddaea46b5c1c982df1b7b5de8bc6c94cdc98cad4a67178c82a'], + }), + (name, version, { + 'preinstallopts': local_whisperx_preinstallopts, + 'source_urls': ['https://github.com/m-bain/whisperX/archive/'], + 'sources': [{'download_filename': 'v%(version)s.tar.gz', 'filename': SOURCE_TAR_GZ}], + 'checksums': ['ffe9ce94d8895e7ba6030f3cc35a357788a458462051422dda6428d2f95324a7'], + }), +] + +sanity_check_paths = { + 'files': ['bin/%(namelower)s'], + 'dirs': ['lib/python%(pyshortver)s/site-packages'], +} + +sanity_check_commands = ["%(namelower)s -h"] + +moduleclass = 'ai' From 18359bfec39bb9bcd7850baa807303a70e87f3dc Mon Sep 17 00:00:00 2001 From: Pavel Tomanek <99190809+pavelToman@users.noreply.github.com> Date: Wed, 7 Jan 2026 10:19:17 +0100 Subject: [PATCH 02/21] Update torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb - pretest export TF32-override --- .../t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb | 1 + 1 file changed, 1 insertion(+) diff --git a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb index 47e48e1a6992..fe7b9aef742f 100644 --- a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb @@ -49,6 +49,7 @@ exts_list = [ 'sources': [{'download_filename': 'v%(version)s.tar.gz', 'filename': SOURCE_TAR_GZ}], 'runtest': ( 'export OMP_NUM_THREADS=%(parallel)s && ' + 'export NVIDIA_TF32_OVERRIDE=0 && ' 'pytest test/torchaudio_unittest/' ' -k "not TestProcessPoolExecutor"' # hang maybe related https://github.com/pytorch/audio/issues/1021 '" and not FilterGraphWithCudaAccel"' # requires FFmpeg with CUDA support From c53dda308b88d932b57ef536f754956fe87c1fd8 Mon Sep 17 00:00:00 2001 From: Pavel Tomanek <99190809+pavelToman@users.noreply.github.com> Date: Thu, 8 Jan 2026 15:38:40 +0100 Subject: [PATCH 03/21] Update bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb --- .../bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb index 3b64a69686cf..99e15b245630 100644 --- a/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb @@ -30,7 +30,7 @@ dependencies = [ configopts = "-DCOMPUTE_BACKEND=cuda" # skip install step in CMakeMake, but we still need install step in extension -install_cmd = 'exit' +skipsteps = ['install'] exts_defaultclass = 'PythonPackage' exts_list = [ From f448ac3194605b5dc23900845889726640c7eb29 Mon Sep 17 00:00:00 2001 From: Pavel Tomanek <99190809+pavelToman@users.noreply.github.com> Date: Mon, 26 Jan 2026 09:39:50 +0100 Subject: [PATCH 04/21] Update bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb --- .../bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb index 99e15b245630..7bc426d032b0 100644 --- a/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb @@ -48,7 +48,7 @@ sanity_check_paths = { } sanity_check_commands = [ - "python -c 'import bitsandbytes'", + "python -c -s 'import bitsandbytes'", ] moduleclass = 'ai' From 8716884bfb5ac907e5fae3b0dfc2f3adad58af8e Mon Sep 17 00:00:00 2001 From: Pavel Tomanek <99190809+pavelToman@users.noreply.github.com> Date: Mon, 26 Jan 2026 09:40:29 +0100 Subject: [PATCH 05/21] Update CTranslate2-4.5.0-foss-2024a-CUDA-12.6.0.eb --- .../c/CTranslate2/CTranslate2-4.5.0-foss-2024a-CUDA-12.6.0.eb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easybuild/easyconfigs/c/CTranslate2/CTranslate2-4.5.0-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/c/CTranslate2/CTranslate2-4.5.0-foss-2024a-CUDA-12.6.0.eb index ce1e5782d7b3..be5a03e44078 100644 --- a/easybuild/easyconfigs/c/CTranslate2/CTranslate2-4.5.0-foss-2024a-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/c/CTranslate2/CTranslate2-4.5.0-foss-2024a-CUDA-12.6.0.eb @@ -82,8 +82,8 @@ sanity_check_paths = { sanity_check_commands = [ "ct2-translator --help", - "python -c 'import ctranslate2'", - "python -m pip check", + "python -c -s 'import ctranslate2'", + "python -m -s pip check", ] moduleclass = 'ai' From 64a0bef0c1fa34f519edf6f75322bb9a24215d7d Mon Sep 17 00:00:00 2001 From: Pavel Tomanek <99190809+pavelToman@users.noreply.github.com> Date: Mon, 26 Jan 2026 09:55:18 +0100 Subject: [PATCH 06/21] Update bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb --- .../bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb index 7bc426d032b0..e60e4ffeef07 100644 --- a/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb @@ -48,7 +48,7 @@ sanity_check_paths = { } sanity_check_commands = [ - "python -c -s 'import bitsandbytes'", + "python -s -c 'import bitsandbytes'", ] moduleclass = 'ai' From 1c18e8f1dda470b37566bb807577239dde0a8591 Mon Sep 17 00:00:00 2001 From: Pavel Tomanek <99190809+pavelToman@users.noreply.github.com> Date: Mon, 26 Jan 2026 09:55:49 +0100 Subject: [PATCH 07/21] Update CTranslate2-4.5.0-foss-2024a-CUDA-12.6.0.eb --- .../c/CTranslate2/CTranslate2-4.5.0-foss-2024a-CUDA-12.6.0.eb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easybuild/easyconfigs/c/CTranslate2/CTranslate2-4.5.0-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/c/CTranslate2/CTranslate2-4.5.0-foss-2024a-CUDA-12.6.0.eb index be5a03e44078..4f54771108a1 100644 --- a/easybuild/easyconfigs/c/CTranslate2/CTranslate2-4.5.0-foss-2024a-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/c/CTranslate2/CTranslate2-4.5.0-foss-2024a-CUDA-12.6.0.eb @@ -82,8 +82,8 @@ sanity_check_paths = { sanity_check_commands = [ "ct2-translator --help", - "python -c -s 'import ctranslate2'", - "python -m -s pip check", + "python -s -c 'import ctranslate2'", + "python -s -m pip check", ] moduleclass = 'ai' From 0da6206e3586557637e559cde37218fa3d475635 Mon Sep 17 00:00:00 2001 From: Pavel Tomanek <99190809+pavelToman@users.noreply.github.com> Date: Tue, 10 Feb 2026 11:28:15 +0100 Subject: [PATCH 08/21] Update torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb --- .../t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb index fe7b9aef742f..30e08c913e7b 100644 --- a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb @@ -4,8 +4,9 @@ name = 'torchaudio' version = '2.7.1' versionsuffix = '-CUDA-%(cudaver)s' -homepage = 'https://github.com/pyannote' -description = "pyannote is an open-source toolkit for speaker diarization." +homepage = 'https://github.com/pytorch/audio' +description = """Data manipulation and transformation for audio signal +processing, powered by PyTorch.""" toolchain = {'name': 'foss', 'version': '2024a'} From 334c3bba6d1fe1c4df5a8f5f32f5abdb129c07c9 Mon Sep 17 00:00:00 2001 From: pavelToman Date: Wed, 11 Feb 2026 19:06:57 +0100 Subject: [PATCH 09/21] update bitsandbytes.eb --- ...sandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb index e60e4ffeef07..7d291a694d8b 100644 --- a/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb @@ -6,10 +6,10 @@ versionsuffix = '-CUDA-%(cudaver)s' homepage = 'https://huggingface.co/docs/bitsandbytes/main/en/index' description = "bitsandbytes enables accessible large language models via k-bit quantization for PyTorch." -github_account = 'bitsandbytes-foundation' toolchain = {'name': 'foss', 'version': '2024a'} +github_account = '%(name)s-foundation' source_urls = [GITHUB_LOWER_SOURCE] sources = ['%(version)s.tar.gz'] checksums = ['8326835082ad5590e4eab2cc51129bf55dd1c16e3d3038bc23431371c24b47da'] @@ -35,20 +35,22 @@ skipsteps = ['install'] exts_defaultclass = 'PythonPackage' exts_list = [ (name, version, { - 'source_urls': ['https://github.com/%(github_account)s/%(namelower)s/archive'], - 'sources': ['%(version)s.tar.gz'], - 'start_dir': '%(builddir)s/bitsandbytes-%(version)s/', - 'checksums': ['8326835082ad5590e4eab2cc51129bf55dd1c16e3d3038bc23431371c24b47da'], + 'source_urls': source_urls, + 'sources': sources, + 'start_dir': '%(builddir)s/%(name)s-%(version)s/', + 'checksums': checksums, }), ] +local_python_package_path = 'lib/python%(pyshortver)s/site-packages/%(name)s' sanity_check_paths = { - 'files': [f'lib/python%(pyshortver)s/site-packages/bitsandbytes/libbitsandbytes_cpu.{SHLIB_EXT}'], + 'files': [ + f'{local_python_package_path}/lib%(name)s_cpu.{SHLIB_EXT}', + f'{local_python_package_path}/lib%(name)s_cuda%(cudamajver)s%(cudaminver)s.{SHLIB_EXT}', + ], 'dirs': ['lib/python%(pyshortver)s/site-packages'], } -sanity_check_commands = [ - "python -s -c 'import bitsandbytes'", -] +sanity_check_commands = ["python -s -c 'import %(name)s'"] moduleclass = 'ai' From f2ce17df6754090db7db29d8b7e9a7814258336a Mon Sep 17 00:00:00 2001 From: pavelToman Date: Thu, 12 Feb 2026 13:34:03 +0100 Subject: [PATCH 10/21] separate PR for Lightning --- ...sandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb | 56 ------------------- .../Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb | 29 ---------- ...-Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb | 45 --------------- 3 files changed, 130 deletions(-) delete mode 100644 easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb delete mode 100644 easybuild/easyconfigs/l/Lightning/Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb delete mode 100644 easybuild/easyconfigs/p/PyTorch-Lightning/PyTorch-Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb diff --git a/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb deleted file mode 100644 index 7d291a694d8b..000000000000 --- a/easybuild/easyconfigs/b/bitsandbytes/bitsandbytes-0.46.1-foss-2024a-CUDA-12.6.0.eb +++ /dev/null @@ -1,56 +0,0 @@ -easyblock = 'CMakeMake' - -name = 'bitsandbytes' -version = '0.46.1' -versionsuffix = '-CUDA-%(cudaver)s' - -homepage = 'https://huggingface.co/docs/bitsandbytes/main/en/index' -description = "bitsandbytes enables accessible large language models via k-bit quantization for PyTorch." - -toolchain = {'name': 'foss', 'version': '2024a'} - -github_account = '%(name)s-foundation' -source_urls = [GITHUB_LOWER_SOURCE] -sources = ['%(version)s.tar.gz'] -checksums = ['8326835082ad5590e4eab2cc51129bf55dd1c16e3d3038bc23431371c24b47da'] - -builddependencies = [ - ('CMake', '3.29.3'), - ('pkgconf', '2.2.0'), - ('scikit-build-core', '0.10.6'), -] - -dependencies = [ - ('CUDA', '12.6.0', '', SYSTEM), - ('Python', '3.12.3'), - ('PyTorch', '2.7.1', versionsuffix), - ('SciPy-bundle', '2024.05'), -] - -configopts = "-DCOMPUTE_BACKEND=cuda" - -# skip install step in CMakeMake, but we still need install step in extension -skipsteps = ['install'] - -exts_defaultclass = 'PythonPackage' -exts_list = [ - (name, version, { - 'source_urls': source_urls, - 'sources': sources, - 'start_dir': '%(builddir)s/%(name)s-%(version)s/', - 'checksums': checksums, - }), -] - -local_python_package_path = 'lib/python%(pyshortver)s/site-packages/%(name)s' -sanity_check_paths = { - 'files': [ - f'{local_python_package_path}/lib%(name)s_cpu.{SHLIB_EXT}', - f'{local_python_package_path}/lib%(name)s_cuda%(cudamajver)s%(cudaminver)s.{SHLIB_EXT}', - ], - 'dirs': ['lib/python%(pyshortver)s/site-packages'], -} - -sanity_check_commands = ["python -s -c 'import %(name)s'"] - -moduleclass = 'ai' diff --git a/easybuild/easyconfigs/l/Lightning/Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/l/Lightning/Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb deleted file mode 100644 index e5960d8f9af5..000000000000 --- a/easybuild/easyconfigs/l/Lightning/Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb +++ /dev/null @@ -1,29 +0,0 @@ -easyblock = 'PythonPackage' - -name = 'Lightning' -version = '2.5.6' -versionsuffix = '-CUDA-%(cudaver)s' - -homepage = 'https://github.com/Lightning-AI/pytorch-lightning' -description = """ -The deep learning framework to pretrain, finetune and deploy AI models. -Lightning has 4 core packages: - PyTorch Lightning: Train and deploy PyTorch at scale. - Lightning Fabric: Expert control. - Lightning Data: Blazing fast, distributed streaming of training data from cloud storage. - Lightning Apps: Build AI products and ML workflows. -""" - -toolchain = {'name': 'foss', 'version': '2024a'} - -sources = [SOURCELOWER_TAR_GZ] -checksums = ['57b6abe87080895bc237fb7f36b7b4abaa2793760cbca00e3907e56607e0ed27'] - -dependencies = [ - ('CUDA', '12.6.0', '', SYSTEM), - ('Python', '3.12.3'), - ('PyTorch', '2.7.1', versionsuffix), - ('PyTorch-Lightning', version, versionsuffix), -] - -moduleclass = 'tools' diff --git a/easybuild/easyconfigs/p/PyTorch-Lightning/PyTorch-Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/p/PyTorch-Lightning/PyTorch-Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb deleted file mode 100644 index 2ea29b7803b9..000000000000 --- a/easybuild/easyconfigs/p/PyTorch-Lightning/PyTorch-Lightning-2.5.6-foss-2024a-CUDA-12.6.0.eb +++ /dev/null @@ -1,45 +0,0 @@ -easyblock = 'PythonBundle' - -name = 'PyTorch-Lightning' -version = '2.5.6' -versionsuffix = '-CUDA-%(cudaver)s' - -homepage = 'https://pytorchlightning.ai' -description = "PyTorch Lightning is the lightweight PyTorch wrapper for ML researchers." - -toolchain = {'name': 'foss', 'version': '2024a'} - -dependencies = [ - ('Python', '3.12.3'), - ('CUDA', '12.6.0', '', SYSTEM), - # dependencies from requirements/pytorch/base.txt - ('PyTorch', '2.7.1', versionsuffix), - ('tqdm', '4.66.5'), - ('PyYAML', '6.0.2'), - ('typing-extensions', '4.11.0'), - # optional dependencies from requirements/pytorch/extra.txt - ('bitsandbytes', '0.46.1', versionsuffix), - ('tensorboardX', '2.6.4'), - ('matplotlib', '3.9.2'), - ('Hydra', '1.3.2'), -] - -exts_list = [ - ('jsonargparse', '4.40.2', { - 'use_pip_extras': 'signatures,jsonnet', - 'checksums': ['91e775b4ffba72bc5bbdab39d2f3efeb8ca84285def706d534edeed621cf0cb7'], - }), - ('lightning-utilities', '0.15.2', { - 'source_tmpl': 'lightning_utilities-%(version)s.tar.gz', - 'checksums': ['cdf12f530214a63dacefd713f180d1ecf5d165338101617b4742e8f22c032e24'], - }), - ('torchmetrics', '1.8.2', { - 'checksums': ['cf64a901036bf107f17a524009eea7781c9c5315d130713aeca5747a686fe7a5'], - }), - ('pytorch-lightning', version, { - 'source_tmpl': 'pytorch_lightning-%(version)s.tar.gz', - 'checksums': ['c428faaceef74be50b870814d0d7e9f9c6ee748b8769a2afd3366bc69daf3a0f'], - }), -] - -moduleclass = 'ai' From 71ab48dc314230f2d7310506208b72c34973086e Mon Sep 17 00:00:00 2001 From: pavelToman Date: Fri, 13 Feb 2026 11:08:33 +0100 Subject: [PATCH 11/21] ffmpeg with libvorbis patch fix + patch of tests --- .../torchaudio-2.6.0_fix_tests_gpu.patch | 143 +++++++++++++- .../torchaudio-2.6.0_use_ffmpeg7.patch | 175 +++++++++++------- ...torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb | 4 +- 3 files changed, 250 insertions(+), 72 deletions(-) diff --git a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix_tests_gpu.patch b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix_tests_gpu.patch index dcaca9c14043..e94f4e9c48a7 100644 --- a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix_tests_gpu.patch +++ b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix_tests_gpu.patch @@ -1,6 +1,9 @@ Increase the atol and rtol for tests that fail with some elements exceeding default tolerances on GPU Remove failing version check for librosa-0.10.2.post1 Author: Samuel Moors (Vrije Universiteit Brussel) +test/torchaudio_unittest/backend/dispatcher/ffmpeg/save_test.py patch introduce encoder fallback with libvorbis, +adaptive quality scaling (qscale) and numerical tolerance tuning (atol, rtol). +Author: Pavel Tomanek (Inuits/Ugent) diff -ur audio-2.6.0.orig/test/torchaudio_unittest/functional/librosa_compatibility_test_impl.py audio-2.6.0/test/torchaudio_unittest/functional/librosa_compatibility_test_impl.py --- audio-2.6.0.orig/test/torchaudio_unittest/functional/librosa_compatibility_test_impl.py 2025-01-29 02:11:55.000000000 +0100 @@ -61,4 +64,142 @@ diff -ur audio-2.6.0.orig/test/torchaudio_unittest/functional/functional_impl.py + self.assertEqual(output_waveform[:, 3:], waveform[:, 0:-3], atol=1e-3, rtol=1e-3) def test_lfilter_clamp(self): - input_signal = torch.ones(1, 44100 * 1, dtype=self.dtype, device=self.device) \ No newline at end of file + input_signal = torch.ones(1, 44100 * 1, dtype=self.dtype, device=self.device) + +diff --git a/test/torchaudio_unittest/backend/dispatcher/ffmpeg/save_test.py b/test/torchaudio_unittest/backend/dispatcher/ffmpeg/save_test.py +--- a/test/torchaudio_unittest/backend/dispatcher/ffmpeg/save_test.py ++++ b/test/torchaudio_unittest/backend/dispatcher/ffmpeg/save_test.py +@@ -27,17 +27,46 @@ + ) + + +-def _convert_audio_file(src_path, dst_path, muxer=None, encoder=None, sample_fmt=None): +- command = ["ffmpeg", "-hide_banner", "-y", "-i", src_path, "-strict", "-2"] +- if muxer: +- command += ["-f", muxer] +- if encoder: +- command += ["-acodec", encoder] ++def _convert_audio_file(src_path, dst_path, muxer=None, encoder=None, sample_fmt=None, qscale=None): ++ def add_common(cmd): ++ if muxer: ++ cmd += ["-f", muxer] ++ if encoder: ++ cmd += ["-acodec", encoder] ++ if qscale is not None: ++ if qscale >= 0 or (qscale == -1 and muxer == "ogg"): ++ cmd += ["-q:a", str(qscale)] ++ ++ base = ["ffmpeg", "-hide_banner", "-y", "-i", src_path, "-strict", "-2"] ++ add_common(base) ++ ++ # For ogg/vorbis, forcing s16 is known to fail with libvorbis (and often native too). ++ # Try: requested fmt -> fltp (ogg) -> no -sample_fmt ++ candidates = [] + if sample_fmt: +- command += ["-sample_fmt", sample_fmt] +- command += [dst_path] +- print(" ".join(command), file=sys.stderr) +- subprocess.run(command, check=True) ++ candidates.append(sample_fmt) ++ ++ if muxer == "ogg": ++ # Ensure fltp is tried for Vorbis-in-Ogg ++ candidates.append("fltp") ++ ++ candidates.append(None) ++ ++ last_err = None ++ for fmt in dict.fromkeys(candidates): # unique, keep order ++ cmd = list(base) ++ if fmt: ++ cmd += ["-sample_fmt", fmt] ++ cmd += [dst_path] ++ print(" ".join(cmd), file=sys.stderr) ++ try: ++ subprocess.run(cmd, check=True) ++ return ++ except subprocess.CalledProcessError as e: ++ last_err = e ++ continue ++ ++ raise last_err + + + class SaveTestBase(TempDirMixin, TorchaudioTestCase): +@@ -55,6 +84,8 @@ + num_frames: float = 3 * 8000, + src_dtype: str = "int32", + test_mode: str = "path", ++ atol: float = 1e-8, ++ rtol: float = 1e-5, + ): + """`save` function produces file that is comparable with `ffmpeg` command + +@@ -152,13 +183,16 @@ + + # 3.1. Convert the original wav to target format with ffmpeg + muxer, encoder, sample_fmt = _parse_save_args(ext, format, encoding, bits_per_sample) +- _convert_audio_file(src_path, sox_path, muxer=muxer, encoder=encoder, sample_fmt=sample_fmt) ++ qscale = None ++ if compression is not None: ++ qscale = getattr(compression, "qscale", None) ++ _convert_audio_file(src_path, sox_path, muxer=muxer, encoder=encoder, sample_fmt=sample_fmt, qscale=qscale) + # 3.2. Convert the target format to wav with ffmpeg + _convert_audio_file(sox_path, ref_path, encoder="pcm_f32le") + # 3.3. Load with SciPy + expected = load_wav(ref_path, normalize=False)[0] + +- self.assertEqual(found, expected) ++ self.assertEqual(found, expected, atol=atol, rtol=rtol) + + + @disabledInCI +@@ -229,8 +263,12 @@ + codec_config = CodecConfig( + compression_level=compression_level, + ) ++ atol, rtol = 1e-8, 1e-5 ++ if bits_per_sample == 24: ++ atol = 2**-22 # allow up to 2 LSB ++ rtol = 1e-5 + self.assert_save_consistency( +- "flac", compression=codec_config, bits_per_sample=bits_per_sample, test_mode=test_mode ++ "flac", compression=codec_config, bits_per_sample=bits_per_sample, test_mode=test_mode, atol=atol, rtol=rtol + ) + + # @nested_params( +@@ -259,7 +297,12 @@ + codec_config = CodecConfig( + qscale=quality_level, + ) +- self.assert_save_consistency("ogg", compression=codec_config, test_mode=test_mode) ++ atol = 1e-2 ++ rtol = 1e-2 ++ if quality_level == -1: ++ atol = 1e-1 ++ rtol = 1e-1 ++ self.assert_save_consistency("ogg", compression=codec_config, test_mode=test_mode, atol=atol, rtol=rtol) + + # @nested_params( + # ["path", "fileobj", "bytesio"], +@@ -367,6 +410,11 @@ + """`self._save` can save large files.""" + sample_rate = 8000 + one_hour = 60 * 60 * sample_rate ++ atol = 1e-8 ++ rtol = 1e-5 ++ if format == "ogg": ++ atol = 1e-2 ++ rtol = 1e-2 + self.assert_save_consistency( + format, + # NOTE: for ogg, ffmpeg only supports >= 2 channels +@@ -375,6 +423,8 @@ + num_frames=one_hour, + encoding=encoding, + bits_per_sample=bits_per_sample, ++ atol=atol, ++ rtol=rtol, + ) + + @parameterized.expand( diff --git a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_use_ffmpeg7.patch b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_use_ffmpeg7.patch index 101fa7ee7df3..6c015532de47 100644 --- a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_use_ffmpeg7.patch +++ b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_use_ffmpeg7.patch @@ -1,5 +1,7 @@ Update torchaudio to work with FFmpeg v7 Author: Samuel Moors (Vrije Universiteit Brussel) +Additional fix of encode_process.cpp: allow encoder sample_fmt fallback (e.g. s16 -> fltp for libvorbis) + diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/filter_graph.cpp audio-2.6.0/src/libtorio/ffmpeg/filter_graph.cpp --- audio-2.6.0.orig/src/libtorio/ffmpeg/filter_graph.cpp 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/libtorio/ffmpeg/filter_graph.cpp 2025-12-02 22:46:46.367838000 +0100 @@ -51,6 +53,7 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/filter_graph.cpp audio-2.6.0/src/l ret.num_channels = l->ch_layout.nb_channels; #else // Before FFmpeg 5.1 + diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/filter_graph.h audio-2.6.0/src/libtorio/ffmpeg/filter_graph.h --- audio-2.6.0.orig/src/libtorio/ffmpeg/filter_graph.h 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/libtorio/ffmpeg/filter_graph.h 2025-12-01 19:52:07.342909995 +0100 @@ -63,6 +66,7 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/filter_graph.h audio-2.6.0/src/lib void add_video_src( AVPixelFormat format, + diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/pybind/pybind.cpp audio-2.6.0/src/libtorio/ffmpeg/pybind/pybind.cpp --- audio-2.6.0.orig/src/libtorio/ffmpeg/pybind/pybind.cpp 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/libtorio/ffmpeg/pybind/pybind.cpp 2025-12-01 20:51:43.182687490 +0100 @@ -75,6 +79,7 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/pybind/pybind.cpp audio-2.6.0/src/ FileObj* fileobj = static_cast(opaque); buf_size = FFMIN(buf_size, fileobj->buffer_size); + diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/conversion.cpp audio-2.6.0/src/libtorio/ffmpeg/stream_reader/conversion.cpp --- audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/conversion.cpp 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/libtorio/ffmpeg/stream_reader/conversion.cpp 2025-12-01 12:07:48.943112806 +0100 @@ -87,6 +92,7 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/conversion.cpp audio constexpr int bps = []() { switch (dtype) { + diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/post_process.cpp audio-2.6.0/src/libtorio/ffmpeg/stream_reader/post_process.cpp --- audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/post_process.cpp 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/libtorio/ffmpeg/stream_reader/post_process.cpp 2025-12-01 20:02:13.873117462 +0100 @@ -99,6 +105,7 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/post_process.cpp aud const std::string& filter_desc) -> FilterGraph { FilterGraph f; f.add_audio_src(fmt, time_base, rate, channel_layout); + diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/stream_processor.cpp audio-2.6.0/src/libtorio/ffmpeg/stream_reader/stream_processor.cpp --- audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/stream_processor.cpp 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/libtorio/ffmpeg/stream_reader/stream_processor.cpp 2025-12-02 20:23:50.185425554 +0100 @@ -133,6 +140,7 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/stream_processor.cpp } else { frame->pts = frame->best_effort_timestamp; } + diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/stream_reader.cpp audio-2.6.0/src/libtorio/ffmpeg/stream_reader/stream_reader.cpp --- audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/stream_reader.cpp 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/libtorio/ffmpeg/stream_reader/stream_reader.cpp 2025-12-01 14:34:29.047656123 +0100 @@ -145,9 +153,10 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/stream_reader.cpp au break; } case AVMEDIA_TYPE_VIDEO: { + diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/encode_process.cpp audio-2.6.0/src/libtorio/ffmpeg/stream_writer/encode_process.cpp ---- audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/encode_process.cpp 2025-01-29 02:11:55.000000000 +0100 -+++ audio-2.6.0/src/libtorio/ffmpeg/stream_writer/encode_process.cpp 2025-12-03 15:21:12.403231996 +0100 +--- audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/encode_process.cpp ++++ audio-2.6.0/src/libtorio/ffmpeg/stream_writer/encode_process.cpp @@ -1,6 +1,8 @@ #include #include @@ -157,16 +166,71 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/encode_process.cpp a namespace torio::io { -@@ -311,20 +313,30 @@ +@@ -227,23 +229,39 @@ + const std::optional& encoder_format, + const AVCodec* codec) { + if (encoder_format) { +- auto& enc_fmt_val = encoder_format.value(); +- auto fmt = av_get_sample_fmt(enc_fmt_val.c_str()); +- TORCH_CHECK( +- fmt != AV_SAMPLE_FMT_NONE, "Unknown sample format: ", enc_fmt_val); +- TORCH_CHECK( +- supported_sample_fmt(fmt, codec->sample_fmts), +- codec->name, +- " does not support ", +- encoder_format.value(), +- " format. Supported values are; ", +- get_supported_formats(codec->sample_fmts)); ++ const auto& enc_fmt_val = encoder_format.value(); ++ AVSampleFormat fmt = av_get_sample_fmt(enc_fmt_val.c_str()); ++ TORCH_CHECK(fmt != AV_SAMPLE_FMT_NONE, "Unknown sample format: ", enc_fmt_val); ++ ++ if (supported_sample_fmt(fmt, codec->sample_fmts)) { ++ return fmt; ++ } ++ ++ // If codec has restrictions, fall back to its first supported format ++ // and rely on filter graph conversion. ++ if (codec->sample_fmts) { ++ TORCH_WARN_ONCE( ++ codec->name, ++ " does not support requested sample format ", ++ enc_fmt_val, ++ "; falling back to ", ++ av_get_sample_fmt_name(codec->sample_fmts[0]), ++ " and converting via filter graph."); ++ return codec->sample_fmts[0]; ++ } ++ ++ // If codec does not advertise supported formats, just use the requested one. + return fmt; + } +- if (codec->sample_fmts) { +- return codec->sample_fmts[0]; +- } +- return src_fmt; ++ ++ // No explicit encoder format requested: keep the source format if possible. ++ if (!codec->sample_fmts) { ++ return src_fmt; ++ } ++ if (supported_sample_fmt(src_fmt, codec->sample_fmts)) { ++ return src_fmt; ++ } ++ return codec->sample_fmts[0]; + }; + + bool supported_sample_rate(const int sample_rate, const AVCodec* codec) { +@@ -311,20 +329,28 @@ return src_sample_rate; } -std::string get_supported_channels(const uint64_t* channel_layouts) { -+// Helper to handle the "Describe" API which now requires a buffer +std::string describe_layout(const AVChannelLayout& layout) { -+ char buf[256]; -+ av_channel_layout_describe(&layout, buf, sizeof(buf)); -+ return std::string(buf); ++ char buf[256]; ++ int ret = av_channel_layout_describe(&layout, buf, sizeof(buf)); ++ TORCH_CHECK(ret >= 0, "Failed to describe channel layout: ", av_err2string(ret)); ++ return std::string(buf); +} + +std::string get_supported_channels(const AVChannelLayout* channel_layouts) { @@ -187,45 +251,38 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/encode_process.cpp a -uint64_t get_channel_layout( - const uint64_t src_ch_layout, -+// Return type changed from uint64_t to AVChannelLayout -+// Input src_ch_layout changed from uint64_t to const AVChannelLayout& +AVChannelLayout get_channel_layout( + const AVChannelLayout& src_ch_layout, const std::optional enc_num_channels, const AVCodec* codec) { // If the override is presented, and if it is supported by codec, we use it. -@@ -332,14 +344,20 @@ +@@ -332,11 +358,13 @@ const int& val = enc_num_channels.value(); TORCH_CHECK( val > 0, "The number of channels must be greater than 0. Found: ", val); - if (!codec->channel_layouts) { - return static_cast(av_get_default_channel_layout(val)); -+ -+ // Check if codec has specific supported layouts (ch_layouts replaces channel_layouts) +- } +- for (const uint64_t* it = codec->channel_layouts; *it; ++it) { +- if (av_get_channel_layout_nb_channels(*it) == val) { + if (!codec->ch_layouts) { + AVChannelLayout default_layout; + av_channel_layout_default(&default_layout, val); + return default_layout; - } -- for (const uint64_t* it = codec->channel_layouts; *it; ++it) { -- if (av_get_channel_layout_nb_channels(*it) == val) { -+ ++ } + for (const AVChannelLayout* it = codec->ch_layouts; it->nb_channels; ++it) { + if (it->nb_channels == val) { return *it; } } -+ - TORCH_CHECK( - false, - "Codec ", -@@ -347,35 +365,42 @@ +@@ -347,35 +375,41 @@ " does not support a channel layout consists of ", val, " channels. Supported values are: ", - get_supported_channels(codec->channel_layouts)); +- } + get_supported_channels(codec->ch_layouts)); - } ++ } + // If the codec does not have restriction on channel layout, we reuse the // source channel layout @@ -264,13 +321,12 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/encode_process.cpp a - codec_ctx->channel_layout = channel_layout; + + av_channel_layout_uninit(&codec_ctx->ch_layout); -+ + int ret = av_channel_layout_copy(&codec_ctx->ch_layout, &channel_layout); + TORCH_CHECK(ret >= 0, "Failed to set channel layout: ", av_err2string(ret)); // Set optional stuff if (codec_config) { -@@ -595,23 +620,33 @@ +@@ -595,11 +629,11 @@ FilterGraph get_audio_filter_graph( AVSampleFormat src_fmt, int src_sample_rate, @@ -284,22 +340,20 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/encode_process.cpp a int nb_samples) { const auto desc = [&]() -> const std::string { std::vector parts; - if (filter_desc) { +@@ -607,11 +641,19 @@ parts.push_back(filter_desc.value()); } -+ if (filter_desc || src_fmt != enc_fmt || - src_sample_rate != enc_sample_rate || src_ch_layout != enc_ch_layout) { -+ src_sample_rate != enc_sample_rate || av_channel_layout_compare(&src_ch_layout, &enc_ch_layout) != 0) { -+ ++ src_sample_rate != enc_sample_rate || ++ av_channel_layout_compare(&src_ch_layout, &enc_ch_layout) != 0) { + char ch_layout_str[128]; -+ int ret = av_channel_layout_describe(&enc_ch_layout, -+ ch_layout_str, -+ sizeof(ch_layout_str)); -+ TORCH_CHECK(ret >= 0, -+ "Failed to describe channel layout: ", -+ av_err2string(ret)); -+ ++ int ret = av_channel_layout_describe( ++ &enc_ch_layout, ch_layout_str, sizeof(ch_layout_str)); ++ TORCH_CHECK( ++ ret >= 0, ++ "Failed to describe channel layout: ", ++ av_err2string(ret)); std::stringstream ss; ss << "aformat=sample_fmts=" << av_get_sample_fmt_name(enc_fmt) - << ":sample_rates=" << enc_sample_rate << ":channel_layouts=0x" @@ -309,10 +363,11 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/encode_process.cpp a parts.push_back(ss.str()); } if (nb_samples > 0) { -@@ -697,20 +732,21 @@ +@@ -696,21 +738,17 @@ + AVFramePtr get_audio_frame( AVSampleFormat format, int sample_rate, - int num_channels, +- int num_channels, - uint64_t channel_layout, + AVChannelLayout channel_layout, int nb_samples) { @@ -321,77 +376,57 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/encode_process.cpp a - frame->channel_layout = channel_layout; frame->sample_rate = sample_rate; frame->nb_samples = nb_samples; -+ -+ frame ->ch_layout = channel_layout; -+ ++ frame->ch_layout = channel_layout; int ret = av_frame_get_buffer(frame, 0); TORCH_CHECK( ret >= 0, "Error allocating the source audio frame:", av_err2string(ret)); - // Note: `channels` attribute is not required for encoding, but - // TensorConverter refers to it +- // Note: `channels` attribute is not required for encoding, but +- // TensorConverter refers to it - frame->channels = num_channels; frame->pts = 0; return frame; } -@@ -767,8 +803,10 @@ +@@ -767,8 +805,8 @@ const AVSampleFormat src_fmt = (disable_converter) ? av_get_sample_fmt(format.c_str()) : get_src_sample_fmt(format); - const auto src_ch_layout = - static_cast(av_get_default_channel_layout(src_num_channels)); -+ -+ // CHANGE: Convert integer channel count to AVChannelLayout struct + AVChannelLayout src_ch_layout; + av_channel_layout_default(&src_ch_layout, src_num_channels); // 2. Fetch codec from default or override TORCH_CHECK( -@@ -780,7 +818,9 @@ +@@ -780,7 +818,7 @@ // 3. Check that encoding sample format, sample rate and channels const AVSampleFormat enc_fmt = get_enc_fmt(src_fmt, encoder_format, codec); const int enc_sr = get_enc_sr(src_sample_rate, encoder_sample_rate, codec); - const uint64_t enc_ch_layout = [&]() -> uint64_t { -+ -+ // CHANGE: Return type is now AVChannelLayout + const AVChannelLayout enc_ch_layout = [&]() -> AVChannelLayout { if (std::strcmp(codec->name, "vorbis") == 0) { // Special case for vorbis. // It only supports 2 channels, but it is not listed in channel_layouts -@@ -788,7 +828,10 @@ +@@ -788,7 +826,9 @@ // https://github.com/FFmpeg/FFmpeg/blob/0684e58886881a998f1a7b510d73600ff1df2b90/libavcodec/vorbisenc.c#L1277 // This is the case for at least until FFmpeg 6.0, so it will be // like this for a while. - return static_cast(av_get_default_channel_layout(2)); -+ // CHANGE: Use struct initialization for Vorbis default + AVChannelLayout layout; + av_channel_layout_default(&layout, 2); + return layout; } return get_channel_layout(src_ch_layout, encoder_num_channels, codec); }(); -@@ -796,11 +839,13 @@ - // 4. Initialize codec context - AVCodecContextPtr codec_ctx = - get_codec_ctx(codec, format_ctx->oformat->flags); -+ // CHANGE: You must ensure configure_audio_codec_ctx accepts AVChannelLayout now - configure_audio_codec_ctx( - codec_ctx, enc_fmt, enc_sr, enc_ch_layout, codec_config); - open_codec(codec_ctx, encoder_option); - - // 5. Build filter graph -+ // CHANGE: You must ensure get_audio_filter_graph accepts AVChannelLayout now - FilterGraph filter_graph = get_audio_filter_graph( - src_fmt, - src_sample_rate, -@@ -812,6 +857,7 @@ - codec_ctx->frame_size); - - // 6. Instantiate source frame -+ // CHANGE: You must ensure get_audio_frame accepts AVChannelLayout now +@@ -815,7 +855,6 @@ AVFramePtr src_frame = get_audio_frame( src_fmt, src_sample_rate, +- src_num_channels, + src_ch_layout, + codec_ctx->frame_size > 0 ? codec_ctx->frame_size : 256); + + diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/stream_writer.cpp audio-2.6.0/src/libtorio/ffmpeg/stream_writer/stream_writer.cpp --- audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/stream_writer.cpp 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/libtorio/ffmpeg/stream_writer/stream_writer.cpp 2025-12-01 14:11:58.947476037 +0100 @@ -422,6 +457,7 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/stream_writer.cpp au int64_t (*seek)(void* opaque, int64_t offset, int whence)) : CustomOutput(opaque, buffer_size, write_packet, seek), StreamingMediaEncoder(io_ctx, format) {} + diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/stream_writer.h audio-2.6.0/src/libtorio/ffmpeg/stream_writer/stream_writer.h --- audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/stream_writer.h 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/libtorio/ffmpeg/stream_writer/stream_writer.h 2025-12-01 14:12:52.557260048 +0100 @@ -473,6 +509,7 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/tensor_converter.cpp // https://ffmpeg.org/doxygen/4.1/muxing_8c_source.html#l00334 if (!av_frame_is_writable(buffer)) { + diff -ur audio-2.6.0.orig/src/torchaudio/io/_effector.py audio-2.6.0/src/torchaudio/io/_effector.py --- audio-2.6.0.orig/src/torchaudio/io/_effector.py 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/torchaudio/io/_effector.py 2025-12-03 16:36:30.536644472 +0100 diff --git a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb index 30e08c913e7b..71fad6b2c68a 100644 --- a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb @@ -63,9 +63,9 @@ exts_list = [ 'testinstall': True, 'checksums': [ {'torchaudio-2.7.1.tar.gz': 'fc8159476d1b3b5978d5e66746fc34be168170800ff4c5e356433d8c9c57cbea'}, - {'torchaudio-2.6.0_use_ffmpeg7.patch': '1a2f7505efee9852ef393e6f4583cef209ad302db241171bf41be8d4a88920bd'}, + {'torchaudio-2.6.0_use_ffmpeg7.patch': '9e52f964dd3fea61d9a13ffe91b85959029cfa1b6f97d5a02c8ecec3948837ea'}, {'torchaudio-2.6.0_fix_tests_gpu.patch': - '3a728b033c4d568934a127ac1d573a385eeea8326e111ecc5aafaff7b5407d59'}, + '42368cef5e9953e5e4fbb84dac7012d5b2797b4e7bd1493a44f9a7144d001587'}, ], }), ] From a22fbebd27deb84f45a678dc48bdcd6ab2a3a9cd Mon Sep 17 00:00:00 2001 From: jfgrimm Date: Fri, 13 Feb 2026 16:09:43 +0000 Subject: [PATCH 12/21] split encode_process fix into its own patch --- .../torchaudio-2.6.0_fix-encode-process.patch | 217 ++++++++++++++++++ .../torchaudio-2.6.0_use_ffmpeg7.patch | 175 ++++++-------- ...torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb | 5 +- 3 files changed, 290 insertions(+), 107 deletions(-) create mode 100644 easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix-encode-process.patch diff --git a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix-encode-process.patch b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix-encode-process.patch new file mode 100644 index 000000000000..d4e6c366ec59 --- /dev/null +++ b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix-encode-process.patch @@ -0,0 +1,217 @@ +Allow encoder sample_fmt fallback (e.g. s16 -> fltp for libvorbis) +Author: Pavel Tomanek (Inuits/Ugent) +------------------------------------------------------------------ +diff -Nru audio-2.6.0.p1/src/libtorio/ffmpeg/stream_writer/encode_process.cpp audio-2.6.0/src/libtorio/ffmpeg/stream_writer/encode_process.cpp +--- audio-2.6.0.p1/src/libtorio/ffmpeg/stream_writer/encode_process.cpp 2026-02-13 15:55:06.105338831 +0000 ++++ audio-2.6.0/src/libtorio/ffmpeg/stream_writer/encode_process.cpp 2026-02-13 15:55:29.426444845 +0000 +@@ -229,23 +229,39 @@ + const std::optional& encoder_format, + const AVCodec* codec) { + if (encoder_format) { +- auto& enc_fmt_val = encoder_format.value(); +- auto fmt = av_get_sample_fmt(enc_fmt_val.c_str()); +- TORCH_CHECK( +- fmt != AV_SAMPLE_FMT_NONE, "Unknown sample format: ", enc_fmt_val); +- TORCH_CHECK( +- supported_sample_fmt(fmt, codec->sample_fmts), +- codec->name, +- " does not support ", +- encoder_format.value(), +- " format. Supported values are; ", +- get_supported_formats(codec->sample_fmts)); ++ const auto& enc_fmt_val = encoder_format.value(); ++ AVSampleFormat fmt = av_get_sample_fmt(enc_fmt_val.c_str()); ++ TORCH_CHECK(fmt != AV_SAMPLE_FMT_NONE, "Unknown sample format: ", enc_fmt_val); ++ ++ if (supported_sample_fmt(fmt, codec->sample_fmts)) { ++ return fmt; ++ } ++ ++ // If codec has restrictions, fall back to its first supported format ++ // and rely on filter graph conversion. ++ if (codec->sample_fmts) { ++ TORCH_WARN_ONCE( ++ codec->name, ++ " does not support requested sample format ", ++ enc_fmt_val, ++ "; falling back to ", ++ av_get_sample_fmt_name(codec->sample_fmts[0]), ++ " and converting via filter graph."); ++ return codec->sample_fmts[0]; ++ } ++ ++ // If codec does not advertise supported formats, just use the requested one. + return fmt; + } +- if (codec->sample_fmts) { +- return codec->sample_fmts[0]; ++ ++ // No explicit encoder format requested: keep the source format if possible. ++ if (!codec->sample_fmts) { ++ return src_fmt; + } +- return src_fmt; ++ if (supported_sample_fmt(src_fmt, codec->sample_fmts)) { ++ return src_fmt; ++ } ++ return codec->sample_fmts[0]; + }; + + bool supported_sample_rate(const int sample_rate, const AVCodec* codec) { +@@ -313,11 +329,11 @@ + return src_sample_rate; + } + +-// Helper to handle the "Describe" API which now requires a buffer + std::string describe_layout(const AVChannelLayout& layout) { +- char buf[256]; +- av_channel_layout_describe(&layout, buf, sizeof(buf)); +- return std::string(buf); ++ char buf[256]; ++ int ret = av_channel_layout_describe(&layout, buf, sizeof(buf)); ++ TORCH_CHECK(ret >= 0, "Failed to describe channel layout: ", av_err2string(ret)); ++ return std::string(buf); + } + + std::string get_supported_channels(const AVChannelLayout* channel_layouts) { +@@ -333,8 +349,6 @@ + return c10::Join(", ", names); + } + +-// Return type changed from uint64_t to AVChannelLayout +-// Input src_ch_layout changed from uint64_t to const AVChannelLayout& + AVChannelLayout get_channel_layout( + const AVChannelLayout& src_ch_layout, + const std::optional enc_num_channels, +@@ -344,20 +358,16 @@ + const int& val = enc_num_channels.value(); + TORCH_CHECK( + val > 0, "The number of channels must be greater than 0. Found: ", val); +- +- // Check if codec has specific supported layouts (ch_layouts replaces channel_layouts) + if (!codec->ch_layouts) { + AVChannelLayout default_layout; + av_channel_layout_default(&default_layout, val); + return default_layout; + } +- + for (const AVChannelLayout* it = codec->ch_layouts; it->nb_channels; ++it) { + if (it->nb_channels == val) { + return *it; + } + } +- + TORCH_CHECK( + false, + "Codec ", +@@ -398,7 +408,6 @@ + codec_ctx->time_base = av_inv_q(av_d2q(sample_rate, 1 << 24)); + + av_channel_layout_uninit(&codec_ctx->ch_layout); +- + int ret = av_channel_layout_copy(&codec_ctx->ch_layout, &channel_layout); + TORCH_CHECK(ret >= 0, "Failed to set channel layout: ", av_err2string(ret)); + +@@ -631,18 +640,16 @@ + if (filter_desc) { + parts.push_back(filter_desc.value()); + } +- + if (filter_desc || src_fmt != enc_fmt || +- src_sample_rate != enc_sample_rate || av_channel_layout_compare(&src_ch_layout, &enc_ch_layout) != 0) { +- ++ src_sample_rate != enc_sample_rate || ++ av_channel_layout_compare(&src_ch_layout, &enc_ch_layout) != 0) { + char ch_layout_str[128]; +- int ret = av_channel_layout_describe(&enc_ch_layout, +- ch_layout_str, +- sizeof(ch_layout_str)); +- TORCH_CHECK(ret >= 0, +- "Failed to describe channel layout: ", +- av_err2string(ret)); +- ++ int ret = av_channel_layout_describe( ++ &enc_ch_layout, ch_layout_str, sizeof(ch_layout_str)); ++ TORCH_CHECK( ++ ret >= 0, ++ "Failed to describe channel layout: ", ++ av_err2string(ret)); + std::stringstream ss; + ss << "aformat=sample_fmts=" << av_get_sample_fmt_name(enc_fmt) + << ":sample_rates=" << enc_sample_rate << ":channel_layouts=" +@@ -731,22 +738,17 @@ + AVFramePtr get_audio_frame( + AVSampleFormat format, + int sample_rate, +- int num_channels, + AVChannelLayout channel_layout, + int nb_samples) { + AVFramePtr frame{alloc_avframe()}; + frame->format = format; + frame->sample_rate = sample_rate; + frame->nb_samples = nb_samples; +- +- frame ->ch_layout = channel_layout; +- ++ frame->ch_layout = channel_layout; + int ret = av_frame_get_buffer(frame, 0); + TORCH_CHECK( + ret >= 0, "Error allocating the source audio frame:", av_err2string(ret)); + +- // Note: `channels` attribute is not required for encoding, but +- // TensorConverter refers to it + frame->pts = 0; + return frame; + } +@@ -803,8 +805,6 @@ + const AVSampleFormat src_fmt = (disable_converter) + ? av_get_sample_fmt(format.c_str()) + : get_src_sample_fmt(format); +- +- // CHANGE: Convert integer channel count to AVChannelLayout struct + AVChannelLayout src_ch_layout; + av_channel_layout_default(&src_ch_layout, src_num_channels); + +@@ -818,8 +818,6 @@ + // 3. Check that encoding sample format, sample rate and channels + const AVSampleFormat enc_fmt = get_enc_fmt(src_fmt, encoder_format, codec); + const int enc_sr = get_enc_sr(src_sample_rate, encoder_sample_rate, codec); +- +- // CHANGE: Return type is now AVChannelLayout + const AVChannelLayout enc_ch_layout = [&]() -> AVChannelLayout { + if (std::strcmp(codec->name, "vorbis") == 0) { + // Special case for vorbis. +@@ -828,7 +826,6 @@ + // https://github.com/FFmpeg/FFmpeg/blob/0684e58886881a998f1a7b510d73600ff1df2b90/libavcodec/vorbisenc.c#L1277 + // This is the case for at least until FFmpeg 6.0, so it will be + // like this for a while. +- // CHANGE: Use struct initialization for Vorbis default + AVChannelLayout layout; + av_channel_layout_default(&layout, 2); + return layout; +@@ -839,13 +836,11 @@ + // 4. Initialize codec context + AVCodecContextPtr codec_ctx = + get_codec_ctx(codec, format_ctx->oformat->flags); +- // CHANGE: You must ensure configure_audio_codec_ctx accepts AVChannelLayout now + configure_audio_codec_ctx( + codec_ctx, enc_fmt, enc_sr, enc_ch_layout, codec_config); + open_codec(codec_ctx, encoder_option); + + // 5. Build filter graph +- // CHANGE: You must ensure get_audio_filter_graph accepts AVChannelLayout now + FilterGraph filter_graph = get_audio_filter_graph( + src_fmt, + src_sample_rate, +@@ -857,11 +852,9 @@ + codec_ctx->frame_size); + + // 6. Instantiate source frame +- // CHANGE: You must ensure get_audio_frame accepts AVChannelLayout now + AVFramePtr src_frame = get_audio_frame( + src_fmt, + src_sample_rate, +- src_num_channels, + src_ch_layout, + codec_ctx->frame_size > 0 ? codec_ctx->frame_size : 256); + diff --git a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_use_ffmpeg7.patch b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_use_ffmpeg7.patch index 6c015532de47..101fa7ee7df3 100644 --- a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_use_ffmpeg7.patch +++ b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_use_ffmpeg7.patch @@ -1,7 +1,5 @@ Update torchaudio to work with FFmpeg v7 Author: Samuel Moors (Vrije Universiteit Brussel) -Additional fix of encode_process.cpp: allow encoder sample_fmt fallback (e.g. s16 -> fltp for libvorbis) - diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/filter_graph.cpp audio-2.6.0/src/libtorio/ffmpeg/filter_graph.cpp --- audio-2.6.0.orig/src/libtorio/ffmpeg/filter_graph.cpp 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/libtorio/ffmpeg/filter_graph.cpp 2025-12-02 22:46:46.367838000 +0100 @@ -53,7 +51,6 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/filter_graph.cpp audio-2.6.0/src/l ret.num_channels = l->ch_layout.nb_channels; #else // Before FFmpeg 5.1 - diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/filter_graph.h audio-2.6.0/src/libtorio/ffmpeg/filter_graph.h --- audio-2.6.0.orig/src/libtorio/ffmpeg/filter_graph.h 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/libtorio/ffmpeg/filter_graph.h 2025-12-01 19:52:07.342909995 +0100 @@ -66,7 +63,6 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/filter_graph.h audio-2.6.0/src/lib void add_video_src( AVPixelFormat format, - diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/pybind/pybind.cpp audio-2.6.0/src/libtorio/ffmpeg/pybind/pybind.cpp --- audio-2.6.0.orig/src/libtorio/ffmpeg/pybind/pybind.cpp 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/libtorio/ffmpeg/pybind/pybind.cpp 2025-12-01 20:51:43.182687490 +0100 @@ -79,7 +75,6 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/pybind/pybind.cpp audio-2.6.0/src/ FileObj* fileobj = static_cast(opaque); buf_size = FFMIN(buf_size, fileobj->buffer_size); - diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/conversion.cpp audio-2.6.0/src/libtorio/ffmpeg/stream_reader/conversion.cpp --- audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/conversion.cpp 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/libtorio/ffmpeg/stream_reader/conversion.cpp 2025-12-01 12:07:48.943112806 +0100 @@ -92,7 +87,6 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/conversion.cpp audio constexpr int bps = []() { switch (dtype) { - diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/post_process.cpp audio-2.6.0/src/libtorio/ffmpeg/stream_reader/post_process.cpp --- audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/post_process.cpp 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/libtorio/ffmpeg/stream_reader/post_process.cpp 2025-12-01 20:02:13.873117462 +0100 @@ -105,7 +99,6 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/post_process.cpp aud const std::string& filter_desc) -> FilterGraph { FilterGraph f; f.add_audio_src(fmt, time_base, rate, channel_layout); - diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/stream_processor.cpp audio-2.6.0/src/libtorio/ffmpeg/stream_reader/stream_processor.cpp --- audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/stream_processor.cpp 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/libtorio/ffmpeg/stream_reader/stream_processor.cpp 2025-12-02 20:23:50.185425554 +0100 @@ -140,7 +133,6 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/stream_processor.cpp } else { frame->pts = frame->best_effort_timestamp; } - diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/stream_reader.cpp audio-2.6.0/src/libtorio/ffmpeg/stream_reader/stream_reader.cpp --- audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/stream_reader.cpp 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/libtorio/ffmpeg/stream_reader/stream_reader.cpp 2025-12-01 14:34:29.047656123 +0100 @@ -153,10 +145,9 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_reader/stream_reader.cpp au break; } case AVMEDIA_TYPE_VIDEO: { - diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/encode_process.cpp audio-2.6.0/src/libtorio/ffmpeg/stream_writer/encode_process.cpp ---- audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/encode_process.cpp -+++ audio-2.6.0/src/libtorio/ffmpeg/stream_writer/encode_process.cpp +--- audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/encode_process.cpp 2025-01-29 02:11:55.000000000 +0100 ++++ audio-2.6.0/src/libtorio/ffmpeg/stream_writer/encode_process.cpp 2025-12-03 15:21:12.403231996 +0100 @@ -1,6 +1,8 @@ #include #include @@ -166,71 +157,16 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/encode_process.cpp a namespace torio::io { -@@ -227,23 +229,39 @@ - const std::optional& encoder_format, - const AVCodec* codec) { - if (encoder_format) { -- auto& enc_fmt_val = encoder_format.value(); -- auto fmt = av_get_sample_fmt(enc_fmt_val.c_str()); -- TORCH_CHECK( -- fmt != AV_SAMPLE_FMT_NONE, "Unknown sample format: ", enc_fmt_val); -- TORCH_CHECK( -- supported_sample_fmt(fmt, codec->sample_fmts), -- codec->name, -- " does not support ", -- encoder_format.value(), -- " format. Supported values are; ", -- get_supported_formats(codec->sample_fmts)); -+ const auto& enc_fmt_val = encoder_format.value(); -+ AVSampleFormat fmt = av_get_sample_fmt(enc_fmt_val.c_str()); -+ TORCH_CHECK(fmt != AV_SAMPLE_FMT_NONE, "Unknown sample format: ", enc_fmt_val); -+ -+ if (supported_sample_fmt(fmt, codec->sample_fmts)) { -+ return fmt; -+ } -+ -+ // If codec has restrictions, fall back to its first supported format -+ // and rely on filter graph conversion. -+ if (codec->sample_fmts) { -+ TORCH_WARN_ONCE( -+ codec->name, -+ " does not support requested sample format ", -+ enc_fmt_val, -+ "; falling back to ", -+ av_get_sample_fmt_name(codec->sample_fmts[0]), -+ " and converting via filter graph."); -+ return codec->sample_fmts[0]; -+ } -+ -+ // If codec does not advertise supported formats, just use the requested one. - return fmt; - } -- if (codec->sample_fmts) { -- return codec->sample_fmts[0]; -- } -- return src_fmt; -+ -+ // No explicit encoder format requested: keep the source format if possible. -+ if (!codec->sample_fmts) { -+ return src_fmt; -+ } -+ if (supported_sample_fmt(src_fmt, codec->sample_fmts)) { -+ return src_fmt; -+ } -+ return codec->sample_fmts[0]; - }; - - bool supported_sample_rate(const int sample_rate, const AVCodec* codec) { -@@ -311,20 +329,28 @@ +@@ -311,20 +313,30 @@ return src_sample_rate; } -std::string get_supported_channels(const uint64_t* channel_layouts) { ++// Helper to handle the "Describe" API which now requires a buffer +std::string describe_layout(const AVChannelLayout& layout) { -+ char buf[256]; -+ int ret = av_channel_layout_describe(&layout, buf, sizeof(buf)); -+ TORCH_CHECK(ret >= 0, "Failed to describe channel layout: ", av_err2string(ret)); -+ return std::string(buf); ++ char buf[256]; ++ av_channel_layout_describe(&layout, buf, sizeof(buf)); ++ return std::string(buf); +} + +std::string get_supported_channels(const AVChannelLayout* channel_layouts) { @@ -251,38 +187,45 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/encode_process.cpp a -uint64_t get_channel_layout( - const uint64_t src_ch_layout, ++// Return type changed from uint64_t to AVChannelLayout ++// Input src_ch_layout changed from uint64_t to const AVChannelLayout& +AVChannelLayout get_channel_layout( + const AVChannelLayout& src_ch_layout, const std::optional enc_num_channels, const AVCodec* codec) { // If the override is presented, and if it is supported by codec, we use it. -@@ -332,11 +358,13 @@ +@@ -332,14 +344,20 @@ const int& val = enc_num_channels.value(); TORCH_CHECK( val > 0, "The number of channels must be greater than 0. Found: ", val); - if (!codec->channel_layouts) { - return static_cast(av_get_default_channel_layout(val)); -- } -- for (const uint64_t* it = codec->channel_layouts; *it; ++it) { -- if (av_get_channel_layout_nb_channels(*it) == val) { ++ ++ // Check if codec has specific supported layouts (ch_layouts replaces channel_layouts) + if (!codec->ch_layouts) { + AVChannelLayout default_layout; + av_channel_layout_default(&default_layout, val); + return default_layout; -+ } + } +- for (const uint64_t* it = codec->channel_layouts; *it; ++it) { +- if (av_get_channel_layout_nb_channels(*it) == val) { ++ + for (const AVChannelLayout* it = codec->ch_layouts; it->nb_channels; ++it) { + if (it->nb_channels == val) { return *it; } } -@@ -347,35 +375,41 @@ ++ + TORCH_CHECK( + false, + "Codec ", +@@ -347,35 +365,42 @@ " does not support a channel layout consists of ", val, " channels. Supported values are: ", - get_supported_channels(codec->channel_layouts)); -- } + get_supported_channels(codec->ch_layouts)); -+ } + } + // If the codec does not have restriction on channel layout, we reuse the // source channel layout @@ -321,12 +264,13 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/encode_process.cpp a - codec_ctx->channel_layout = channel_layout; + + av_channel_layout_uninit(&codec_ctx->ch_layout); ++ + int ret = av_channel_layout_copy(&codec_ctx->ch_layout, &channel_layout); + TORCH_CHECK(ret >= 0, "Failed to set channel layout: ", av_err2string(ret)); // Set optional stuff if (codec_config) { -@@ -595,11 +629,11 @@ +@@ -595,23 +620,33 @@ FilterGraph get_audio_filter_graph( AVSampleFormat src_fmt, int src_sample_rate, @@ -340,20 +284,22 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/encode_process.cpp a int nb_samples) { const auto desc = [&]() -> const std::string { std::vector parts; -@@ -607,11 +641,19 @@ + if (filter_desc) { parts.push_back(filter_desc.value()); } ++ if (filter_desc || src_fmt != enc_fmt || - src_sample_rate != enc_sample_rate || src_ch_layout != enc_ch_layout) { -+ src_sample_rate != enc_sample_rate || -+ av_channel_layout_compare(&src_ch_layout, &enc_ch_layout) != 0) { ++ src_sample_rate != enc_sample_rate || av_channel_layout_compare(&src_ch_layout, &enc_ch_layout) != 0) { ++ + char ch_layout_str[128]; -+ int ret = av_channel_layout_describe( -+ &enc_ch_layout, ch_layout_str, sizeof(ch_layout_str)); -+ TORCH_CHECK( -+ ret >= 0, -+ "Failed to describe channel layout: ", -+ av_err2string(ret)); ++ int ret = av_channel_layout_describe(&enc_ch_layout, ++ ch_layout_str, ++ sizeof(ch_layout_str)); ++ TORCH_CHECK(ret >= 0, ++ "Failed to describe channel layout: ", ++ av_err2string(ret)); ++ std::stringstream ss; ss << "aformat=sample_fmts=" << av_get_sample_fmt_name(enc_fmt) - << ":sample_rates=" << enc_sample_rate << ":channel_layouts=0x" @@ -363,11 +309,10 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/encode_process.cpp a parts.push_back(ss.str()); } if (nb_samples > 0) { -@@ -696,21 +738,17 @@ - AVFramePtr get_audio_frame( +@@ -697,20 +732,21 @@ AVSampleFormat format, int sample_rate, -- int num_channels, + int num_channels, - uint64_t channel_layout, + AVChannelLayout channel_layout, int nb_samples) { @@ -376,57 +321,77 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/encode_process.cpp a - frame->channel_layout = channel_layout; frame->sample_rate = sample_rate; frame->nb_samples = nb_samples; -+ frame->ch_layout = channel_layout; ++ ++ frame ->ch_layout = channel_layout; ++ int ret = av_frame_get_buffer(frame, 0); TORCH_CHECK( ret >= 0, "Error allocating the source audio frame:", av_err2string(ret)); -- // Note: `channels` attribute is not required for encoding, but -- // TensorConverter refers to it + // Note: `channels` attribute is not required for encoding, but + // TensorConverter refers to it - frame->channels = num_channels; frame->pts = 0; return frame; } -@@ -767,8 +805,8 @@ +@@ -767,8 +803,10 @@ const AVSampleFormat src_fmt = (disable_converter) ? av_get_sample_fmt(format.c_str()) : get_src_sample_fmt(format); - const auto src_ch_layout = - static_cast(av_get_default_channel_layout(src_num_channels)); ++ ++ // CHANGE: Convert integer channel count to AVChannelLayout struct + AVChannelLayout src_ch_layout; + av_channel_layout_default(&src_ch_layout, src_num_channels); // 2. Fetch codec from default or override TORCH_CHECK( -@@ -780,7 +818,7 @@ +@@ -780,7 +818,9 @@ // 3. Check that encoding sample format, sample rate and channels const AVSampleFormat enc_fmt = get_enc_fmt(src_fmt, encoder_format, codec); const int enc_sr = get_enc_sr(src_sample_rate, encoder_sample_rate, codec); - const uint64_t enc_ch_layout = [&]() -> uint64_t { ++ ++ // CHANGE: Return type is now AVChannelLayout + const AVChannelLayout enc_ch_layout = [&]() -> AVChannelLayout { if (std::strcmp(codec->name, "vorbis") == 0) { // Special case for vorbis. // It only supports 2 channels, but it is not listed in channel_layouts -@@ -788,7 +826,9 @@ +@@ -788,7 +828,10 @@ // https://github.com/FFmpeg/FFmpeg/blob/0684e58886881a998f1a7b510d73600ff1df2b90/libavcodec/vorbisenc.c#L1277 // This is the case for at least until FFmpeg 6.0, so it will be // like this for a while. - return static_cast(av_get_default_channel_layout(2)); ++ // CHANGE: Use struct initialization for Vorbis default + AVChannelLayout layout; + av_channel_layout_default(&layout, 2); + return layout; } return get_channel_layout(src_ch_layout, encoder_num_channels, codec); }(); -@@ -815,7 +855,6 @@ - AVFramePtr src_frame = get_audio_frame( +@@ -796,11 +839,13 @@ + // 4. Initialize codec context + AVCodecContextPtr codec_ctx = + get_codec_ctx(codec, format_ctx->oformat->flags); ++ // CHANGE: You must ensure configure_audio_codec_ctx accepts AVChannelLayout now + configure_audio_codec_ctx( + codec_ctx, enc_fmt, enc_sr, enc_ch_layout, codec_config); + open_codec(codec_ctx, encoder_option); + + // 5. Build filter graph ++ // CHANGE: You must ensure get_audio_filter_graph accepts AVChannelLayout now + FilterGraph filter_graph = get_audio_filter_graph( src_fmt, src_sample_rate, -- src_num_channels, - src_ch_layout, - codec_ctx->frame_size > 0 ? codec_ctx->frame_size : 256); +@@ -812,6 +857,7 @@ + codec_ctx->frame_size); - + // 6. Instantiate source frame ++ // CHANGE: You must ensure get_audio_frame accepts AVChannelLayout now + AVFramePtr src_frame = get_audio_frame( + src_fmt, + src_sample_rate, diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/stream_writer.cpp audio-2.6.0/src/libtorio/ffmpeg/stream_writer/stream_writer.cpp --- audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/stream_writer.cpp 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/libtorio/ffmpeg/stream_writer/stream_writer.cpp 2025-12-01 14:11:58.947476037 +0100 @@ -457,7 +422,6 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/stream_writer.cpp au int64_t (*seek)(void* opaque, int64_t offset, int whence)) : CustomOutput(opaque, buffer_size, write_packet, seek), StreamingMediaEncoder(io_ctx, format) {} - diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/stream_writer.h audio-2.6.0/src/libtorio/ffmpeg/stream_writer/stream_writer.h --- audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/stream_writer.h 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/libtorio/ffmpeg/stream_writer/stream_writer.h 2025-12-01 14:12:52.557260048 +0100 @@ -509,7 +473,6 @@ diff -ur audio-2.6.0.orig/src/libtorio/ffmpeg/stream_writer/tensor_converter.cpp // https://ffmpeg.org/doxygen/4.1/muxing_8c_source.html#l00334 if (!av_frame_is_writable(buffer)) { - diff -ur audio-2.6.0.orig/src/torchaudio/io/_effector.py audio-2.6.0/src/torchaudio/io/_effector.py --- audio-2.6.0.orig/src/torchaudio/io/_effector.py 2025-01-29 02:11:55.000000000 +0100 +++ audio-2.6.0/src/torchaudio/io/_effector.py 2025-12-03 16:36:30.536644472 +0100 diff --git a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb index 71fad6b2c68a..e7ff88511e2d 100644 --- a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb @@ -40,6 +40,7 @@ exts_list = [ 'installopts': '-v', 'patches': [ 'torchaudio-2.6.0_use_ffmpeg7.patch', + 'torchaudio-2.6.0_fix-encode-process.patch', 'torchaudio-2.6.0_fix_tests_gpu.patch', ], 'preinstallopts': ( @@ -63,7 +64,9 @@ exts_list = [ 'testinstall': True, 'checksums': [ {'torchaudio-2.7.1.tar.gz': 'fc8159476d1b3b5978d5e66746fc34be168170800ff4c5e356433d8c9c57cbea'}, - {'torchaudio-2.6.0_use_ffmpeg7.patch': '9e52f964dd3fea61d9a13ffe91b85959029cfa1b6f97d5a02c8ecec3948837ea'}, + {'torchaudio-2.6.0_use_ffmpeg7.patch': '1a2f7505efee9852ef393e6f4583cef209ad302db241171bf41be8d4a88920bd'}, + {'torchaudio-2.6.0_fix-encode-process.patch': + 'f35258127c12f8938d5a5e59e285c435344a5b81be0d2831a59998327132e4ef'}, {'torchaudio-2.6.0_fix_tests_gpu.patch': '42368cef5e9953e5e4fbb84dac7012d5b2797b4e7bd1493a44f9a7144d001587'}, ], From 3c873336c5995f40922282ddf94d1477cbe495b4 Mon Sep 17 00:00:00 2001 From: Pavel Tomanek <99190809+pavelToman@users.noreply.github.com> Date: Tue, 17 Feb 2026 12:08:20 +0100 Subject: [PATCH 13/21] Update pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb --- .../pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/p/pyannote.audio/pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/p/pyannote.audio/pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb index 09fe6b4980ff..d757edcfcaf0 100644 --- a/easybuild/easyconfigs/p/pyannote.audio/pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/p/pyannote.audio/pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb @@ -26,7 +26,7 @@ dependencies = [ ('Optuna', '4.1.0'), ('einops', '0.8.1'), ('ruamel.yaml', '0.18.6'), - ('huggingface_hub', '0.34.4'), + ('huggingface-hub', '0.34.4'), ('scikit-learn', '1.5.2'), ('tqdm', '4.66.5'), ('PyYAML', '6.0.2'), From 7f184087daecd9c8eb1d8662fa6c82daa915cd5f Mon Sep 17 00:00:00 2001 From: Pavel Tomanek <99190809+pavelToman@users.noreply.github.com> Date: Tue, 17 Feb 2026 12:43:51 +0100 Subject: [PATCH 14/21] Update ONNX-Runtime-1.23.2-foss-2024a-CUDA-12.6.0.eb --- .../ONNX-Runtime/ONNX-Runtime-1.23.2-foss-2024a-CUDA-12.6.0.eb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/o/ONNX-Runtime/ONNX-Runtime-1.23.2-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/o/ONNX-Runtime/ONNX-Runtime-1.23.2-foss-2024a-CUDA-12.6.0.eb index 59546f166000..c6f2f4982780 100644 --- a/easybuild/easyconfigs/o/ONNX-Runtime/ONNX-Runtime-1.23.2-foss-2024a-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/o/ONNX-Runtime/ONNX-Runtime-1.23.2-foss-2024a-CUDA-12.6.0.eb @@ -81,7 +81,7 @@ exts_list = [ }), ] -sanity_check_commands = ["python -c 'import onnxruntime; onnxruntime.get_available_providers()'"] +sanity_check_commands = ["python -s -c 'import onnxruntime; onnxruntime.get_available_providers()'"] sanity_check_paths = { 'files': ['bin/onnxruntime_test'], From 77172dcaadb2818c01543741128f1ccfba4cf8a3 Mon Sep 17 00:00:00 2001 From: Pavel Tomanek <99190809+pavelToman@users.noreply.github.com> Date: Wed, 18 Feb 2026 11:13:02 +0100 Subject: [PATCH 15/21] Update pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb - add libsndfile --- .../pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb | 1 + 1 file changed, 1 insertion(+) diff --git a/easybuild/easyconfigs/p/pyannote.audio/pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/p/pyannote.audio/pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb index d757edcfcaf0..583bb008b912 100644 --- a/easybuild/easyconfigs/p/pyannote.audio/pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/p/pyannote.audio/pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb @@ -31,6 +31,7 @@ dependencies = [ ('tqdm', '4.66.5'), ('PyYAML', '6.0.2'), ('SentencePiece', '0.2.1'), + ('libsndfile', '1.2.2'), ] # fix versioneer.py for python 3.12 From 1e00ca3558f2a91d4ea80478eb0dcad41b6a382e Mon Sep 17 00:00:00 2001 From: pavelToman Date: Wed, 18 Feb 2026 11:52:27 +0100 Subject: [PATCH 16/21] update fix-encode-process.patch description --- .../torchaudio-2.6.0_fix-encode-process.patch | 11 +++++++++-- .../torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix-encode-process.patch b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix-encode-process.patch index d4e6c366ec59..676869523367 100644 --- a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix-encode-process.patch +++ b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix-encode-process.patch @@ -1,4 +1,11 @@ -Allow encoder sample_fmt fallback (e.g. s16 -> fltp for libvorbis) +Allow encoder sample_fmt fallback (e.g. s16 -> fltp for libvorbis): +get_enc_fmt() fall back to the codec's first supported sample_fmt when the requested encoder_format isn't supported. +This fixes OGG/Vorbis saves with FFmpeg+libvorbis where only fltp is accepted and s16 (or others) causes encoder open to fail. +A TORCH_WARN_ONCE is emitted and the filter graph performs the conversion. +Default behavior remains: prefer src_fmt if supported, else use the codec's first supported format. +Errors without this patch: +[libvorbis] Specified sample format s16 is not supported by the libvorbis encoder (supported: fltp) +Error while opening encoder / Conversion failed Author: Pavel Tomanek (Inuits/Ugent) ------------------------------------------------------------------ diff -Nru audio-2.6.0.p1/src/libtorio/ffmpeg/stream_writer/encode_process.cpp audio-2.6.0/src/libtorio/ffmpeg/stream_writer/encode_process.cpp @@ -214,4 +221,4 @@ diff -Nru audio-2.6.0.p1/src/libtorio/ffmpeg/stream_writer/encode_process.cpp au - src_num_channels, src_ch_layout, codec_ctx->frame_size > 0 ? codec_ctx->frame_size : 256); - + \ No newline at end of file diff --git a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb index e7ff88511e2d..7b2b21ebcdbd 100644 --- a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb @@ -66,7 +66,7 @@ exts_list = [ {'torchaudio-2.7.1.tar.gz': 'fc8159476d1b3b5978d5e66746fc34be168170800ff4c5e356433d8c9c57cbea'}, {'torchaudio-2.6.0_use_ffmpeg7.patch': '1a2f7505efee9852ef393e6f4583cef209ad302db241171bf41be8d4a88920bd'}, {'torchaudio-2.6.0_fix-encode-process.patch': - 'f35258127c12f8938d5a5e59e285c435344a5b81be0d2831a59998327132e4ef'}, + '58247612801daf6fa49bbbb1d9e24c1c502a91c00100f219fd60ea11c2302e28'}, {'torchaudio-2.6.0_fix_tests_gpu.patch': '42368cef5e9953e5e4fbb84dac7012d5b2797b4e7bd1493a44f9a7144d001587'}, ], From 5dd9363960baecd2c62ed8df75a9926ef9ed60f0 Mon Sep 17 00:00:00 2001 From: Pavel Tomanek <99190809+pavelToman@users.noreply.github.com> Date: Mon, 23 Feb 2026 17:07:51 +0100 Subject: [PATCH 17/21] Update torchaudio-2.6.0_fix-encode-process.patch --- .../torchaudio-2.6.0_fix-encode-process.patch | 145 +----------------- 1 file changed, 2 insertions(+), 143 deletions(-) diff --git a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix-encode-process.patch b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix-encode-process.patch index 676869523367..2ce3ee5a20bc 100644 --- a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix-encode-process.patch +++ b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix-encode-process.patch @@ -1,5 +1,5 @@ Allow encoder sample_fmt fallback (e.g. s16 -> fltp for libvorbis): -get_enc_fmt() fall back to the codec's first supported sample_fmt when the requested encoder_format isn't supported. +get_enc_fmt() falls back to the codec's first supported sample_fmt when the requested encoder_format isn't supported. This fixes OGG/Vorbis saves with FFmpeg+libvorbis where only fltp is accepted and s16 (or others) causes encoder open to fail. A TORCH_WARN_ONCE is emitted and the filter graph performs the conversion. Default behavior remains: prefer src_fmt if supported, else use the codec's first supported format. @@ -80,145 +80,4 @@ diff -Nru audio-2.6.0.p1/src/libtorio/ffmpeg/stream_writer/encode_process.cpp au + return std::string(buf); } - std::string get_supported_channels(const AVChannelLayout* channel_layouts) { -@@ -333,8 +349,6 @@ - return c10::Join(", ", names); - } - --// Return type changed from uint64_t to AVChannelLayout --// Input src_ch_layout changed from uint64_t to const AVChannelLayout& - AVChannelLayout get_channel_layout( - const AVChannelLayout& src_ch_layout, - const std::optional enc_num_channels, -@@ -344,20 +358,16 @@ - const int& val = enc_num_channels.value(); - TORCH_CHECK( - val > 0, "The number of channels must be greater than 0. Found: ", val); -- -- // Check if codec has specific supported layouts (ch_layouts replaces channel_layouts) - if (!codec->ch_layouts) { - AVChannelLayout default_layout; - av_channel_layout_default(&default_layout, val); - return default_layout; - } -- - for (const AVChannelLayout* it = codec->ch_layouts; it->nb_channels; ++it) { - if (it->nb_channels == val) { - return *it; - } - } -- - TORCH_CHECK( - false, - "Codec ", -@@ -398,7 +408,6 @@ - codec_ctx->time_base = av_inv_q(av_d2q(sample_rate, 1 << 24)); - - av_channel_layout_uninit(&codec_ctx->ch_layout); -- - int ret = av_channel_layout_copy(&codec_ctx->ch_layout, &channel_layout); - TORCH_CHECK(ret >= 0, "Failed to set channel layout: ", av_err2string(ret)); - -@@ -631,18 +640,16 @@ - if (filter_desc) { - parts.push_back(filter_desc.value()); - } -- - if (filter_desc || src_fmt != enc_fmt || -- src_sample_rate != enc_sample_rate || av_channel_layout_compare(&src_ch_layout, &enc_ch_layout) != 0) { -- -+ src_sample_rate != enc_sample_rate || -+ av_channel_layout_compare(&src_ch_layout, &enc_ch_layout) != 0) { - char ch_layout_str[128]; -- int ret = av_channel_layout_describe(&enc_ch_layout, -- ch_layout_str, -- sizeof(ch_layout_str)); -- TORCH_CHECK(ret >= 0, -- "Failed to describe channel layout: ", -- av_err2string(ret)); -- -+ int ret = av_channel_layout_describe( -+ &enc_ch_layout, ch_layout_str, sizeof(ch_layout_str)); -+ TORCH_CHECK( -+ ret >= 0, -+ "Failed to describe channel layout: ", -+ av_err2string(ret)); - std::stringstream ss; - ss << "aformat=sample_fmts=" << av_get_sample_fmt_name(enc_fmt) - << ":sample_rates=" << enc_sample_rate << ":channel_layouts=" -@@ -731,22 +738,17 @@ - AVFramePtr get_audio_frame( - AVSampleFormat format, - int sample_rate, -- int num_channels, - AVChannelLayout channel_layout, - int nb_samples) { - AVFramePtr frame{alloc_avframe()}; - frame->format = format; - frame->sample_rate = sample_rate; - frame->nb_samples = nb_samples; -- -- frame ->ch_layout = channel_layout; -- -+ frame->ch_layout = channel_layout; - int ret = av_frame_get_buffer(frame, 0); - TORCH_CHECK( - ret >= 0, "Error allocating the source audio frame:", av_err2string(ret)); - -- // Note: `channels` attribute is not required for encoding, but -- // TensorConverter refers to it - frame->pts = 0; - return frame; - } -@@ -803,8 +805,6 @@ - const AVSampleFormat src_fmt = (disable_converter) - ? av_get_sample_fmt(format.c_str()) - : get_src_sample_fmt(format); -- -- // CHANGE: Convert integer channel count to AVChannelLayout struct - AVChannelLayout src_ch_layout; - av_channel_layout_default(&src_ch_layout, src_num_channels); - -@@ -818,8 +818,6 @@ - // 3. Check that encoding sample format, sample rate and channels - const AVSampleFormat enc_fmt = get_enc_fmt(src_fmt, encoder_format, codec); - const int enc_sr = get_enc_sr(src_sample_rate, encoder_sample_rate, codec); -- -- // CHANGE: Return type is now AVChannelLayout - const AVChannelLayout enc_ch_layout = [&]() -> AVChannelLayout { - if (std::strcmp(codec->name, "vorbis") == 0) { - // Special case for vorbis. -@@ -828,7 +826,6 @@ - // https://github.com/FFmpeg/FFmpeg/blob/0684e58886881a998f1a7b510d73600ff1df2b90/libavcodec/vorbisenc.c#L1277 - // This is the case for at least until FFmpeg 6.0, so it will be - // like this for a while. -- // CHANGE: Use struct initialization for Vorbis default - AVChannelLayout layout; - av_channel_layout_default(&layout, 2); - return layout; -@@ -839,13 +836,11 @@ - // 4. Initialize codec context - AVCodecContextPtr codec_ctx = - get_codec_ctx(codec, format_ctx->oformat->flags); -- // CHANGE: You must ensure configure_audio_codec_ctx accepts AVChannelLayout now - configure_audio_codec_ctx( - codec_ctx, enc_fmt, enc_sr, enc_ch_layout, codec_config); - open_codec(codec_ctx, encoder_option); - - // 5. Build filter graph -- // CHANGE: You must ensure get_audio_filter_graph accepts AVChannelLayout now - FilterGraph filter_graph = get_audio_filter_graph( - src_fmt, - src_sample_rate, -@@ -857,11 +852,9 @@ - codec_ctx->frame_size); - - // 6. Instantiate source frame -- // CHANGE: You must ensure get_audio_frame accepts AVChannelLayout now - AVFramePtr src_frame = get_audio_frame( - src_fmt, - src_sample_rate, -- src_num_channels, - src_ch_layout, - codec_ctx->frame_size > 0 ? codec_ctx->frame_size : 256); - \ No newline at end of file + std::string get_supported_channels(const AVChannelLayout* channel_layouts) { From 37739b9db9cf21977957bc45ad388de515019b2e Mon Sep 17 00:00:00 2001 From: Pavel Tomanek <99190809+pavelToman@users.noreply.github.com> Date: Mon, 23 Feb 2026 17:08:20 +0100 Subject: [PATCH 18/21] Update torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb --- .../t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb index 7b2b21ebcdbd..f4f89aec9122 100644 --- a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.7.1-foss-2024a-CUDA-12.6.0.eb @@ -66,7 +66,7 @@ exts_list = [ {'torchaudio-2.7.1.tar.gz': 'fc8159476d1b3b5978d5e66746fc34be168170800ff4c5e356433d8c9c57cbea'}, {'torchaudio-2.6.0_use_ffmpeg7.patch': '1a2f7505efee9852ef393e6f4583cef209ad302db241171bf41be8d4a88920bd'}, {'torchaudio-2.6.0_fix-encode-process.patch': - '58247612801daf6fa49bbbb1d9e24c1c502a91c00100f219fd60ea11c2302e28'}, + '1d2b0082c2200675a6a3eacf3ac117b0020860b2edf0eb5515d89c5be04b69f6'}, {'torchaudio-2.6.0_fix_tests_gpu.patch': '42368cef5e9953e5e4fbb84dac7012d5b2797b4e7bd1493a44f9a7144d001587'}, ], From 1a3f15e3c726800e6f375ddd5dac6d2942b473e6 Mon Sep 17 00:00:00 2001 From: pavelToman Date: Mon, 23 Feb 2026 17:22:00 +0100 Subject: [PATCH 19/21] upload fixed patch --- .../t/torchaudio/torchaudio-2.6.0_fix-encode-process.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix-encode-process.patch b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix-encode-process.patch index 2ce3ee5a20bc..9b6fd4c5898c 100644 --- a/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix-encode-process.patch +++ b/easybuild/easyconfigs/t/torchaudio/torchaudio-2.6.0_fix-encode-process.patch @@ -80,4 +80,4 @@ diff -Nru audio-2.6.0.p1/src/libtorio/ffmpeg/stream_writer/encode_process.cpp au + return std::string(buf); } - std::string get_supported_channels(const AVChannelLayout* channel_layouts) { + std::string get_supported_channels(const AVChannelLayout* channel_layouts) { \ No newline at end of file From bdf15bef3e88658e86f714c26a4e8c9331fb9686 Mon Sep 17 00:00:00 2001 From: Pavel Tomanek <99190809+pavelToman@users.noreply.github.com> Date: Tue, 12 May 2026 10:53:03 +0200 Subject: [PATCH 20/21] Update WhisperX-3.7.4-foss-2024a-CUDA-12.6.0.eb --- .../w/WhisperX/WhisperX-3.7.4-foss-2024a-CUDA-12.6.0.eb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easybuild/easyconfigs/w/WhisperX/WhisperX-3.7.4-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/w/WhisperX/WhisperX-3.7.4-foss-2024a-CUDA-12.6.0.eb index 2ab104e11040..06081eb8a474 100644 --- a/easybuild/easyconfigs/w/WhisperX/WhisperX-3.7.4-foss-2024a-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/w/WhisperX/WhisperX-3.7.4-foss-2024a-CUDA-12.6.0.eb @@ -14,7 +14,7 @@ builddependencies = [('Cython', '3.0.10')] dependencies = [ ('CUDA', '12.6.0', '', SYSTEM), ('Python', '3.12.3'), - ('PyTorch', '2.7.1', versionsuffix), + ('PyTorch-bundle', '2.7.1', versionsuffix), ('SciPy-bundle', '2024.05'), ('CTranslate2', '4.5.0', versionsuffix), ('NLTK', '3.9.1'), From 0f97a781fc7d45e38624f7412500babe1e6a11ae Mon Sep 17 00:00:00 2001 From: Pavel Tomanek <99190809+pavelToman@users.noreply.github.com> Date: Tue, 12 May 2026 10:54:21 +0200 Subject: [PATCH 21/21] Update pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb --- .../pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/easybuild/easyconfigs/p/pyannote.audio/pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/p/pyannote.audio/pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb index 583bb008b912..f7fb023810ab 100644 --- a/easybuild/easyconfigs/p/pyannote.audio/pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/p/pyannote.audio/pyannote.audio-3.4.0-foss-2024a-CUDA-12.6.0.eb @@ -18,8 +18,7 @@ builddependencies = [ dependencies = [ ('CUDA', '12.6.0', '', SYSTEM), ('Python', '3.12.3'), - ('PyTorch', local_pytorch_version, versionsuffix), - ('torchaudio', local_pytorch_version, versionsuffix), + ('PyTorch-bundle', local_pytorch_version, versionsuffix), ('Lightning', '2.5.6', versionsuffix), ('SciPy-bundle', '2024.05'), ('tensorboardX', '2.6.4'),