Skip to content

TensorFlow 2.21.0 (GPU) para Power9

Latest

Choose a tag to compare

@yallerocha yallerocha released this 21 May 15:49

TensorFlow 2.21.0 — Power9 GPU build (PPC64LE + CUDA 12.4)

TensorFlow 2.21.0 ported to the PPC64LE architecture with GPU/CUDA
support on IBM Power9 + NVIDIA Tesla V100 systems.

Package

File Description
tensorflow-2.21.0-cp311-cp311-linux_ppc64le.whl Wheel ready for pip install (CPython 3.11, Linux PPC64LE)
python3 -m pip install tensorflow-2.21.0-cp311-cp311-linux_ppc64le.whl

Supported platform

  • Architecture: ppc64le (Power9)
  • OS: Linux (kernel ≥ 4.18)
  • Python: CPython 3.11
  • CUDA: 12.4 (host toolkit)
  • cuDNN: 9.0.0 (official NVIDIA ppc64le redist)
  • NCCL: 2.x (libnccl.so.2 on LD_LIBRARY_PATH)
  • GPU tested: NVIDIA Tesla V100 (Volta, sm_70)

Source

Branch: power9-v2.21.0-gpu — derived from the upstream
v2.21.0 tag.
Diff vs upstream: 401 files, +88,757 / -3,205 lines.

Main modifications vs upstream v2.21.0

Toolchain (PPC64LE)

  • LLD linker: patch to emit PPC64R2SaveStub for long-branch thunks
    (stabilises r2/TOC across stub calls into cudart_stub/Implib.so).
  • libppc64_savres.a: _savefpr_NN / _restfpr_NN routines manually
    injected (LLD does not auto-generate them on PPC64LE).
  • Extra linkopts: -Wl,--no-multi-toc -Wl,--no-plt-localentry
    (works around the BFD multi-TOC + local entry bug on large targets).
  • gcc_cuda_wrapper: forces Clang as the assembler for .S files of
    Implib.so (GAS 2.30 rejects .localentry sym,1, Clang accepts).

CUDA / cuDNN

  • Dynamic cudart: cudart_static removed; uses the host's
    libcudart.so.12.
  • Separate cuda_redist_stub + cuda_nccl_stub: hard-coded
    TF_NCCL_VERSION="2" (avoids TF attempting dlopen("libnccl.so.12"),
    which does not exist).
  • cuDNN 9: loaded at runtime via LD_LIBRARY_PATH (cuda_unified +
    Conda's lib/ directory).

Compiler / headers

  • absl headers: patches for compatibility with NVCC's cudafe++ parser
    (insert_or_assign / try_emplace SFINAE templates).
  • inline namespace in .cu.cc: fixes TOC16/PLT relocs emitted by
    NVCC (the simpler namespace + using namespace form does not work).
  • GCC 11 / XLA: fixes for std::vector::reserve with noexcept move
    ctor and brace-init in expand_integer_power.cc.
  • BoringSSL / pybind11 / protobuf: platform-specific visibility and
    build patches.

Disabled features

  • MLIR-generated GPU kernels
    (--//tensorflow/core/kernels/mlir_generated:enable_gpu=False):
    hlo_to_kernel segfaults in NVPTX codegen on PPC64LE.

How to reproduce the build

git clone https://github.com/llm-pt-ibm/TensorFlow-2.21-Power9.git
cd TensorFlow-2.21-Power9/gpu
bash build_tf221_power9_gpu_generic.sh

Prerequisites: Miniforge3, CUDA 12.4 toolkit, local cuDNN 9.0.0 ppc64le
tarball, ~80 GB free disk, 32 GB+ RAM (parallel build).

Quick verification

import tensorflow as tf
print(tf.__version__)                         # 2.21.0
print(tf.config.list_physical_devices('GPU')) # [PhysicalDevice(name='/physical_device:GPU:0', ...)]
print(tf.test.is_built_with_cuda())           # True

Known limitations

  • Builds tested only on V100 (sm_70). Ampere/Hopper architectures have
    not been validated.
  • cudart_static is incompatible: the .whl requires libcudart.so.12
    reachable via LD_LIBRARY_PATH at runtime.
  • MLIR-generated GPU kernels disabled (see above).

Support: llm-pt-ibm/TensorFlow-2.21-Power9.