Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{lib}[GCCcore/12.3.0] PyTorch-bundle v2.1.2, SoX v14.4.2, libmad v0.15.1b, ... w/ CUDA 12.1.1 #19987

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9f5f0b7
adding easyconfigs: PyTorch-bundle-2.1.2-foss-2023a-CUDA-12.1.1.eb, S…
Micket Feb 28, 2024
569fac8
Add torchvision patch
Micket Feb 28, 2024
438f8ed
Fix patch name
Micket Feb 28, 2024
576c988
patch torchaudio to use external sox; enable CUDA support
jfgrimm Feb 29, 2024
b2087ca
Merge pull request #19 from jfgrimm/20240228001016_new_pr_PyTorch-bun…
Micket Feb 29, 2024
9d1901e
fix long line
jfgrimm Feb 29, 2024
8e26812
Run tests
Micket Mar 2, 2024
3a9dbc4
Improve testing situation a bit
Micket Mar 5, 2024
ebf12e8
Update easybuild/easyconfigs/p/PyTorch-bundle/PyTorch-bundle-2.1.2-fo…
Micket Mar 14, 2024
d7bf83a
Update easybuild/easyconfigs/p/PyTorch-bundle/PyTorch-bundle-2.1.2-fo…
Micket Mar 14, 2024
c72f7bd
Update easybuild/easyconfigs/p/PyTorch-bundle/PyTorch-bundle-2.1.2-fo…
Micket Mar 14, 2024
aa392e8
Update easybuild/easyconfigs/p/PyTorch-bundle/PyTorch-bundle-2.1.2-fo…
Micket Mar 14, 2024
b24b8d3
Get build and tests to complete (ignoring failures)
VRehnberg Mar 20, 2024
2efa625
Merge pull request #20 from VRehnberg/micket-20240228001016_new_pr_Py…
Micket Mar 20, 2024
e11c706
Drop duplicate NLTK
Micket Mar 20, 2024
3efccd7
Merge branch 'develop' of https://github.com/easybuilders/easybuild-e…
Micket Mar 20, 2024
71131fe
Fix style
Micket Mar 21, 2024
7016977
Patch some failing tests
Micket Mar 21, 2024
be7f488
Missing patches
Micket Mar 21, 2024
6d1564a
Exclude broken tests
Micket Mar 21, 2024
cd5b136
Update easybuild/easyconfigs/p/PyTorch-bundle/PyTorch-bundle-2.1.2-fo…
Micket Mar 22, 2024
b30801e
Update easybuild/easyconfigs/p/PyTorch-bundle/PyTorch-bundle-2.1.2-fo…
Micket Mar 22, 2024
9709e77
Update easybuild/easyconfigs/p/PyTorch-bundle/PyTorch-bundle-2.1.2-fo…
Micket Mar 22, 2024
808d8b0
Update easybuild/easyconfigs/p/PyTorch-bundle/PyTorch-bundle-2.1.2-fo…
Micket Mar 22, 2024
7febf35
Skip tests
Micket Mar 30, 2024
ed8bfb3
Exclude yet more problematic tests
Micket Apr 2, 2024
a485746
Skip yet more tests
Micket Apr 3, 2024
3e6fd23
Fix pkg config parts of sentencepiece python component
Micket Apr 3, 2024
df05212
drop toolchainopts
Micket Apr 4, 2024
e1056b4
exclude test that fetches things online
Micket Apr 4, 2024
f7043e7
Add both lib/lib64 to PKGCONFIG paths
Micket Apr 5, 2024
89113fa
Tweak sentencepiece yet more.
Micket Apr 7, 2024
645b07c
Revert sentenecepiece back to internal abseil, work around broken pc …
Micket Apr 8, 2024
4f26d28
Fix non cuda version to not use CUDA
Micket Apr 8, 2024
9022547
Drop CPU version from PR
Micket Apr 9, 2024
1db37ca
Fix torchaudio version
Micket Apr 10, 2024
bb95f51
Drop test that might require special render device permissions
Micket Apr 10, 2024
46662ec
Change patches, drop more tests
Micket Apr 10, 2024
d33f65f
Fix patch
Micket Apr 10, 2024
aad5993
Fix typo
Micket Apr 11, 2024
e58d908
Drop another test
Micket Apr 11, 2024
1397cb8
PyTorch-bundle: add patch for ignite and re-enable launcher test, rem…
akesandgren Apr 12, 2024
9e737f4
PyTorch-bundle: restore layout after inject-checksums messing with it
akesandgren Apr 12, 2024
77f29fb
PyTorch-bundle: remove one more test from torchtext that requires int…
akesandgren Apr 12, 2024
969579d
PyTorch-bundle: restore removal of test_tqdm_logger
akesandgren Apr 12, 2024
959eef6
Shorten comment to fix long line
Micket Apr 12, 2024
e36468a
Merge branch 'develop' of https://github.com/easybuilders/easybuild-e…
akesandgren Apr 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions easybuild/easyconfigs/l/libmad/libmad-0.15.1b-GCCcore-12.3.0.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
easyblock = 'ConfigureMake'

name = 'libmad'
version = '0.15.1b'

homepage = 'https://www.underbit.com/products/mad/'
description = """MAD is a high-quality MPEG audio decoder."""

toolchain = {'name': 'GCCcore', 'version': '12.3.0'}

source_urls = ['https://sourceforge.net/projects/mad/files/%(name)s/%(version)s/']
sources = [SOURCELOWER_TAR_GZ]
patches = ['libmad-0.15.1b-remove-depreciated-gcc-option.patch']
checksums = [
'bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690', # libmad-0.15.1b.tar.gz
# libmad-0.15.1b-remove-depreciated-gcc-option.patch
'8f96a23a22ba66e62f32e20064d01f4c7f6a18ba0aab85d3be9ce63794b2c678',
]

builddependencies = [('binutils', '2.40')]

sanity_check_paths = {
'files': ['include/mad.h', 'lib/libmad.a', 'lib/libmad.la', 'lib/libmad.%s' % SHLIB_EXT],
'dirs': ['include', 'lib', 'lib64']
}

moduleclass = 'lib'
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
easyblock = 'PythonBundle'

name = 'PyTorch-bundle'
version = '2.1.2'
versionsuffix = '-CUDA-%(cudaver)s'

homepage = 'https://pytorch.org/'
description = """PyTorch with compatible versions of official Torch extensions."""

toolchain = {'name': 'foss', 'version': '2023a'}

builddependencies = [
('CMake', '3.26.3'),
('RE2', '2023-08-01'), # for torchtext
]

dependencies = [
('CUDA', '12.1.1', '', SYSTEM),
('Python', '3.11.3'),
('PyTorch', version, versionsuffix),
('Pillow-SIMD', '9.5.0'), # for torchvision
('SentencePiece', '0.2.0'), # for torchtext
('tqdm', '4.66.1'), # for torchtext
('double-conversion', '3.3.0'), # for torchtext
('utf8proc', '2.8.0'), # for torchtext
('tensorboard', '2.15.1'), # for torch-tb-profiler
('FFmpeg', '6.0'), # for torchvision and torchaudio
('SoX', '14.4.2'), # for torchaudio
]

use_pip = True

exts_list = [
('portalocker', '2.8.2', {
'checksums': ['2b035aa7828e46c58e9b31390ee1f169b98e1066ab10b9a6a861fe7e25ee4f33'],
}),
('torchdata', '0.7.1', {
'preinstallopts': "USE_SYSTEM_LIBS=1 ",
'source_urls': ['https://github.com/pytorch/data/archive'],
'sources': [{'download_filename': 'v%(version)s.tar.gz', 'filename': '%(name)s-%(version)s.tar.gz'}],
'checksums': ['ef9bbdcee759b53c3c9d99e76eb0a66da33d36bfb7f859a25a9b5e737a51fa23'],
}),
('torchtext', '0.16.2', {
'patches': ['torchtext-0.14.1_use-system-libs.patch'],
'source_urls': ['https://github.com/pytorch/text/archive'],
'sources': [{'download_filename': 'v%(version)s.tar.gz', 'filename': '%(name)s-%(version)s.tar.gz'}],
'checksums': [
{'torchtext-0.16.2.tar.gz': '6574b012804f65220329a2ad34a95c18e4df0d4cff2f862fb7862d57b374b013'},
{'torchtext-0.14.1_use-system-libs.patch':
'1366d10c4755b6003194f7313ca11d165a80a13d325bee9d669ea2b333d82536'},
],
}),
('torchvision', '0.16.2', {
'preinstallopts': 'WITH_CUDA=1',
'installopts': '-v',
'patches': ['torchvision-0.16.2_ffmpeg-6.0-fix.patch'],
'source_urls': ['https://github.com/pytorch/vision/archive'],
'sources': [{'download_filename': 'v%(version)s.tar.gz', 'filename': '%(name)s-%(version)s.tar.gz'}],
'checksums': [
{'torchvision-0.16.2.tar.gz': '8c1f2951e98d8ada6e5a468f179af4be9f56d2ebc3ab057af873da61669806d7'},
{'torchvision-0.16.2_ffmpeg-6.0-fix.patch':
'a49336e7bfa1c950e886852bff37a3ea2146ac7bda87241e3ffb31c5cb869cce'},
],
}),
('torchaudio', '2.2.1', {
'installopts': '--no-use-pep517 -v',
'patches': ['torchaudio-2.2.1_use-external-sox.patch'],
'preinstallopts': 'rm -r third_party/{sox,ffmpeg/multi} && USE_CUDA=1 USE_OPENMP=1 USE_FFMPEG=1 FFMPEG_ROOT="$EBROOTFFMPEG"',
'source_urls': ['https://github.com/pytorch/audio/archive'],
'sources': [{'download_filename': 'v%(version)s.tar.gz', 'filename': '%(name)s-%(version)s.tar.gz'}],
'checksums': [
{'torchaudio-2.2.1.tar.gz': '5f2a9cda9369ff348d1d7ca2c0a1f01afc9ebff1a13df9775c22aa5c43f5b0f1'},
{'torchaudio-2.2.1_use-external-sox.patch':
'fc97b2bdf0ab16b9c4706bf2a31dd72d0ecb09e4af2f9c4a34e18fca8e0d165d'},
],
}),
('pytorch-ignite', '0.4.13', {
'modulename': 'ignite',
'source_urls': ['https://github.com/pytorch/ignite/archive'],
'sources': [{'download_filename': 'v%(version)s.tar.gz', 'filename': '%(name)s-%(version)s.tar.gz'}],
'checksums': ['bfe4b6f1cd96e78c021a65a0c51350cdb89d6ef5a8b9609638666ca95bae51d7'],
}),
('torch-tb-profiler', '0.4.3', {
'modulename': 'torch.profiler',
'sources': ['torch_tb_profiler-%(version)s.tar.gz'],
'checksums': ['8b8d29b2de960b3c4423087b23cec29beaf9ac3a8c7b046c18fd25b218f726b1'],
}),
]

sanity_pip_check = True

moduleclass = 'ai'
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Author: Jasper Grimm <[email protected]>
use external Sox library instead of fetching and building at build time
diff -Nru audio-2.2.1.orig/CMakeLists.txt audio-2.2.1/CMakeLists.txt
--- audio-2.2.1.orig/CMakeLists.txt 2024-02-29 12:56:03.027016456 +0000
+++ audio-2.2.1/CMakeLists.txt 2024-02-29 12:56:35.286922379 +0000
@@ -167,7 +167,7 @@

add_subdirectory(src/libtorchaudio)
if (BUILD_SOX)
- add_subdirectory(third_party/sox)
+ # add_subdirectory(third_party/sox)
add_subdirectory(src/libtorchaudio/sox)
endif()
if (USE_FFMPEG)
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From 86620bd84b872b76db0acafec167949dca03a29e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
<[email protected]>
Date: Tue, 7 Nov 2023 10:43:11 +0100
Subject: [PATCH] Fix build with ffmpeg 6.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Zoltán Böszörményi <[email protected]>
---
torchvision/csrc/io/decoder/stream.cpp | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/torchvision/csrc/io/decoder/stream.cpp b/torchvision/csrc/io/decoder/stream.cpp
index 0d625ef211c..8c914050587 100644
--- a/torchvision/csrc/io/decoder/stream.cpp
+++ b/torchvision/csrc/io/decoder/stream.cpp
@@ -63,15 +63,8 @@ int Stream::openCodec(std::vector<DecoderMetadata>* metadata, int num_threads) {
codecCtx_->thread_count = num_threads;
} else {
// otherwise set sensible defaults
- // with the special case for the different MPEG4 codecs
- // that don't have threading context functions
- if (codecCtx_->codec->capabilities & AV_CODEC_CAP_INTRA_ONLY) {
- codecCtx_->thread_type = FF_THREAD_FRAME;
- codecCtx_->thread_count = 2;
- } else {
- codecCtx_->thread_count = 8;
- codecCtx_->thread_type = FF_THREAD_SLICE;
- }
+ codecCtx_->thread_count = 8;
+ codecCtx_->thread_type = FF_THREAD_SLICE;
}

int ret;
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
easyblock = 'Bundle'

name = 'SentencePiece'
version = '0.2.0'

homepage = 'https://github.com/google/sentencepiece'
description = "Unsupervised text tokenizer for Neural Network-based text generation."
github_account = 'google'

toolchain = {'name': 'GCC', 'version': '12.3.0'}

builddependencies = [
('CMake', '3.26.3'),
]

dependencies = [
('Python', '3.11.3'),
('gperftools', '2.12'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SentencePiece requires protobuf/24.0 as a dependency

Copy link
Contributor Author

@Micket Micket Apr 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how only you managed to trigger this. Also, i assume you meant protobuf-python/4.24.0

Copy link
Contributor

@akesandgren akesandgren Apr 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I mean

('protobuf', '24.0')

It uses pkg-config to search for protobuf-lite and fails without it.

It fails for me since I don't have stuff like that in my container :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

protobuf-lite is included in sentencepiece as a thirdparty package (maybe we don't actually want that, but regardless), i would have expected it to find that, rather than having the python module link to something potentially different.

It fails for me since I don't have stuff like that in my container :-)

And surely so does noone else on their OS either. I certainly don't have it, no trace of protobuf, protobuf-lite.

After some digging, I found that one can use external packages for Abseil and protobuf, using

'configopts': '-DSPM_PROTOBUF_PROVIDER=package -DSPM_ABSL_PROVIDER=package'

when attempting this, I also noticed that
'prebuildopts': 'export PKG_CONFIG_PATH=%(installdir)s/lib/pkgconfig:$PKG_CONFIG_PATH
my pkgconfig stuff ended up in lib64, not lib. Fixing that made sentencepiece (the python part) not even look for protobuf. It shouldn't be looking for that stuff to start with, since it should just be using the already compiled SentencePiece from the first component. So, I think we have some lib/lib64 difference here.

I attempted to use external protobuf and Abseil, but I got very very confusing problems. the ABSL_FLAG parsing completely broke, with strange broken output and warnings messages and strange output from even basic things like spm_train --version. I couldn't make any sense of it, so I reverted back.

I've added pkgconf as a builddep and changed the PKG_CONFIG_PATH to include lib64 instead, which I hope will be correct for everyone? I'm not sure. Mixing in a different external protobuf is no good, because it seems to conflict with the bundled thirdparty abseil, and taking in both of them just broke things for me.

]

default_component_specs = {
'source_urls': [GITHUB_LOWER_SOURCE],
'sources': ['v%(version)s.tar.gz'],
'checksums': ['9970f0a0afee1648890293321665e5b2efa04eaec9f1671fcf8048f456f5bb86'],
}

components = [
(name, version, {
'easyblock': 'CMakeMake',
'separate_build_dir': True,
'start_dir': '%(namelower)s-%(version)s',
}),
('sentencepiece', version, {
'easyblock': 'PythonPackage',
'start_dir': '%(namelower)s-%(version)s/python',
'prebuildopts': 'export PKG_CONFIG_PATH=%(installdir)s/lib/pkgconfig:$PKG_CONFIG_PATH && ',
'preinstallopts': 'export PKG_CONFIG_PATH=%(installdir)s/lib/pkgconfig:$PKG_CONFIG_PATH && ',
'use_pip': True,
'download_dep_fail': True,
'sanity_pip_check': True,
}),
]

postinstallcmds = ['cp -a %(builddir)s/%(namelower)s-%(version)s/{data,doc} %(installdir)s/']

sanity_check_paths = {
'files': ['bin/spm_%s' % x for x in ['decode', 'encode', 'export_vocab', 'normalize', 'train']] +
['lib/libsentencepiece.%s' % SHLIB_EXT, 'lib/libsentencepiece_train.%s' % SHLIB_EXT] +
['include/sentencepiece_processor.h', 'include/sentencepiece_trainer.h'],
'dirs': ['lib/python%(pyshortver)s/site-packages', 'data', 'doc'],
}

sanity_check_commands = [
'spm_train --help',
"python -c 'import sentencepiece'",
]

modextrapaths = {
'PYTHONPATH': ['lib/python%(pyshortver)s/site-packages']
}

moduleclass = 'lib'
34 changes: 34 additions & 0 deletions easybuild/easyconfigs/s/SoX/SoX-14.4.2-GCCcore-12.3.0.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
easyblock = 'ConfigureMake'

name = 'SoX'
version = '14.4.2'

homepage = 'http://sox.sourceforge.net/'
docurls = 'http://sox.sourceforge.net/Docs/Documentation'
description = """Sound eXchange, the Swiss Army knife of audio manipulation"""

toolchain = {'name': 'GCCcore', 'version': '12.3.0'}

source_urls = [SOURCEFORGE_SOURCE]
sources = [SOURCELOWER_TAR_GZ]
checksums = ['b45f598643ffbd8e363ff24d61166ccec4836fea6d3888881b8df53e3bb55f6c']

builddependencies = [('binutils', '2.40')]

dependencies = [
('FLAC', '1.4.2'),
('LAME', '3.100'),
('libmad', '0.15.1b'),
('libvorbis', '1.3.7'),
('FFmpeg', '6.0'),
]

sanity_check_paths = {
'files': ['bin/play', 'bin/rec', 'bin/sox', 'bin/soxi', 'include/sox.h',
'lib/libsox.la', 'lib/libsox.a', 'lib/pkgconfig/sox.pc', 'lib/libsox.%s' % SHLIB_EXT],
'dirs': ['bin', 'include', 'lib', 'lib/pkgconfig', 'share/man'],
}

sanity_check_commands = ['sox --help']

moduleclass = 'data'
Loading