Skip to content

[mlir][python] allow DenseIntElementsAttr for index type #118947

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

mgehre-amd
Copy link
Contributor

Model the IndexType as size_t when converting to a python integer.

With the python bindings,

DenseIntElementsAttr(op.attributes["attr"])

used to assert when attr had index type like dense<[1, 2, 3, 4]> : vector<4xindex>.

Model the IndexType as size_t when converting to a python integer. This should
follow the definition of the IndexType as system-dependent.

This solves the following issue when for example an attribute is defined
as:

```
denseattr = dense<[1, 2, 3, 4]> : vector<4xindex>
```

which is a valid DenseElementsAttr. The change will fix an access issue
when reading the attribute in python. E.g.

```
DenseIntElementsAttr(op.attributes["denseattr"])
```

Co-authored-by: Tiago Trevisan Jost <[email protected]>
Co-authored-by: Matthias Gehre <[email protected]>
@llvmbot
Copy link
Member

llvmbot commented Dec 6, 2024

@llvm/pr-subscribers-mlir

Author: Matthias Gehre (mgehre-amd)

Changes

Model the IndexType as size_t when converting to a python integer.

With the python bindings,

DenseIntElementsAttr(op.attributes["attr"])

used to assert when attr had index type like dense&lt;[1, 2, 3, 4]&gt; : vector&lt;4xindex&gt;.


Full diff: https://github.com/llvm/llvm-project/pull/118947.diff

6 Files Affected:

  • (modified) mlir/include/mlir-c/BuiltinAttributes.h (+2)
  • (modified) mlir/lib/Bindings/Python/IRAttributes.cpp (+8-2)
  • (modified) mlir/lib/CAPI/IR/BuiltinAttributes.cpp (+3)
  • (modified) mlir/test/python/dialects/builtin.py (+4)
  • (modified) mlir/test/python/ir/array_attributes.py (+4)
  • (modified) mlir/test/python/ir/attributes.py (+4)
diff --git a/mlir/include/mlir-c/BuiltinAttributes.h b/mlir/include/mlir-c/BuiltinAttributes.h
index 7c8c84e55b962f..ece4e7d5e4ac16 100644
--- a/mlir/include/mlir-c/BuiltinAttributes.h
+++ b/mlir/include/mlir-c/BuiltinAttributes.h
@@ -556,6 +556,8 @@ MLIR_CAPI_EXPORTED int64_t
 mlirDenseElementsAttrGetInt64Value(MlirAttribute attr, intptr_t pos);
 MLIR_CAPI_EXPORTED uint64_t
 mlirDenseElementsAttrGetUInt64Value(MlirAttribute attr, intptr_t pos);
+MLIR_CAPI_EXPORTED size_t mlirDenseElementsAttrGetIndexValue(MlirAttribute attr,
+                                                             intptr_t pos);
 MLIR_CAPI_EXPORTED float mlirDenseElementsAttrGetFloatValue(MlirAttribute attr,
                                                             intptr_t pos);
 MLIR_CAPI_EXPORTED double
diff --git a/mlir/lib/Bindings/Python/IRAttributes.cpp b/mlir/lib/Bindings/Python/IRAttributes.cpp
index cc9532f4e33b2c..f05f9f02e50faa 100644
--- a/mlir/lib/Bindings/Python/IRAttributes.cpp
+++ b/mlir/lib/Bindings/Python/IRAttributes.cpp
@@ -1172,13 +1172,19 @@ class PyDenseIntElementsAttribute
 
     MlirType type = mlirAttributeGetType(*this);
     type = mlirShapedTypeGetElementType(type);
-    assert(mlirTypeIsAInteger(type) &&
-           "expected integer element type in dense int elements attribute");
+    // Index type can also appear as a DenseIntElementsAttr and therefore can be
+    // casted to integer.
+    assert(mlirTypeIsAInteger(type) ||
+           mlirTypeIsAIndex(type) && "expected integer/index element type in "
+                                     "dense int elements attribute");
     // Dispatch element extraction to an appropriate C function based on the
     // elemental type of the attribute. py::int_ is implicitly constructible
     // from any C++ integral type and handles bitwidth correctly.
     // TODO: consider caching the type properties in the constructor to avoid
     // querying them on each element access.
+    if (mlirTypeIsAIndex(type)) {
+      return mlirDenseElementsAttrGetIndexValue(*this, pos);
+    }
     unsigned width = mlirIntegerTypeGetWidth(type);
     bool isUnsigned = mlirIntegerTypeIsUnsigned(type);
     if (isUnsigned) {
diff --git a/mlir/lib/CAPI/IR/BuiltinAttributes.cpp b/mlir/lib/CAPI/IR/BuiltinAttributes.cpp
index 11d1ade552f5a2..2a44533d781856 100644
--- a/mlir/lib/CAPI/IR/BuiltinAttributes.cpp
+++ b/mlir/lib/CAPI/IR/BuiltinAttributes.cpp
@@ -758,6 +758,9 @@ int64_t mlirDenseElementsAttrGetInt64Value(MlirAttribute attr, intptr_t pos) {
 uint64_t mlirDenseElementsAttrGetUInt64Value(MlirAttribute attr, intptr_t pos) {
   return llvm::cast<DenseElementsAttr>(unwrap(attr)).getValues<uint64_t>()[pos];
 }
+size_t mlirDenseElementsAttrGetIndexValue(MlirAttribute attr, intptr_t pos) {
+  return llvm::cast<DenseElementsAttr>(unwrap(attr)).getValues<size_t>()[pos];
+}
 float mlirDenseElementsAttrGetFloatValue(MlirAttribute attr, intptr_t pos) {
   return llvm::cast<DenseElementsAttr>(unwrap(attr)).getValues<float>()[pos];
 }
diff --git a/mlir/test/python/dialects/builtin.py b/mlir/test/python/dialects/builtin.py
index 18ebba61e7fea8..973a0eaeca2cdb 100644
--- a/mlir/test/python/dialects/builtin.py
+++ b/mlir/test/python/dialects/builtin.py
@@ -246,3 +246,7 @@ def testDenseElementsAttr():
         # CHECK{LITERAL}: dense<[[0, 1], [2, 3]]> : tensor<2x2xi32>
         print(DenseElementsAttr.get(values, type=VectorType.get((2, 2), i32)))
         # CHECK{LITERAL}: dense<[[0, 1], [2, 3]]> : vector<2x2xi32>
+        idx_values = np.arange(4, dtype=np.int64)
+        idx_type = IndexType.get()
+        print(DenseElementsAttr.get(idx_values, type=VectorType.get([4], idx_type)))
+        # CHECK{LITERAL}: dense<[0, 1, 2, 3]> : vector<4xindex>
diff --git a/mlir/test/python/ir/array_attributes.py b/mlir/test/python/ir/array_attributes.py
index 256a69a939658d..ef1d835fc64012 100644
--- a/mlir/test/python/ir/array_attributes.py
+++ b/mlir/test/python/ir/array_attributes.py
@@ -572,6 +572,10 @@ def testGetDenseElementsIndex():
         print(arr)
         # CHECK: True
         print(arr.dtype == np.int64)
+        array = np.array([1, 2, 3], dtype=np.int64)
+        attr = DenseIntElementsAttr.get(array, type=VectorType.get([3], idx_type))
+        # CHECK: [1, 2, 3]
+        print(list(DenseIntElementsAttr(attr)))
 
 
 # CHECK-LABEL: TEST: testGetDenseResourceElementsAttr
diff --git a/mlir/test/python/ir/attributes.py b/mlir/test/python/ir/attributes.py
index 00c3e1b4decdb7..2f3c4460d3f590 100644
--- a/mlir/test/python/ir/attributes.py
+++ b/mlir/test/python/ir/attributes.py
@@ -366,6 +366,10 @@ def testDenseIntAttr():
         # CHECK: i1
         print(ShapedType(a.type).element_type)
 
+        shape = Attribute.parse("dense<[0, 1, 2, 3]> : vector<4xindex>")
+        # CHECK: attr: dense<[0, 1, 2, 3]>
+        print("attr:", shape)
+
 
 @run
 def testDenseArrayGetItem():

@makslevental
Copy link
Contributor

I'm always hazy on the semantics of 64b integer types - this looks fine to me but just double checking that index == size_t is non-controverisal?

@mgehre-amd
Copy link
Contributor Author

@makslevental, who can answer your question? Is it for @stellaraccident @ftynse ?

@makslevental
Copy link
Contributor

@makslevental, who can answer your question? Is it for @stellaraccident @ftynse ?

I mean it'd be enough if you said to me "I'm sure these are the right semantics because XYZ"

@mgehre-amd
Copy link
Contributor Author

@stellaraccident, I implemented your review comments. Friendly ping for review

Copy link
Contributor

@makslevental makslevental left a comment

Choose a reason for hiding this comment

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

I hereby do solemnly swear I reviewed that @stellaraccident's asks were fulfilled.

@mgehre-amd mgehre-amd merged commit 9dd762e into llvm:main Jan 28, 2025
8 checks passed
@mgehre-amd mgehre-amd deleted the matthias.mlir_python_index branch January 28, 2025 17:32
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 28, 2025

LLVM Buildbot has detected a new failure on builder mlir-nvidia running on mlir-nvidia while building mlir at step 6 "build-check-mlir-build-only".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/138/builds/9554

Here is the relevant piece of the build log for the reference
Step 6 (build-check-mlir-build-only) failure: build (failure)
...
29.049 [103/10/4951] Linking CXX executable tools/mlir/unittests/IR/MLIRIRTests
29.127 [103/9/4952] Linking CXX shared library lib/libMLIRMemRefTestPasses.so.20.0git
29.135 [102/9/4953] Creating library symlink lib/libMLIRMemRefTestPasses.so
29.152 [102/8/4954] Linking CXX shared library lib/libMLIRTestTransforms.so.20.0git
29.159 [101/8/4955] Linking CXX shared library lib/libMLIRTestToLLVMIRTranslation.so.20.0git
29.161 [100/8/4956] Creating library symlink lib/libMLIRTestTransforms.so
29.165 [100/7/4957] Creating library symlink lib/libMLIRTestToLLVMIRTranslation.so
29.194 [100/6/4958] Linking CXX shared library lib/libMLIRTestIR.so.20.0git
29.201 [99/6/4959] Creating library symlink lib/libMLIRTestIR.so
29.397 [99/5/4960] Building CXX object tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Bindings/Python/IRAttributes.cpp.o
FAILED: tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Bindings/Python/IRAttributes.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /usr/bin/clang++ -DMLIRPythonModules_extension__mlir_dso_EXPORTS -DMLIR_INCLUDE_TESTS -DNB_DOMAIN=mlir -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/vol/worker/mlir-nvidia/mlir-nvidia/llvm.obj/tools/mlir/python -I/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/python -I/vol/worker/mlir-nvidia/mlir-nvidia/llvm.obj/tools/mlir/include -I/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/include -I/vol/worker/mlir-nvidia/mlir-nvidia/llvm.obj/include -I/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/llvm/include -I/usr/include/python3.10 -I/home/buildbot/.local/lib/python3.10/site-packages/nanobind/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -O3 -DNDEBUG -fPIC -fvisibility=hidden -UNDEBUG -fno-stack-protector -Os -frtti -fexceptions -ffunction-sections -fdata-sections -std=c++17 -MD -MT tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Bindings/Python/IRAttributes.cpp.o -MF tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Bindings/Python/IRAttributes.cpp.o.d -o tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Bindings/Python/IRAttributes.cpp.o -c /vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Bindings/Python/IRAttributes.cpp
/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Bindings/Python/IRAttributes.cpp:1386:14: error: no viable conversion from returned value of type 'uint64_t' (aka 'unsigned long') to function return type 'nb::object'
      return mlirDenseElementsAttrGetIndexValue(*this, pos);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/buildbot/.local/lib/python3.10/site-packages/nanobind/include/nanobind/nb_types.h:216:5: note: candidate constructor not viable: no known conversion from 'uint64_t' (aka 'unsigned long') to 'const nanobind::object &' for 1st argument
    object(const object &o) : handle(o) { inc_ref(); }
    ^
/home/buildbot/.local/lib/python3.10/site-packages/nanobind/include/nanobind/nb_types.h:217:5: note: candidate constructor not viable: no known conversion from 'uint64_t' (aka 'unsigned long') to 'nanobind::object &&' for 1st argument
    object(object &&o) noexcept : handle(o) { o.m_ptr = nullptr; }
    ^
1 error generated.
31.693 [99/4/4961] Building CXX object tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlirPythonTestPybind11.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/test/python/lib/PythonTestModulePybind11.cpp.o
32.842 [99/3/4962] Building CXX object lib/CodeGen/AsmPrinter/CMakeFiles/LLVMAsmPrinter.dir/AsmPrinter.cpp.o
34.239 [99/2/4963] Building CXX object tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Bindings/Python/IRTypes.cpp.o
38.739 [99/1/4964] Building CXX object tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia/llvm.src/mlir/lib/Bindings/Python/IRCore.cpp.o
ninja: build stopped: subcommand failed.

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 28, 2025

LLVM Buildbot has detected a new failure on builder mlir-rocm-mi200 running on mi200-buildbot while building mlir at step 6 "build-check-mlir-build-only".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/177/builds/12095

Here is the relevant piece of the build log for the reference
Step 6 (build-check-mlir-build-only) failure: build (failure)
...
80.222 [2/13/4808] Linking CXX shared module tools/mlir/python_packages/mlir_core/mlir/_mlir_libs/_mlirDialectsNVGPU.cpython-38-x86_64-linux-gnu.so
80.222 [2/12/4809] Linking CXX shared module tools/mlir/python_packages/mlir_core/mlir/_mlir_libs/_mlirDialectsTransform.cpython-38-x86_64-linux-gnu.so
80.223 [2/11/4810] Linking CXX shared module tools/mlir/python_packages/mlir_core/mlir/_mlir_libs/_mlirDialectsGPU.cpython-38-x86_64-linux-gnu.so
80.223 [2/10/4811] Linking CXX shared module tools/mlir/python_packages/mlir_core/mlir/_mlir_libs/_mlirDialectsSparseTensor.cpython-38-x86_64-linux-gnu.so
80.223 [2/9/4812] Linking CXX shared module tools/mlir/python_packages/mlir_core/mlir/_mlir_libs/_mlirRegisterEverything.cpython-38-x86_64-linux-gnu.so
80.224 [2/8/4813] Linking CXX shared module tools/mlir/python_packages/mlir_core/mlir/_mlir_libs/_mlirTransformInterpreter.cpython-38-x86_64-linux-gnu.so
80.224 [2/7/4814] Linking CXX shared module tools/mlir/python_packages/mlir_core/mlir/_mlir_libs/_mlirDialectsPDL.cpython-38-x86_64-linux-gnu.so
80.225 [2/6/4815] Linking CXX shared module tools/mlir/python_packages/mlir_core/mlir/_mlir_libs/_mlirDialectsLLVM.cpython-38-x86_64-linux-gnu.so
80.233 [2/5/4816] Linking CXX shared module tools/mlir/python_packages/mlir_core/mlir/_mlir_libs/_mlirExecutionEngine.cpython-38-x86_64-linux-gnu.so
80.540 [2/4/4817] Building CXX object tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/lib/Bindings/Python/IRAttributes.cpp.o
FAILED: tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/lib/Bindings/Python/IRAttributes.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /usr/bin/clang++ -DMLIRPythonModules_extension__mlir_dso_EXPORTS -DMLIR_INCLUDE_TESTS -DNB_DOMAIN=mlir -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/vol/worker/mi200-buildbot/mlir-rocm-mi200/build/tools/mlir/python -I/vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/python -I/vol/worker/mi200-buildbot/mlir-rocm-mi200/build/tools/mlir/include -I/vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/include -I/vol/worker/mi200-buildbot/mlir-rocm-mi200/build/include -I/vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/llvm/include -I/usr/include/python3.8 -I/home/buildbot/.local/lib/python3.8/site-packages/nanobind/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Werror=mismatched-tags -O3 -DNDEBUG -fPIC -fvisibility=hidden -UNDEBUG -fno-stack-protector -Os -frtti -fexceptions -ffunction-sections -fdata-sections -std=c++17 -MD -MT tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/lib/Bindings/Python/IRAttributes.cpp.o -MF tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/lib/Bindings/Python/IRAttributes.cpp.o.d -o tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/lib/Bindings/Python/IRAttributes.cpp.o -c /vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/lib/Bindings/Python/IRAttributes.cpp
/vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/lib/Bindings/Python/IRAttributes.cpp:1386:14: error: no viable conversion from returned value of type 'uint64_t' (aka 'unsigned long') to function return type 'nb::object'
 1386 |       return mlirDenseElementsAttrGetIndexValue(*this, pos);
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/buildbot/.local/lib/python3.8/site-packages/nanobind/include/nanobind/nb_types.h:216:5: note: candidate constructor not viable: no known conversion from 'uint64_t' (aka 'unsigned long') to 'const object &' for 1st argument
  216 |     object(const object &o) : handle(o) { inc_ref(); }
      |     ^      ~~~~~~~~~~~~~~~
/home/buildbot/.local/lib/python3.8/site-packages/nanobind/include/nanobind/nb_types.h:217:5: note: candidate constructor not viable: no known conversion from 'uint64_t' (aka 'unsigned long') to 'object &&' for 1st argument
  217 |     object(object &&o) noexcept : handle(o) { o.m_ptr = nullptr; }
      |     ^      ~~~~~~~~~~
1 error generated.
82.142 [2/3/4818] Building CXX object tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlirPythonTestPybind11.dso.dir/vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/test/python/lib/PythonTestModulePybind11.cpp.o
83.986 [2/2/4819] Building CXX object tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/lib/Bindings/Python/IRTypes.cpp.o
87.169 [2/1/4820] Building CXX object tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mi200-buildbot/mlir-rocm-mi200/llvm-project/mlir/lib/Bindings/Python/IRCore.cpp.o
ninja: build stopped: subcommand failed.

@mgehre-amd
Copy link
Contributor Author

Will revert and adapt to nanobind

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 28, 2025

LLVM Buildbot has detected a new failure on builder mlir-nvidia-gcc7 running on mlir-nvidia while building mlir at step 6 "build-check-mlir-build-only".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/116/builds/9452

Here is the relevant piece of the build log for the reference
Step 6 (build-check-mlir-build-only) failure: build (failure)
...
30.386 [74/14/4552] Linking CXX static library lib/libLLVMOrcDebugging.a
30.394 [74/13/4553] Linking CXX static library lib/libMLIRTestToLLVMIRTranslation.a
30.394 [74/12/4554] Linking CXX static library lib/libMLIRTestFromLLVMIRTranslation.a
30.396 [74/11/4555] Linking CXX static library lib/libMLIRMemRefTestPasses.a
30.416 [74/10/4556] Linking CXX static library lib/libMLIRTestTransforms.a
30.462 [74/9/4557] Linking CXX static library lib/libMLIRTestIR.a
30.797 [74/8/4558] Linking CXX executable tools/mlir/unittests/TableGen/MLIRTableGenTests
30.817 [74/7/4559] Linking CXX executable tools/mlir/unittests/IR/MLIRIRTests
30.899 [74/6/4560] Linking CXX executable tools/mlir/unittests/Parser/MLIRParserTests
31.367 [74/5/4561] Building CXX object tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/Bindings/Python/IRAttributes.cpp.o
FAILED: tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/Bindings/Python/IRAttributes.cpp.o 
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /usr/bin/g++-7 -DMLIRPythonModules_extension__mlir_dso_EXPORTS -DMLIR_INCLUDE_TESTS -DNB_DOMAIN=mlir -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.obj/tools/mlir/python -I/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/python -I/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.obj/tools/mlir/include -I/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/include -I/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.obj/include -I/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/llvm/include -I/usr/include/python3.10 -I/home/buildbot/.local/lib/python3.10/site-packages/nanobind/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -Wno-unused-but-set-parameter -Wno-deprecated-copy -O3 -DNDEBUG -fPIC -fvisibility=hidden -UNDEBUG -fno-stack-protector -Os -frtti -fexceptions -ffunction-sections -fdata-sections -std=c++1z -MD -MT tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/Bindings/Python/IRAttributes.cpp.o -MF tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/Bindings/Python/IRAttributes.cpp.o.d -o tools/mlir/python/CMakeFiles/MLIRPythonModules.extension._mlir.dso.dir/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/Bindings/Python/IRAttributes.cpp.o -c /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/Bindings/Python/IRAttributes.cpp
In file included from /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/Bindings/Python/NanobindUtils.h:14:0,
                 from /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/Bindings/Python/Globals.h:16,
                 from /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/Bindings/Python/IRModule.h:17,
                 from /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/Bindings/Python/IRAttributes.cpp:15:
/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/include/mlir/Bindings/Python/Nanobind.h:18:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
 #pragma GCC diagnostic ignored "-Wzero-length-array"
                                ^~~~~~~~~~~~~~~~~~~~~
/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/include/mlir/Bindings/Python/Nanobind.h:20:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
 #pragma GCC diagnostic ignored "-Wnested-anon-types"
                                ^~~~~~~~~~~~~~~~~~~~~
/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/include/mlir/Bindings/Python/Nanobind.h:21:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
 #pragma GCC diagnostic ignored "-Wc++98-compat-extra-semi"
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/include/mlir/Bindings/Python/Nanobind.h:22:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
 #pragma GCC diagnostic ignored "-Wcovered-switch-default"
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/include/mlir/Bindings/Python/Nanobind.h:25:0,
                 from /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/Bindings/Python/NanobindUtils.h:14,
                 from /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/Bindings/Python/Globals.h:16,
                 from /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/Bindings/Python/IRModule.h:17,
                 from /vol/worker/mlir-nvidia/mlir-nvidia-gcc7/llvm.src/mlir/lib/Bindings/Python/IRAttributes.cpp:15:
/home/buildbot/.local/lib/python3.10/site-packages/nanobind/include/nanobind/ndarray.h:82:41: warning: extra ‘;’ [-Wpedantic]
 NB_FRAMEWORK(no_framework, 0, "ndarray");
                                         ^
/home/buildbot/.local/lib/python3.10/site-packages/nanobind/include/nanobind/ndarray.h:83:40: warning: extra ‘;’ [-Wpedantic]
 NB_FRAMEWORK(numpy, 1, "numpy.ndarray");
                                        ^
/home/buildbot/.local/lib/python3.10/site-packages/nanobind/include/nanobind/ndarray.h:84:41: warning: extra ‘;’ [-Wpedantic]
 NB_FRAMEWORK(pytorch, 2, "torch.Tensor");
                                         ^
/home/buildbot/.local/lib/python3.10/site-packages/nanobind/include/nanobind/ndarray.h:85:75: warning: extra ‘;’ [-Wpedantic]
 NB_FRAMEWORK(tensorflow, 3, "tensorflow.python.framework.ops.EagerTensor");
                                                                           ^
/home/buildbot/.local/lib/python3.10/site-packages/nanobind/include/nanobind/ndarray.h:86:57: warning: extra ‘;’ [-Wpedantic]
 NB_FRAMEWORK(jax, 4, "jaxlib.xla_extension.DeviceArray");
                                                         ^
/home/buildbot/.local/lib/python3.10/site-packages/nanobind/include/nanobind/ndarray.h:87:38: warning: extra ‘;’ [-Wpedantic]

mgehre-amd added a commit that referenced this pull request Jan 28, 2025
mgehre-amd added a commit to Xilinx/llvm-project that referenced this pull request Jan 28, 2025
mgehre-amd added a commit that referenced this pull request Jan 29, 2025
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 29, 2025

LLVM Buildbot has detected a new failure on builder premerge-monolithic-linux running on premerge-linux-1 while building mlir at step 6 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/153/builds/21217

Here is the relevant piece of the build log for the reference
Step 6 (build-unified-tree) failure: build (failure)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants