Produce BOLT-compatible libraries - #3383
Conversation
Signed-off-by: Fred Heinecke <fheinecke@nvidia.com>
9a0da74 to
8a42b4e
Compare
|
/te-ci |
|
CI failures are all runner scheduling failures, not related to this changeset |
Greptile SummaryThe PR makes the common, PyTorch, and JAX shared libraries suitable for subsequent LLVM BOLT optimization, enabled by default on Linux Arm64.
Confidence Score: 4/5The PR appears safe to merge for the native release builds, with a non-blocking inconsistency remaining for cross-compilation. Native Arm64 builds consistently receive the intended BOLT options, but framework extensions derive architecture from the host while the common library derives it from the CMake target, producing inconsistent artifacts when those architectures differ. Files Needing Attention: build_tools/utils.py and transformer_engine/common/CMakeLists.txt Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
ENV["NVTE_ENABLE_BOLT_COMPATIBLE"] --> PY["Python build helpers"]
ENV --> CMAKE["Common CMake build"]
PY --> PT["PyTorch extension"]
PY --> JAX["JAX extension"]
CMAKE --> CORE["libtransformer_engine.so"]
PT --> PKG["BOLT-compatible package artifacts"]
JAX --> PKG
CORE --> PKG
Reviews (1): Last reviewed commit: "Produce BOLT-compatible libraries" | Re-trigger Greptile |
| if configured is None: | ||
| enabled = platform.system() == "Linux" and platform.machine().lower() in ( | ||
| "aarch64", | ||
| "arm64", | ||
| ) |
There was a problem hiding this comment.
Host-derived BOLT architecture flags
If the build host and target use different architectures, the framework extensions select BOLT defaults and Arm64 flags from platform.machine() while the core uses CMAKE_SYSTEM_PROCESSOR, producing inconsistent BOLT compatibility across the packaged libraries or passing Arm64-only flags to a non-Arm64 extension target.
Knowledge Base Used: Build and Packaging
Description
This is the first in a series of changes to produce BOLT-optimized TE libraries for arm64. This does not produce binaries actually optimized by BOLT, rather, it produces binaries that can be optimized by BOLT. We'll need to start producing and publishing profiles to be able to actually start release with this optimization built in.
This is arguably a breaking change, but in an area where we haven't explicitly defined compatibility guarantees. NCCL >= 2.30.4 is now required for arm64 builds, and older compilers that don't support the newly added build-time flags will fail. In addition, A53 core errata workarounds 835769 and 843419 are now disabled, which may cause correctness problems on older A53 core revisions.
This change is enabled by default for arm64 builds.
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: