Add TensorFlow easyblock options for Bazel startup flags and TF_SYSTEM_LIBS exclusions - #4193
Add TensorFlow easyblock options for Bazel startup flags and TF_SYSTEM_LIBS exclusions#4193bedroesb wants to merge 2 commits into
Conversation
|
Before I jump into the implementation (which looks ok) I'd like to discuss the changes
Good idea, I'd say as an easy way to avoid modifying the easyblock. I'd expect you'd want
How does this look like and how does --batch avoids it?
I'd say this is not a good idea: Only direct dependencies are considered. So instead of excluding it you can simply not add it, can't you? Otherwise you would be mixing EasyBuild dependencies and downloaded/vendored software which likely leads to issues.
Similar to above: If it doesn't work (and we can't patch it) remove the dependency from the easyconfig to avoid conflicts.
Good idea but I'd do it differently: It looks like TensorFlow did install tensorboard and since some version does it. So instead guard it on the version that introduced the change so you are not required to include tensorboard as a dependency of TensorFlow.
Not enabling it mixes the SSL installations leading to issues again. It looks rather like a problem in OpenSSL:
--> OpenSSL header includes an OpenSSL header that doesn't exist?
This looks like something we should fix too: We do want to use our cURL to avoid conflicts. Maybe this is caused by the filtering of CPATH you mentioned? Maybe there is some other option. ChatGPT mentions using |
|
Thanks for the detailed feedback: Based on the suggestions I could cleanup quite a bit:
For |
Why? If we have both and not using rpath the 2 will conflict, won't they?
Why is it a required Python dependency?
Just reproduced that. I'm testing a patch as the removal seems accidental by upstream. |
|
I'm now also trying to build TensorFlow with the CUDA variant ( I will create a PR for the easyconfig once it is working). ERROR: /tools/eb/build/TensorFlow/2.21.0/foss-2025b-CUDA-12.9.1/TensorFlow/bazel-root/c741a8d54995072d0506b6004cf6ee2e/external/curl/BUILD.bazel:26:11: Compiling lib/altsvc.c failed: absolute path inclusion(s) found in rule '@@curl//:curl':
the source file 'lib/altsvc.c' includes the following non-builtin files with absolute paths (if these are builtin files, make sure these paths are in your toolchain):
'/cvmfs/biogrid-software.rnd.seeds.basf.net/tools/eb/x86_64/generic/software/OpenSSL/3/include/openssl/opensslv.h'
'/cvmfs/biogrid-software.rnd.seeds.basf.net/tools/eb/x86_64/generic/software/OpenSSL/3/include/openssl/macros.h'
'/cvmfs/biogrid-software.rnd.seeds.basf.net/tools/eb/x86_64/generic/software/OpenSSL/3/include/openssl/opensslconf.h'
'/cvmfs/biogrid-software.rnd.seeds.basf.net/tools/eb/x86_64/generic/software/OpenSSL/3/include/openssl/configuration.h'
'/cvmfs/biogrid-software.rnd.seeds.basf.net/tools/eb/x86_64/generic/software/OpenSSL/3/include/openssl/configuration-x86_64.h'I tried to add the Maybe this could be useful by mentioning this. |
That's (kind of) expected. The change here to not use OpenSSL/BoringSSL creates this "conflict". Adding cURL is correct anyway. Working on a solution for related fixes. |
|
I made significant progress here after running into undeclared inclusions, (C++) module validation issues and more A short test using system/our cURL can be done by passing the This currently yields: After lots of debugging and chatting with AI agents I stumbled upon a suspicious toolchain being used and It mentions the solution Another failure in the full build was: This is that C++ module checker. I found that this can be disable by passing Currently that solution causes other issues: They assume their toolchain is used and pass flags accordingly causing e.g.
I'm not sure if we could use their toolchain, although they pass our flags like |
| """ | ||
| dependency_mapping, python_mapping = get_system_libs_for_version(self.version) | ||
|
|
||
| # TensorFlow 2.21 still lists absl_py as a valid TF_SYSTEM_LIBS entry, but its |
There was a problem hiding this comment.
This can be fixed by a patch so does not need to be in the easyblock, see https://github.com/easybuilders/easybuild-easyconfigs/pull/26658/changes#diff-01cb94902867bc2e7ffd436faf712aca6604eb5ea903030bf45a6f5eb49f9792
|
I created #4205 which does what is required for TF 2.19 and 2.21. I think here the parts to be kept are the bazel startup options with the |
This PR moves certain patches from easybuilders/easybuild-easyconfigs#26602 into the TensorFlow easyblock.
Changes included here:
bazel_startup_opts, so easyconfigs can pass Bazel startup options such as--batchwithout editing.bazelrc;tf_system_libs_exclude, so easyconfigs can opt out of specificTF_SYSTEM_LIBSentries without patching.tf_configure.bazelrc;absl_pyautomatically when TensorFlow’stf_http_archiveentry has nosystem_build_file;--test_env=HOME=...;tensorboarddependency is accepted instead of requiringbin/tensorboardinside the TensorFlow installation prefix.The
absl_pyhandling is needed for TensorFlow 2.21.0 becauseabsl_pyis still listed in TensorFlow’sVALID_LIBS, but itstf_http_archiveentry no longer has asystem_build_file. Without this, Bazel fails with:The
tf_system_libs_excludeoption is needed because some TensorFlow system-library stubs are not sufficient for all Bazel compile actions. For TensorFlow 2.21.0, enabling systemboringsslmade gRPC pick up OpenSSL headers via Bazel actions, which failed with:While validating the cleanup, using system cURL showed the same general problem with exposing dependency headers globally through
CPATH:With these easyblock changes, the TensorFlow 2.21.0 easyconfig no longer needs the previous sed/CPATH/TensorBoard-symlink workarounds. The corresponding TensorFlow/2.21.0-foss-2025b build completed successfully.