diff --git a/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.21.0-foss-2025b.eb b/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.21.0-foss-2025b.eb new file mode 100644 index 000000000000..c76d194cf065 --- /dev/null +++ b/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.21.0-foss-2025b.eb @@ -0,0 +1,127 @@ +easyblock = 'PythonBundle' + +name = 'TensorFlow' +version = '2.21.0' + +homepage = 'https://www.tensorflow.org/' +description = "An open-source software library for Machine Intelligence" + +toolchain = {'name': 'foss', 'version': '2025b'} +toolchainopts = {'pic': True} + +builddependencies = [ + ('hatchling', '1.27.0'), + ('Bazel', '7.7.0', '-Java-21'), + # git 2.x required, see also https://github.com/tensorflow/tensorflow/issues/29053 + ('git', '2.50.1'), + ('UnZip', '6.0'), + ('NASM', '2.16.03'), + # Required to build some of the extensions + ('poetry', '2.1.3'), + ('Cython', '3.2.4'), +] + +dependencies = [ + ('Python', '3.13.5'), + ('Python-bundle-PyPI', '2025.07'), + ('SciPy-bundle', '2025.07'), + ('h5py', '3.14.0'), + ('dill', '0.4.1'), + ('flatbuffers-python', '25.2.10'), + ('ml_dtypes', '0.5.3'), + ('patchelf', '0.18.0'), + ('protobuf-python', '6.31.1'), + ('grpcio', '1.81.0'), + ('wrapt', '1.17.3'), + ('Markdown', '3.8.2'), + ('absl-py', '2.3.1'), + ('tensorboard', '2.20.0'), + ('opt-einsum', '3.4.0'), + ('optree', '0.18.0'), + ('typing-extensions', '4.14.1'), +] + +exts_list = [ + ('astor', '0.8.1', { + 'checksums': ['6a6effda93f4e1ce9f618779b2dd1d9d84f1e32812c23a29b3fff6fd7f63fa5e'], + }), + ('termcolor', '2.5.0', { + 'checksums': ['998d8d27da6d48442e8e1f016119076b690d962507531df4890fcd2db2ef8a6f'], + }), + ('Werkzeug', '3.1.3', { + 'source_tmpl': '%(namelower)s-%(version)s.tar.gz', + 'checksums': ['60723ce945c19328679790e3282cc758aa4a6040e4bb330f53d30fa546d44746'], + }), + ('namex', '0.0.8', { + 'checksums': ['32a50f6c565c0bb10aa76298c959507abdc0e850efe085dc38f3440fcb3aa90b'], + }), + ('keras', '3.13.2', { + 'checksums': ['62f0123488ac87c929c988617e14f293f7bc993811837d08bb37eff77adc85a9'], + }), + ('google-pasta', '0.2.0', { + 'modulename': 'pasta', + 'checksums': ['c9f2c8dfc8f96d0d5808299920721be30c9eec37f2389f28904f454565c8a16e'], + }), + ('astunparse', '1.6.3', { + 'checksums': ['5ad93a8456f0d084c3456d059fd9a92cce667963232cbf763eac3bc5b7940872'], + }), + ('tblib', '3.0.0', { + 'checksums': ['93622790a0a29e04f0346458face1e144dc4d32f493714c6c3dff82a4adb77e6'], + }), + (name, version, { + 'patches': [ + 'TensorFlow-2.4.0_dont-use-var-lock.patch', + 'TensorFlow-2.21.0_disable-tf32-in-fused-matmul-tests.patch', + 'TensorFlow-2.18.1_fix-xnnpack.patch', + 'TensorFlow-2.18.1_fixedpoint.patch', + 'TensorFlow-2.21.0_remove-libclang-dep.patch', + 'TensorFlow-2.21.0_relax-flatbuffers-requirement.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/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_timeout=3600 --test_size_filters=small ', + 'testopts_gpu': ( + '--test_timeout=3600 --test_size_filters=small ' + '--run_under=//tensorflow/tools/ci_build/gpu_build:parallel_gpu_execute ' + ), + 'with_xla': True, + 'checksums': [ + {'v2.21.0.tar.gz': 'ef3568bb4865d6c1b2564fb5689c19b6b9a5311572cd1f2ff9198636a8520921'}, + {'TensorFlow-2.4.0_dont-use-var-lock.patch': + 'b14f2493fd2edf79abd1c4f2dde6c98a3e7d5cb9c25ab9386df874d5f072d6b5'}, + {'TensorFlow-2.21.0_disable-tf32-in-fused-matmul-tests.patch': + '2f605322c9694ccf6e013f06f403496320445a093ceca6625fec616343f5fd32'}, + {'TensorFlow-2.18.1_fix-xnnpack.patch': 'baf81d7b2b61b5a923cf1f171d5e2400df6b8bd9073d3afa7a356e3bbe11984c'}, + {'TensorFlow-2.18.1_fixedpoint.patch': '5ea1eb3b32e7df5f9ae711a71778b4cae544b3380f18882186eea035873fb640'}, + {'TensorFlow-2.21.0_remove-libclang-dep.patch': + '4ee3773d07991c7f75d6dd4033ccf1bb9b017de478b39b4ffb6563a6bd66b981'}, + {'TensorFlow-2.21.0_relax-flatbuffers-requirement.patch': + 'c500796a1fe1f3de8322b1a1abeefbd3714fb255e6600d65e3815e20484c45ee'}, + ], + }), +] + +moduleclass = 'lib' diff --git a/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.21.0_disable-tf32-in-fused-matmul-tests.patch b/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.21.0_disable-tf32-in-fused-matmul-tests.patch new file mode 100644 index 000000000000..54ba997c9254 --- /dev/null +++ b/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.21.0_disable-tf32-in-fused-matmul-tests.patch @@ -0,0 +1,44 @@ +Fixes failing FusedMatMul test on certain GPU models +--- tensorflow/core/kernels/matmul_op_test.cc.orig 2026-06-29 00:00:00.000000000 +0200 ++++ tensorflow/core/kernels/matmul_op_test.cc 2026-06-29 00:00:00.000000000 +0200 +@@ -24,7 +24,8 @@ + #include "tensorflow/core/framework/tensor.h" + #include "tensorflow/core/framework/types.h" + #include "tensorflow/core/kernels/ops_testutil.h" + #include "tensorflow/core/lib/core/status_test_util.h" ++#include "tensorflow/core/platform/tensor_float_32_utils.h" + #include "tensorflow/core/platform/test.h" + #include "tensorflow/core/platform/test_benchmark.h" + #include "tensorflow/core/protobuf/rewriter_config.pb.h" +@@ -334,6 +335,7 @@ + // -------------------------------------------------------------------------- // + + TYPED_TEST_P(FusedMatMulWithBiasOpTest, MatMul256x128x64) { ++ tensorflow::enable_tensor_float_32_execution(false); + this->VerifyMatMulWithBias(256, 128, 64, false, false); + this->VerifyMatMulWithBias(256, 128, 64, true, false); + this->VerifyMatMulWithBias(256, 128, 64, false, true); +@@ -341,6 +343,7 @@ + } + + TYPED_TEST_P(FusedMatMulWithBiasOpTest, MatMul1x256x256) { ++ tensorflow::enable_tensor_float_32_execution(false); + this->VerifyMatMulWithBias(1, 256, 256, false, false); + this->VerifyMatMulWithBias(1, 256, 256, true, false); + this->VerifyMatMulWithBias(1, 256, 256, false, true); +@@ -348,6 +351,7 @@ + } + + TYPED_TEST_P(FusedMatMulWithBiasOpTest, MatMul256x256x1) { ++ tensorflow::enable_tensor_float_32_execution(false); + this->VerifyMatMulWithBias(256, 256, 1, false, false); + this->VerifyMatMulWithBias(256, 256, 1, true, false); + this->VerifyMatMulWithBias(256, 256, 1, false, true); +@@ -371,6 +375,7 @@ + } + + TYPED_TEST_P(FusedMatMulWithBiasOpTest, MatMul256x128x64WithActivation) { ++ tensorflow::enable_tensor_float_32_execution(false); + for (const std::string& activation : GetActivations(this->kTValueType)) { + this->VerifyConv2DWithBiasAndActivation(256, 128, 64, false, false, + activation); diff --git a/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.21.0_relax-flatbuffers-requirement.patch b/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.21.0_relax-flatbuffers-requirement.patch new file mode 100644 index 000000000000..89db20052730 --- /dev/null +++ b/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.21.0_relax-flatbuffers-requirement.patch @@ -0,0 +1,15 @@ +TensorFlow 2.21.0 only uses flatbuffers as a Python runtime dependency in this +EasyBuild configuration. Keep the wheel metadata compatible with the shared +flatbuffers-python dependency used by other 2025b recipes. + +--- tensorflow/tools/pip_package/setup.py.tpl.orig 2026-06-29 00:00:00.000000000 +0200 ++++ tensorflow/tools/pip_package/setup.py.tpl 2026-06-29 00:00:00.000000000 +0200 +@@ -97,7 +97,7 @@ + REQUIRED_PACKAGES = [ + 'absl-py >= 1.0.0', + 'astunparse >= 1.6.0', +- 'flatbuffers >= 25.9.23', ++ 'flatbuffers >= 25.2.10', + 'gast >=0.2.1,!=0.5.0,!=0.5.1,!=0.5.2', + 'google_pasta >= 0.1.1', + 'libclang >= 13.0.0', diff --git a/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.21.0_remove-libclang-dep.patch b/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.21.0_remove-libclang-dep.patch new file mode 100644 index 000000000000..e5ac8082d89f --- /dev/null +++ b/easybuild/easyconfigs/t/TensorFlow/TensorFlow-2.21.0_remove-libclang-dep.patch @@ -0,0 +1,17 @@ +libclang was introduced in +https://github.com/tensorflow/tensorflow/commit/c211472000ff57bac7fcec9b0465cf73b37bf135 +> This is in preparation to open-source TF's TFRT backend. +> TFRT generates code using libclang python bindings as part of the build. +Hence it is not currently used and as it is not (easily) available for all architectures +simply remove it. + +--- tensorflow/tools/pip_package/setup.py.tpl.orig 2026-06-29 00:00:00.000000000 +0200 ++++ tensorflow/tools/pip_package/setup.py.tpl 2026-06-29 00:00:00.000000000 +0200 +@@ -97,7 +97,6 @@ + 'flatbuffers >= 25.9.23', + 'gast >=0.2.1,!=0.5.0,!=0.5.1,!=0.5.2', + 'google_pasta >= 0.1.1', +- 'libclang >= 13.0.0', + 'opt_einsum >= 2.3.2', + 'packaging', + 'protobuf >= 6.31.1, < 8.0.0',