[llvm] [mlir] [MLIR][Python] Add shard Dialect Python Bindings (PR #162578)

Jordan Rupprecht via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 10 14:50:05 PDT 2025


================
@@ -981,6 +981,38 @@ filegroup(
     ],
 )
 
+##---------------------------------------------------------------------------##
+# Shard dialect.
+##---------------------------------------------------------------------------##
+
+gentbl_filegroup(
+    name = "ShardOpsPyGen",
+    tbl_outs = {
+        "mlir/dialects/_shard_enum_gen.py": [
+            "-gen-python-enum-bindings",
+            "-bind-dialect=shard",
+        ],
+        "mlir/dialects/_shard_ops_gen.py": [
+            "-gen-python-op-bindings",
+            "-bind-dialect=shard",
+        ],
+    },
+    tblgen = "//mlir:mlir-tblgen",
+    td_file = "mlir/dialects/ShardOps.td",
+    deps = [
+        "//mlir:OpBaseTdFiles",
+        "//mlir:ShardTdFiles",
+    ],
+)
+
+filegroup(
+    name = "ShardOpsPyFiles",
+    srcs = [
+        "mlir/dialects/shard.py",
+        ":ShardOpsPyGen",
+    ],
+)
----------------
rupprecht wrote:

Bazel changes look good.

> Ok sure np just gotta get someone that knows bazel (not me lol) to sign off. @jpienaar @superbobry this look right to you?

Your original comment was correct: a working bazel build isn't a requirement for committing changes. So you don't really need much of a sign off here. If this change breaks the bazel build, that was _already_ allowed :)

https://github.com/llvm/llvm-project/pull/162578


More information about the llvm-commits mailing list