Skip to content

Commit

Permalink
Merge pull request easybuilders#20191 from yqshao/20240321215309_new_…
Browse files Browse the repository at this point in the history
…pr_TensorFlow2151

{lib} [foss/2023a] Bazel v6.1.0, grpcio v1.57.0, TensorFlow v2.15.1
  • Loading branch information
casparvl authored Jun 5, 2024
2 parents 01e8cee + cc48568 commit 4843e33
Show file tree
Hide file tree
Showing 9 changed files with 447 additions and 0 deletions.
29 changes: 29 additions & 0 deletions easybuild/easyconfigs/b/Bazel/Bazel-6.1.0-GCCcore-12.3.0.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name = 'Bazel'
version = '6.1.0'

homepage = 'https://bazel.io/'
description = """Bazel is a build tool that builds code quickly and reliably.
It is used to build the majority of Google's software."""

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

source_urls = ['https://github.com/bazelbuild/%(namelower)s/releases/download/%(version)s']
sources = ['%(namelower)s-%(version)s-dist.zip']
patches = ['Bazel-6.3.1_add-symlinks-in-runfiles.patch']
checksums = [
{'bazel-6.1.0-dist.zip': 'c4b85675541cf66ee7cb71514097fdd6c5fc0e02527243617a4f20ca6b4f2932'},
{'Bazel-6.3.1_add-symlinks-in-runfiles.patch': '81db53aa87229557480b6f719c99a0f1af9c69dfec12185451e520b0128c3ae2'},
]

builddependencies = [
('binutils', '2.40'),
('Python', '3.11.3'),
('Zip', '3.0'),
]

dependencies = [('Java', '11', '', SYSTEM)]

runtest = True
testopts = "-- //examples/cpp:hello-success_test //examples/py/... //examples/py_native:test //examples/shell/..."

moduleclass = 'devel'
54 changes: 54 additions & 0 deletions easybuild/easyconfigs/g/grpcio/grpcio-1.57.0-GCCcore-12.3.0.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
easyblock = 'PythonBundle'

name = 'grpcio'
version = '1.57.0'

homepage = 'https://grpc.io/'
description = """gRPC is a modern, open source, high-performance remote procedure call (RPC)
framework that can run anywhere. gRPC enables client and server applications to
communicate transparently, and simplifies the building of connected systems."""

toolchain = {'name': 'GCCcore', 'version': '12.3.0'}
toolchainopts = {'pic': True}

use_pip = True
sanity_pip_check = True

builddependencies = [
('binutils', '2.40'),
('OpenSSL', '1.1', '', SYSTEM),
('RE2', '2023-08-01'),
]

dependencies = [
('Python', '3.11.3'),
('protobuf-python', '4.24.0'),
('Abseil', '20230125.3'),
]

exts_list = [
(name, version, {
'modulename': 'grpc',
'preinstallopts': (
# patch hardcoded /usr paths to prefix them with alternate sysroot path (if defined)
"sed -i 's@/usr@%(sysroot)s/usr@g' setup.py && "
"export GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS=%(parallel)s && "
# Required to avoid building with non-default C++ standard but keep other flags,
# see https://github.com/grpc/grpc/issues/34256
'export GRPC_PYTHON_CFLAGS="-fvisibility=hidden -fno-wrapv -fno-exceptions" &&'
"GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=True "
"GRPC_PYTHON_BUILD_SYSTEM_ZLIB=True "
"GRPC_PYTHON_BUILD_SYSTEM_RE2=True "
"GRPC_PYTHON_BUILD_SYSTEM_ABSL=True "
),
'patches': ['grpcio-1.57.0_use-ebroot.patch'],
'checksums': [
{'grpcio-1.57.0.tar.gz':
'4b089f7ad1eb00a104078bab8015b0ed0ebcb3b589e527ab009c53893fd4e613'},
{'grpcio-1.57.0_use-ebroot.patch':
'5faf822cd817b723ae9361e43656d0ecc7b3333a166bbab2df80b43ae588e510'},
],
}),
]

moduleclass = 'lib'
51 changes: 51 additions & 0 deletions easybuild/easyconfigs/g/grpcio/grpcio-1.57.0_use-ebroot.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
diff --git a/setup.py b/setup.py
index 97c1dcec54..cc7bc8552e 100644
--- a/setup.py
+++ b/setup.py
@@ -313,29 +313,33 @@ if "win32" in sys.platform:
CORE_C_FILES = filter(lambda x: "third_party/cares" not in x, CORE_C_FILES)

if BUILD_WITH_SYSTEM_OPENSSL:
+ EBROOTOPENSSL = os.environ.get('EBROOTOPENSSL')
CORE_C_FILES = filter(
lambda x: "third_party/boringssl" not in x, CORE_C_FILES
)
CORE_C_FILES = filter(lambda x: "src/boringssl" not in x, CORE_C_FILES)
- SSL_INCLUDE = (os.path.join("/usr", "include", "openssl"),)
+ SSL_INCLUDE = (os.path.join(EBROOTOPENSSL, "include", "openssl"),)

if BUILD_WITH_SYSTEM_ZLIB:
+ EBROOTZLIB = os.environ.get('EBROOTZLIB')
CORE_C_FILES = filter(lambda x: "third_party/zlib" not in x, CORE_C_FILES)
- ZLIB_INCLUDE = (os.path.join("/usr", "include"),)
+ ZLIB_INCLUDE = (os.path.join(EBROOTZLIB, "include"),)

if BUILD_WITH_SYSTEM_CARES:
CORE_C_FILES = filter(lambda x: "third_party/cares" not in x, CORE_C_FILES)
CARES_INCLUDE = (os.path.join("/usr", "include"),)

if BUILD_WITH_SYSTEM_RE2:
+ EBROOTRE2 = os.environ.get('EBROOTRE2')
CORE_C_FILES = filter(lambda x: "third_party/re2" not in x, CORE_C_FILES)
- RE2_INCLUDE = (os.path.join("/usr", "include", "re2"),)
+ RE2_INCLUDE = (os.path.join(EBROOTRE2, "include", "re2"),)

if BUILD_WITH_SYSTEM_ABSL:
+ EBROOTABSEIL = os.environ.get('EBROOTABSEIL')
CORE_C_FILES = filter(
lambda x: "third_party/abseil-cpp" not in x, CORE_C_FILES
)
- ABSL_INCLUDE = (os.path.join("/usr", "include"),)
+ ABSL_INCLUDE = (os.path.join(EBROOTABSEIL, "include"),)

EXTENSION_INCLUDE_DIRECTORIES = (
(PYTHON_STEM,)
@@ -378,7 +382,7 @@ if BUILD_WITH_SYSTEM_RE2:
EXTENSION_LIBRARIES += ("re2",)
if BUILD_WITH_SYSTEM_ABSL:
EXTENSION_LIBRARIES += tuple(
- lib.stem[3:] for lib in pathlib.Path("/usr").glob("lib*/libabsl_*.so")
+ lib.stem[3:] for lib in pathlib.Path(EBROOTABSEIL).glob("lib*/libabsl_*.so")
)

DEFINE_MACROS = (("_WIN32_WINNT", 0x600),)
211 changes: 211 additions & 0 deletions easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.15.1-foss-2023a.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
easyblock = 'PythonBundle'

name = 'TensorFlow'
version = '2.15.1'

homepage = 'https://www.tensorflow.org/'
description = "An open-source software library for Machine Intelligence"

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

use_pip = True
sanity_pip_check = True

builddependencies = [
('Bazel', '6.1.0'),
# git 2.x required, see also https://github.com/tensorflow/tensorflow/issues/29053
('git', '2.41.0', '-nodocs'),
('pybind11', '2.11.1'),
('UnZip', '6.0'),
# Required to build some of the extensions
('poetry', '1.5.1'),
# Protobuf disabled since 2.13.0 easyconfigs:
# Compiling with system protobuf don't seem to work, see:
# https://github.com/tensorflow/tensorflow/issues/61593
# ('protobuf', '24.0'),
]

dependencies = [
('Python', '3.11.3'),
('h5py', '3.9.0'),
('cURL', '8.0.1'),
('dill', '0.3.7'),
('double-conversion', '3.3.0'),
('flatbuffers', '23.5.26'),
('flatbuffers-python', '23.5.26'),
('giflib', '5.2.1'),
('hwloc', '2.9.1'),
('ICU', '73.2'),
('JsonCpp', '1.9.5'),
('libjpeg-turbo', '2.1.5.1'),
('ml_dtypes', '0.3.2'),
('NASM', '2.16.01'),
('nsync', '1.26.0'),
('SQLite', '3.42.0'),
('patchelf', '0.18.0'),
('libpng', '1.6.39'),
('snappy', '1.1.10'),
('zlib', '1.2.13'),
('grpcio', '1.57.0'),
]

# Dependencies created and updated using findPythonDeps, see:
# https://docs.easybuild.io/api/easybuild/scripts/findPythonDeps
# Notable changes since 2.13.0-foss-2023a
# - tensoboard-wit deprecated as of tensorboard 2.13.0 (tensorboard@33abcb54d7)
# - portpicker for tests no longer needed (TF@e85860e838)
# - opt_einsum now comes from ml_dtypes
exts_list = [

('wrapt', '1.14.1', {
'checksums': ['380a85cf89e0e69b7cfbe2ea9f765f004ff419f34194018a6827ac0e3edfed4d'],
}),
('termcolor', '2.3.0', {
'checksums': ['b5b08f68937f138fe92f6c089b99f1e2da0ae56c52b78bf7075fd95420fd9a5a'],
}),
('tensorflow-estimator', '2.15.0', {
'source_tmpl': 'tensorflow_estimator-%(version)s-py2.py3-none-any.whl',
'checksums': ['aedf21eec7fb2dc91150fc91a1ce12bc44dbb72278a08b58e79ff87c9e28f153'],
}),
('Werkzeug', '3.0.2', {
'source_tmpl': SOURCELOWER_TAR_GZ,
'checksums': ['e39b645a6ac92822588e7b39a692e7828724ceae0b0d702ef96701f90e70128d'],
}),
('tensorboard-data-server', '0.7.2', {
'source_tmpl': 'tensorboard_data_server-%(version)s-py3-none-any.whl',
'checksums': ['7e0610d205889588983836ec05dc098e80f97b7e7bbff7e994ebb78f578d0ddb'],
}),
('Markdown', '3.6', {
'checksums': ['ed4f41f6daecbeeb96e576ce414c41d2d876daa9a16cb35fa8ed8c2ddfad0224'],
}),
('oauthlib', '3.2.2', {
'checksums': ['9859c40929662bec5d64f34d01c99e093149682a3f38915dc0655d5a633dd918'],
}),
('requests-oauthlib', '2.0.0', {
'checksums': ['b3dffaebd884d8cd778494369603a9e7b58d29111bf6b41bdc2dcd87203af4e9'],
}),
('rsa', '4.9', {
'checksums': ['e38464a49c6c85d7f1351b0126661487a7e0a14a50f1675ec50eb34d4f20ef21'],
}),
('pyasn1-modules', '0.4.0', {
'source_tmpl': 'pyasn1_modules-%(version)s.tar.gz',
'checksums': ['831dbcea1b177b28c9baddf4c6d1013c24c3accd14a1873fffaa6a2e905f17b6'],
}),
('cachetools', '5.3.3', {
'checksums': ['ba29e2dfa0b8b556606f097407ed1aa62080ee108ab0dc5ec9d6a723a007d105'],
}),
('google-auth', '2.29.0', {
'modulename': 'google.auth',
'checksums': ['672dff332d073227550ffc7457868ac4218d6c500b155fe6cc17d2b13602c360'],
}),
('google-auth-oauthlib', '1.2.0', {
'checksums': ['292d2d3783349f2b0734a0a0207b1e1e322ac193c2c09d8f7c613fb7cc501ea8'],
}),
('absl-py', '2.1.0', {
'modulename': 'absl',
'checksums': ['7820790efbb316739cde8b4e19357243fc3608a152024288513dd968d7d959ff'],
}),
('tensorboard', '2.15.2', {
'source_tmpl': '%(name)s-%(version)s-py3-none-any.whl',
'checksums': ['a6f6443728064d962caea6d34653e220e34ef8df764cb06a8212c17e1a8f0622'],
}),
('keras', '2.15.0', {
'source_tmpl': '%(name)s-%(version)s-py3-none-any.whl',
'checksums': ['2dcc6d2e30cf9c951064b63c1f4c404b966c59caf09e01f3549138ec8ee0dd1f'],
}),
('google-pasta', '0.2.0', {
'modulename': 'pasta',
'checksums': ['c9f2c8dfc8f96d0d5808299920721be30c9eec37f2389f28904f454565c8a16e'],
}),
('astunparse', '1.6.3', {
'checksums': ['5ad93a8456f0d084c3456d059fd9a92cce667963232cbf763eac3bc5b7940872'],
}),
# Required by tests
('tblib', '3.0.0', {
'checksums': ['93622790a0a29e04f0346458face1e144dc4d32f493714c6c3dff82a4adb77e6'],
}),
('astor', '0.8.1', {
'checksums': ['6a6effda93f4e1ce9f618779b2dd1d9d84f1e32812c23a29b3fff6fd7f63fa5e'],
}),
# Optional profile plugin + dependency
('gviz-api', '1.10.0', {
'source_tmpl': 'gviz_api-%(version)s.tar.gz',
'checksums': ['846692dd8cc73224fc31b18e41589bd934e1cc05090c6576af4b4b26c2e71b90'],
}),
('tensorboard-plugin-profile', '2.15.1', {
'source_tmpl': 'tensorboard_plugin_profile-%(version)s.tar.gz',
'checksums': ['84bb33e446eb4a9c0616f669fc6a42cdd40eadd9ae1d74bf756f4f0479993273'],
}),
(name, version, {
'patches': [
'TensorFlow-2.13.0_add-missing-system-protobuf-targets.patch',
'TensorFlow-2.15.1_remove-libclang-dep.patch',
'TensorFlow-2.15.1_remove-io-gcs-filesystem-dep.patch',
'TensorFlow-2.15.1_add-default-shell-env.patch',
'TensorFlow-2.15.1_fix-flatbuffer-license.patch',
'TensorFlow-2.15.1_fix-pybind11-build.patch',
],
'source_tmpl': 'v%(version)s.tar.gz',
'source_urls': ['https://github.com/tensorflow/tensorflow/archive/'],
'test_script': 'TensorFlow-2.x_mnist-test.py',
'test_tag_filters_cpu': (
'-gpu,-tpu,-no_cuda_on_cpu_tap,'
'-no_pip,-no_oss,-oss_serial,-benchmark-test,-v1only'
),
'test_tag_filters_gpu': (
'gpu,-no_gpu,-nogpu,-gpu_cupti,-no_cuda11,'
'-no_pip,-no_oss,-oss_serial,-benchmark-test,-v1only'
),
'test_targets': [
'//tensorflow/core/...',
'-//tensorflow/core:example_java_proto',
'-//tensorflow/core/example:example_protos_closure',
'//tensorflow/cc/...',
'//tensorflow/c/...',
'//tensorflow/python/...',
'-//tensorflow/c/eager:c_api_test_gpu',
'-//tensorflow/c/eager:c_api_distributed_test',
'-//tensorflow/c/eager:c_api_distributed_test_gpu',
'-//tensorflow/c/eager:c_api_cluster_test_gpu',
'-//tensorflow/c/eager:c_api_remote_function_test_gpu',
'-//tensorflow/c/eager:c_api_remote_test_gpu',
'-//tensorflow/core/common_runtime:collective_param_resolver_local_test',
'-//tensorflow/core/kernels/mkl:mkl_fused_ops_test',
'-//tensorflow/core/kernels/mkl:mkl_fused_batch_norm_op_test',
'-//tensorflow/core/ir/importexport/tests/roundtrip/...',
],
'testopts': '--test_env=HOME=/tmp --test_timeout=3600 --test_size_filters=small ',
'testopts_gpu': (
'--test_env=HOME=/tmp --test_timeout=3600 --test_size_filters=small '
'--run_under=//tensorflow/tools/ci_build/gpu_build:parallel_gpu_execute '
),
'with_xla': True,
'checksums': [
{'v2.15.1.tar.gz': 'f36416d831f06fe866e149c7cd752da410a11178b01ff5620e9f265511ed57cf'},
{'TensorFlow-2.13.0_add-missing-system-protobuf-targets.patch':
'77d8c8a5627493fc7c38b4de79d49e60ff6628b05ff969f4cd3ff9857176c459'},
{'TensorFlow-2.15.1_remove-libclang-dep.patch':
'871b2f0221b7a150ac9f563ffad7187e052a7eedd95c20fb4524987d7edb6f21'},
{'TensorFlow-2.15.1_remove-io-gcs-filesystem-dep.patch':
'eba7351a4b0696c589b9c507bacb0257ebce8c39fde39ab72d5d6a69deaaec02'},
{'TensorFlow-2.15.1_add-default-shell-env.patch':
'3d5196b4bf2e91048dc8a18f9e8f487a223fcd973d6302e80b0d4000ea3d652b'},
{'TensorFlow-2.15.1_fix-flatbuffer-license.patch':
'2c04d5095977a628a238dbf93c5fada7159c86752a7183e64e0cf7c7ab00caf4'},
{'TensorFlow-2.15.1_fix-pybind11-build.patch':
'3bb350ac92ab99c63c951c96b3b0160699f5f16822b64f72111ebfd2275cafce'},
],
}),
]

# Taken from tensorboard-2.15.1-gfbf-2023a.eb:
# Relax restriction on protobuf dependency as issue was fixed
# in https://github.com/protocolbuffers/upb/pull/1514
# see also: https://github.com/easybuilders/easybuild-easyconfigs/pull/19671
postinstallcmds = [
'sed -i "s/Requires-Dist: protobuf.*/Requires-Dist: protobuf >=3.19.6/g" ' +
'%(installdir)s/lib/python%(pyshortver)s/site-packages/tensorboard-2.15.2.dist-info/METADATA',
]

moduleclass = 'lib'
Loading

0 comments on commit 4843e33

Please sign in to comment.