Skip to content
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

[mlir][linalg] Update docs for linalg.generic(NFC) #127178

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

CoTinker
Copy link
Contributor

@CoTinker CoTinker commented Feb 14, 2025

The mixed tensor/buffer semantics has been disallowed in #80660. Closes #124090.

The mixed tensor/buffer semantics has been disallowed in llvm#80660.
@CoTinker CoTinker changed the title [mlir][linalg] Update docs for linalg.generic [mlir][linalg] Update docs for linalg.generic(NFC) Feb 14, 2025
@llvmbot
Copy link
Member

llvmbot commented Feb 14, 2025

@llvm/pr-subscribers-mlir

Author: Longsheng Mou (CoTinker)

Changes

The mixed tensor/buffer semantics has been disallowed in #80660. Closed #124090.


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

1 Files Affected:

  • (modified) mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td (-13)
diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
index 29cb8035b583b..6a439bfb09078 100644
--- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
+++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
@@ -138,19 +138,6 @@ def GenericOp : LinalgStructuredBase_Op<"generic", [
       }
     }
     ```
-
-    To allow progressive lowering from the value world (a.k.a tensor values) to
-    the buffer world (a.k.a memref values), a `linalg.generic` op allows mixing
-    tensors and buffers operands and tensor results.
-
-    ```mlir
-    %C = linalg.generic #trait_attribute
-      ins(%A, %B : tensor<?x?xf32>, memref<?x?xf32, stride_specification>)
-      outs(%C : tensor<?x?xf32>)
-      {other-optional-attributes}
-      {region}
-      -> (tensor<?x?xf32>)
-    ```
   }];
 
   let arguments = (ins Variadic<AnyType>:$inputs,

@llvmbot
Copy link
Member

llvmbot commented Feb 14, 2025

@llvm/pr-subscribers-mlir-linalg

Author: Longsheng Mou (CoTinker)

Changes

The mixed tensor/buffer semantics has been disallowed in #80660. Closed #124090.


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

1 Files Affected:

  • (modified) mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td (-13)
diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
index 29cb8035b583b..6a439bfb09078 100644
--- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
+++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
@@ -138,19 +138,6 @@ def GenericOp : LinalgStructuredBase_Op<"generic", [
       }
     }
     ```
-
-    To allow progressive lowering from the value world (a.k.a tensor values) to
-    the buffer world (a.k.a memref values), a `linalg.generic` op allows mixing
-    tensors and buffers operands and tensor results.
-
-    ```mlir
-    %C = linalg.generic #trait_attribute
-      ins(%A, %B : tensor<?x?xf32>, memref<?x?xf32, stride_specification>)
-      outs(%C : tensor<?x?xf32>)
-      {other-optional-attributes}
-      {region}
-      -> (tensor<?x?xf32>)
-    ```
   }];
 
   let arguments = (ins Variadic<AnyType>:$inputs,

@CoTinker
Copy link
Contributor Author

I'm uncertain whether we should delete the following code:

// Mixed semantics is not supported yet.
if (!linalgOp.hasPureTensorSemantics())
return failure();

@matthias-springer
Copy link
Member

matthias-springer commented Feb 14, 2025

I thought that DestinationStyleOpInterface already rejects mixed tensor/memref ops, but it does not. If we merge this PR, we should also improve the Linalg op verifier to reject mixed tensor/memref.

Maybe somebody who's been working more closely with Linalg can chime in on mixed tensor/memref support. @nicolasvasilache @MaheshRavishankar @rengolin

@rengolin
Copy link
Member

Maybe somebody who's been working more closely with Linalg can chime in on mixed tensor/memref support.

We have been working on it for the past two years with single semantics: bufferization needs to convert all operands in one go. If there are places still allowing the old semantics, I'd fix them in situ.

@CoTinker
Copy link
Contributor Author

Okay, thanks.

@CoTinker CoTinker merged commit ecb7f5a into llvm:main Feb 17, 2025
11 checks passed
@CoTinker CoTinker deleted the generic_mix branch February 17, 2025 01:30
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Feb 24, 2025
The mixed tensor/buffer semantics has been disallowed in llvm#80660. Closes
llvm#124090.
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.

[MLIR][Linalg][Tiny]Linalg GenericOp description should clarify no more support on mixed tensor/buffer
5 participants