Skip to content

[MLIR] Fix documentation generation for DLTI dialect. #97052

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 1 commit into from
Jul 1, 2024

Conversation

AntonLydike
Copy link
Contributor

This patch fixes the docs generation for the DLTI dialect to include attributes (CMake config pointed to the wrong tablegen file). It also fixes formatting in places so that proper markdown is generated.

Tagging @nhasabni @rengolin @ftynse

@llvmbot
Copy link
Member

llvmbot commented Jun 28, 2024

@llvm/pr-subscribers-mlir-dlti

@llvm/pr-subscribers-mlir

Author: Anton Lydike (AntonLydike)

Changes

This patch fixes the docs generation for the DLTI dialect to include attributes (CMake config pointed to the wrong tablegen file). It also fixes formatting in places so that proper markdown is generated.

Tagging @nhasabni @rengolin @ftynse


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

2 Files Affected:

  • (modified) mlir/include/mlir/Dialect/DLTI/CMakeLists.txt (+1-1)
  • (modified) mlir/include/mlir/Dialect/DLTI/DLTIAttrs.td (+18-22)
diff --git a/mlir/include/mlir/Dialect/DLTI/CMakeLists.txt b/mlir/include/mlir/Dialect/DLTI/CMakeLists.txt
index 44a814f1c8e82..5b0cb6c37bfab 100644
--- a/mlir/include/mlir/Dialect/DLTI/CMakeLists.txt
+++ b/mlir/include/mlir/Dialect/DLTI/CMakeLists.txt
@@ -1,5 +1,5 @@
 add_mlir_dialect(DLTI dlti)
-add_mlir_doc(DLTI DLTIDialect Dialects/ -gen-dialect-doc)
+add_mlir_doc(DLTIAttrs DLTIDialect Dialects/ -gen-dialect-doc)
 
 set(LLVM_TARGET_DEFINITIONS DLTIAttrs.td)
 mlir_tablegen(DLTIAttrs.h.inc -gen-attrdef-decls -attrdefs-dialect=dlti)
diff --git a/mlir/include/mlir/Dialect/DLTI/DLTIAttrs.td b/mlir/include/mlir/Dialect/DLTI/DLTIAttrs.td
index b3849e9b5be62..443e3128b4acb 100644
--- a/mlir/include/mlir/Dialect/DLTI/DLTIAttrs.td
+++ b/mlir/include/mlir/Dialect/DLTI/DLTIAttrs.td
@@ -27,9 +27,7 @@ def DataLayoutEntryTrait
 
 def DLTI_DataLayoutEntryAttr :
     DLTIAttr<"DataLayoutEntry", [DataLayoutEntryTrait]> {
-  let summary = [{
-    An attribute to represent an entry of a data layout specification.
-  }];
+  let summary = "An attribute to represent an entry of a data layout specification.";
   let description = [{
     A data layout entry attribute is a key-value pair where the key is a type or
     an identifier and the value is another attribute. These entries form a data
@@ -62,9 +60,7 @@ def DataLayoutSpecTrait
 
 def DLTI_DataLayoutSpecAttr :
     DLTIAttr<"DataLayoutSpec", [DataLayoutSpecTrait]> {
-  let summary = [{
-    An attribute to represent a data layout specification.
-  }];
+  let summary = "An attribute to represent a data layout specification.";
   let description = [{
     A data layout specification is a list of entries that specify (partial) data
     layout information. It is expected to be attached to operations that serve
@@ -111,23 +107,23 @@ def TargetSystemSpecTrait
 
 def DLTI_TargetSystemSpecAttr :
     DLTIAttr<"TargetSystemSpec", [TargetSystemSpecTrait]> {
-  let summary = [{
-    An attribute to represent target system specification.
-  }];
+  let summary = "An attribute to represent target system specification.";
   let description = [{
     A system specification describes the overall system containing
     multiple devices, with each device having a unique ID (string)
     and its corresponding TargetDeviceSpec object.
 
     Example:
-          dlti.target_system_spec =
-           #dlti.target_system_spec<
-            "CPU": #dlti.target_device_spec<
-                    #dlti.dl_entry<"dlti.L1_cache_size_in_bytes", 4096: ui32>>,
-            "GPU": #dlti.target_device_spec<
-                    #dlti.dl_entry<"dlti.max_vector_op_width", 64 : ui32>>,
-            "XPU": #dlti.target_device_spec<
-                    #dlti.dl_entry<"dlti.max_vector_op_width", 4096 : ui32>>>
+    ```
+    dlti.target_system_spec =
+     #dlti.target_system_spec<
+      "CPU": #dlti.target_device_spec<
+              #dlti.dl_entry<"dlti.L1_cache_size_in_bytes", 4096: ui32>>,
+      "GPU": #dlti.target_device_spec<
+              #dlti.dl_entry<"dlti.max_vector_op_width", 64 : ui32>>,
+      "XPU": #dlti.target_device_spec<
+              #dlti.dl_entry<"dlti.max_vector_op_width", 4096 : ui32>>>
+    ```
   }];
   let parameters = (ins
     ArrayRefParameter<"DeviceIDTargetDeviceSpecPair", "">:$entries
@@ -165,17 +161,17 @@ def TargetDeviceSpecTrait
 
 def DLTI_TargetDeviceSpecAttr :
     DLTIAttr<"TargetDeviceSpec", [TargetDeviceSpecTrait]> {
-  let summary = [{
-    An attribute to represent target device specification.
-  }];
+  let summary = "An attribute to represent target device specification.";
   let description = [{
     Each device specification describes a single device and its
     hardware properties. Each device specification can contain any number
     of optional hardware properties (e.g., max_vector_op_width below).
 
     Example:
-      #dlti.target_device_spec<
-        #dlti.dl_entry<"dlti.max_vector_op_width", 64 : ui32>>
+    ```
+    #dlti.target_device_spec<
+      #dlti.dl_entry<"dlti.max_vector_op_width", 64 : ui32>>
+    ```
   }];
   let parameters = (ins
     ArrayRefParameter<"DataLayoutEntryInterface", "">:$entries

Copy link
Member

@rengolin rengolin left a comment

Choose a reason for hiding this comment

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

thanks!

@AntonLydike
Copy link
Contributor Author

@rengolin do I need another approval before merging? Just got commit access, so am happy to press the button, just wanted to check if it's ready.

@rengolin
Copy link
Member

Technically you only need one approval, but it's usually good to wait a day to make sure there are no additional concerns. We can always do post-commit review if anyone finds something wrong after merge, and can either land a fix or revert for further investigations.

In this case, it should be safe to merge (no bots will break) and it's easy to fix later (another doc patch).

@AntonLydike AntonLydike merged commit c46a95c into llvm:main Jul 1, 2024
10 checks passed
lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this pull request Jul 3, 2024
This patch fixes the docs generation for the DLTI dialect to include
attributes (CMake config pointed to the wrong tablegen file). It also
fixes formatting in places so that proper markdown is generated.
kbluck pushed a commit to kbluck/llvm-project that referenced this pull request Jul 6, 2024
This patch fixes the docs generation for the DLTI dialect to include
attributes (CMake config pointed to the wrong tablegen file). It also
fixes formatting in places so that proper markdown is generated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants