Bug 2395835 - onednn build enforces power10 -mmma
Summary: onednn build enforces power10 -mmma
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: onednn
Version: rawhide
Hardware: ppc64le
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Nicolas Chauvet (kwizart)
QA Contact: Fedora Extras Quality Assurance
URL: https://github.com/uxlfoundation/oneD...
Whiteboard:
Depends On:
Blocks: PPCTracker
TreeView+ depends on / blocked
 
Reported: 2025-09-16 16:09 UTC by Nicolas Chauvet (kwizart)
Modified: 2025-09-22 11:32 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-09-22 11:32:35 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github uxlfoundation oneDNN pull 3959 0 None open cpu: ppc64: enable build without MMA 2025-09-17 16:45:26 UTC

Description Nicolas Chauvet (kwizart) 2025-09-16 16:09:48 UTC
The current workaround is to rely on power10 and -mmma by default for the ppc64le build.

Reproducible: Always

Comment 1 Nicolas Chauvet (kwizart) 2025-09-16 16:10:35 UTC
Upstream report https://github.com/uxlfoundation/oneDNN/issues/3749

Comment 2 Dan Horák 2025-09-17 09:23:23 UTC
something like this might be an upstreamable fix after some coding style updates

diff --git a/src/cpu/CMakeLists.txt b/src/cpu/CMakeLists.txt
index 10504d1a34..c7b46144ba 100644
--- a/src/cpu/CMakeLists.txt
+++ b/src/cpu/CMakeLists.txt
@@ -40,6 +40,16 @@ if((DNNL_TARGET_ARCH STREQUAL "X64") OR (DNNL_TARGET_ARCH STREQUAL "AARCH64"))
 endif()
 
 if(DNNL_TARGET_ARCH STREQUAL "PPC64")
+    include(CheckSourceCompiles)
+
+    check_source_compiles(C [[
+      #if !defined(__MMA__)
+      #  error "No MMA available"
+      #endif
+      int main(void) { return 0; }
+    ]] HAVE_PPC64_MMA)
+    if(HAVE_PPC64_MMA)
+    add_definitions_with_host_compiler(-DHAVE_PPC64_MMA=1)
     file(GLOB FILES_REQUIRED_OPT
         ${CMAKE_CURRENT_SOURCE_DIR}/gemm/*.[ch]pp
     )
@@ -47,6 +57,7 @@ if(DNNL_TARGET_ARCH STREQUAL "PPC64")
         set_source_files_properties(${FILES_REQUIRED_OPT}
             PROPERTIES COMPILE_FLAGS "-O3 -funroll-loops")
     endif()
+    endif()
 endif()
 
 if(NOT DNNL_ENABLE_JIT_PROFILING)
@@ -139,7 +150,9 @@ if (DNNL_TARGET_ARCH STREQUAL "AARCH64")
     add_subdirectory(aarch64)
 endif()
 if (DNNL_TARGET_ARCH STREQUAL "PPC64")
+    if(HAVE_PPC64_MMA)
     add_subdirectory(ppc64)
+    endif()
 endif()
 if (DNNL_TARGET_ARCH STREQUAL "S390X")
     add_subdirectory(s390x)
diff --git a/src/cpu/reorder/cpu_reorder_regular_f32_u8.cpp b/src/cpu/reorder/cpu_reorder_regular_f32_u8.cpp
index 264168500a..b53337e74c 100644
--- a/src/cpu/reorder/cpu_reorder_regular_f32_u8.cpp
+++ b/src/cpu/reorder/cpu_reorder_regular_f32_u8.cpp
@@ -36,7 +36,9 @@ const impl_list_map_t &regular_f32_u8_impl_list_map() {
             DNNL_AARCH64_ONLY(CPU_REORDER_INSTANCE(aarch64::jit_blk_reorder_t))
             DNNL_AARCH64_ONLY(CPU_REORDER_INSTANCE(aarch64::jit_uni_reorder_t))
 
+#ifdef HAVE_PPC64_MMA
            DNNL_PPC64_ONLY(CPU_REORDER_INSTANCE(ppc64::ppc64_matrixA_reorder_t))
+#endif
 
            REG_FAST_DIRECT_COPY(f32, u8)

Comment 3 Dan Horák 2025-09-17 09:50:10 UTC
BTW the C/C++ standard level settings from the spec are ignored, see in build.logs

CMake Warning:
  Manually-specified variables were not used by the project:
    CMAKE_CPP_STD
    CMAKE_C_STD

Comment 4 Dan Horák 2025-09-17 16:45:27 UTC
opened a PR upstream

Comment 5 Nicolas Chauvet (kwizart) 2025-09-22 11:32:35 UTC
Thanks for the Fix and help provided.


Note You need to log in before you can comment on or make changes to this bug.