We have been trying to construct an example where instead of calling acquire(ObjectFifoPort.Consume, 1) and release(ObjectFifoPort.Consume, 1) inside the python code which turns into MLIR, we use the ::acquire_equal and ::release instrinsics found inside <aie_api/aie.hpp>. The purpose of this being to enable data-driven locking behavior from inside the kernel code (we would want to have free-running kernels that we only call once for the entire execution of an application).
However we have ran into two issues in attempting this:
a.) the two intrinsics functions simply break our kernels, where a basic pass-through instead of copying the input array to the output array using a compute tile, doesn't move anything from simply calling either or both of these functions. We have tried using various lock ids and various values for what to set the locks to but nothing seemed to work. Is there any example we could use for how to use these intrinsics & confirmation that they should indeed work on the Ryzen NPUs and locking behavior is not limited to what can be generated for MLIR.
b.) Moving the locking to the kernel-side means also not using the acquire and release functions in python, however these seem necessary to turn an object fifo into a memref which can be passed to a kernel function call. From looking at the source code, we observed that a ObjectFifoSubviewType type object is created during lock acquisition using ObjectFifoSubviewAccessOp. Is there a way to just directly pass a memref to the kernel without calling the lock acquisition function?
Cheers,
Lukas
We have been trying to construct an example where instead of calling acquire(ObjectFifoPort.Consume, 1) and release(ObjectFifoPort.Consume, 1) inside the python code which turns into MLIR, we use the ::acquire_equal and ::release instrinsics found inside <aie_api/aie.hpp>. The purpose of this being to enable data-driven locking behavior from inside the kernel code (we would want to have free-running kernels that we only call once for the entire execution of an application).
However we have ran into two issues in attempting this:
a.) the two intrinsics functions simply break our kernels, where a basic pass-through instead of copying the input array to the output array using a compute tile, doesn't move anything from simply calling either or both of these functions. We have tried using various lock ids and various values for what to set the locks to but nothing seemed to work. Is there any example we could use for how to use these intrinsics & confirmation that they should indeed work on the Ryzen NPUs and locking behavior is not limited to what can be generated for MLIR.
b.) Moving the locking to the kernel-side means also not using the acquire and release functions in python, however these seem necessary to turn an object fifo into a memref which can be passed to a kernel function call. From looking at the source code, we observed that a ObjectFifoSubviewType type object is created during lock acquisition using ObjectFifoSubviewAccessOp. Is there a way to just directly pass a memref to the kernel without calling the lock acquisition function?
Cheers,
Lukas