How amd/zendnn-tensorflow-plugin works
Project type and purpose
• This is an open‐source plug‐in for TensorFlow (named zentf) that integrates AMD’s ZenDNN library into TensorFlow’s CPU execution path.
• It provides custom graph optimizers, op kernels, and operator libraries to accelerate inference on AMD EPYC CPUs, and exposes user interfaces in Python, Java, and C++.
File structure
• Top-level configuration: WORKSPACE, Bazel BUILD files, configure scripts, LICENSEs.
• Directory “tensorflow_plugin/”: the heart of the plug-in.
• python/ – Python wrapper and unit test.
• src/amd_cpu/graph – Graph-level transforms and optimizer passes (auto‐mixed precision, remapper, CPU optimizer, graph_view abstractions).
• src/amd_cpu/kernels/zendnn – Implementation of individual kernel functors using ZenDNN microkernels.
• src/amd_cpu/util – Utilities (allocators, coding, proto serialization, logging, tensor formats, etc.).
• BUILD and .bzl files – Bazel build rules tying it all together.
• scripts/ – Convenience scripts for setting up env, building Java and C++ interfaces.
• examples/ – Sample code in C++, Java, and Python demonstrating how to invoke the plugin.
• tests/ – Functional tests invoking individual ops (softmax, conv2d, matmul, etc.).
• third_party/ – Vendored dependencies (Abseil, Eigen3, ZenDNN core, Protobuf, zlib, LLVM OpenMP).
README for additional insights
• Confirms support matrix (TensorFlow ≥2.16), build tools (Bazel 5.3–6.5), Python ≥3.9.
• Describes three user‐facing APIs: Python, Java, C++.
• Outlines build/installation from source: configure → Bazel build → build_pip_package → pip install.
Elements
• Blue for TensorFlow core components
• Green for zentf plug-in submodules
• Orange for ZenDNN and third-party libs
• Gray for build system