Skip to content

cmake: add XLA source fallback for EIGEN_ASYNC - #5562

Open
cfRod wants to merge 1 commit into
uxlfoundation:mainfrom
cfRod:eigen_async_xla_build
Open

cmake: add XLA source fallback for EIGEN_ASYNC#5562
cfRod wants to merge 1 commit into
uxlfoundation:mainfrom
cfRod:eigen_async_xla_build

Conversation

@cfRod

@cfRod cfRod commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Description

This change adds an optional source-tree fallback for building the XLA async runtime pieces required by _DNNL_TEST_THREADPOOL_IMPL=EIGEN_ASYNC.

Today the EIGEN_ASYNC test threadpool path requires an XLA CMake package discoverable through find_package(xla CONFIG).
This is difficult to reproduce in open-source development because XLA does not currently provide a documented build or install export for the subset of headers and libxla.a needed by oneDNN’s async Eigen threadpool validation.

The new behavior keeps the existing packaged XLA flow as the preferred path.
If that package is found, oneDNN continues to use the imported xla target.

If no XLA package is found and ONEDNN_XLA_SOURCE_DIR is provided.

This also documents the new build option in the threadpool validation build instructions.

Fixes #5499

Validation

Tested on AArch64 with ACL and Eigen async threadpool enabled.

Configure included:

-DONEDNN_AARCH64_USE_ACL=ON
-DONEDNN_CPU_RUNTIME=THREADPOOL
-D_DNNL_TEST_THREADPOOL_IMPL=EIGEN_ASYNC
-DONEDNN_XLA_SOURCE_DIR=/path/to/xla
-DEigen3_DIR=/tmp/eigen-xla-install/share/eigen3/cmake
-Dabsl_DIR=/tmp/absl-xla-install/lib/cmake/absl

The build produced the fallback libxla.a from:

xla/tsl/platform/logging.cc.o
xla/tsl/concurrency/async_value.cc.o
xla/tsl/concurrency/async_value_ref.cc.o

Also verified the resulting test_reorder binary contains XLA/TSL async symbols such as:

tsl::AsyncValue
tsl::BlockUntilReady
xla::cpu::Worker::Parallelize

Checklist

General

  • Do all unit and benchdnn tests (make test and make test_benchdnn_*) pass locally for each commit?
    • Partial: test_reorder passed locally for the validated AArch64 ACL + THREADPOOL + EIGEN_ASYNC build.
  • Have you formatted the code using clang-format?

Performance improvements

  • Have you submitted performance data that demonstrates performance improvements?
    • Not applicable. This is a build/developer workflow change.

New features

  • Have you published an RFC for the new feature?
    • Not applicable. This is an optional build fallback for existing EIGEN_ASYNC validation support.
  • Was the RFC approved?
    • Not applicable.
  • Have you added relevant tests?
    • Existing EIGEN_ASYNC threadpool tests are enabled by this build path. test_reorder was built and passed with the
      fallback.

Bug fixes

  • Have you included information on how to reproduce the issue (either in a github issue or in this PR)?

  • Have you added relevant regression tests?

RFC (https://github.com/uxlfoundation/oneDNN/tree/rfcs) PR

@cfRod
cfRod requested review from a team as code owners July 10, 2026 15:20
@github-actions github-actions Bot added documentation A request to change/fix/improve the documentation. Codeowner: @oneapi-src/onednn-doc component:build labels Jul 10, 2026
Comment thread doc/build/build_options.md Outdated

For example:
~~~sh
$ cmake -DONEDNN_CPU_RUNTIME=THREADPOOL -D_ONEDNN_TEST_THREADPOOL_IMPL=EIGEN -DCMAKE_PREFIX_PATH="/path/to/eigen/share/eigen3/cmake;/path/to/absl/lib64/cmake" ..

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update this one, too.

Suggested change
$ cmake -DONEDNN_CPU_RUNTIME=THREADPOOL -D_ONEDNN_TEST_THREADPOOL_IMPL=EIGEN -DCMAKE_PREFIX_PATH="/path/to/eigen/share/eigen3/cmake;/path/to/absl/lib64/cmake" ..
$ cmake -DONEDNN_CPU_RUNTIME=THREADPOOL -D_DNNL_TEST_THREADPOOL_IMPL=EIGEN -DCMAKE_PREFIX_PATH="/path/to/eigen/share/eigen3/cmake;/path/to/absl/lib64/cmake" ..

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread cmake/Threading.cmake
@@ -1,5 +1,6 @@
#===============================================================================
# Copyright 2018 Intel Corporation
# Copyright 2026 Arm Ltd. and affiliates

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: can be probably discarded.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept it since we have touched a new file

Comment thread cmake/options.cmake
Comment on lines +323 to +327
onednn_option(XLA_SOURCE_DIR ""
"Path to an OpenXLA/XLA source tree used to build the minimal XLA async
runtime subset for _DNNL_TEST_THREADPOOL_IMPL=EIGEN_ASYNC when no XLA
CMake package is available.")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one belongs in validation options. Preferably somewhere near _DNNL_TEST_THREADPOOL_IMPL

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_DNNL_TEST_THREADPOOL_IMPL is right above. :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, looks like I misplaced _DNNL_TEST_THREADPOOL_IMPL...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, I was on leave - but is this one still required? I have addressed the other comment

@cfRod
cfRod force-pushed the eigen_async_xla_build branch from bafdfdb to 4f8b98a Compare July 27, 2026 13:59
Signed-off-by: Crefeda Rodrigues <crefeda.rodrigues@arm.com>
@cfRod
cfRod force-pushed the eigen_async_xla_build branch from 4f8b98a to 1fbe367 Compare July 27, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:build documentation A request to change/fix/improve the documentation. Codeowner: @oneapi-src/onednn-doc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document how to build and configure xla headers for EIGEN_ASYNC threadpool tests

3 participants