Issue 132873
Summary [MLIR Python Bindings] - Multiple output operations numerical validation test
Labels mlir
Assignees
Reporter rockysingh9431
    I have implemented a VarMeanOp in MLIR that computes variance and mean as outputs. I have successfully lowered this operation to LLVM and am now testing it using MLIR Python bindings as part of the numerical validation process.

Problem:
When dealing with single-output operations, I can correctly validate the results using Python bindings by creating a memref and invoking the operation using ExecutionEngine.invoke(). This works by leveraging APIs such as:

```
get_ranked_memref_descriptor()
make_nd_memref_descriptor(rank, type)
```
However, for multi-output operations, I am encountering issues.

What I Have Tried:

I created two separate memref descriptors for the two outputs (variance and mean).
I attempted to pass these memrefs to engine.invoke() to capture both results.
Unfortunately, I am unable to retrieve the correct outputs when invoking the operation.

Single output (works correctly)

```
res_memref = make_nd_memref_descriptor(rank, element_type)
engine.invoke("single_output_op", input_memref, res_memref)
```
Multiple outputs (not working)

```
var_memref = make_nd_memref_descriptor(rank, element_type)
mean_memref = make_nd_memref_descriptor(rank, element_type)
engine.invoke("multi_output_op", var_memref, mean_memref,input_memref)
```
Unable to get the correct results
How can I correctly handle multiple outputs in ExecutionEngine.invoke() when testing multi-output operations in Python?
Is there a recommended approach to create and pass multiple memrefs for capturing multiple outputs?
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to