Skip to content

Conversation

@andrey-golubev
Copy link
Contributor

Summary

Generally, to_tensor and to_buffer already perform sufficient verification. However, there are some unnecessarily strict constraints:

  • builtin tensor requires its buffer counterpart to always be memref
  • to_buffer on ranked tensor requires to always return memref

These checks are assertions (i.e. preconditions), however, they actually prevent an apparently useful bufferization where builtin tensors could become custom buffers. Lift these assertions, maintaining the verification procedure unchanged, to allow builtin -> custom bufferizations at operation boundary level.

JIRA ticket

Related PR in NPU Compiler and/or OpenVINO repository with sub-module update

  • PR-xxx

Other related tickets

List tickets for additional work, eg, something was found during review but you agreed to address it in another Jira

  • E-xxxxx

…705)

Generally, to_tensor and to_buffer already perform sufficient
verification. However, there are some unnecessarily strict constraints:
* builtin tensor requires its buffer counterpart to always be memref
* to_buffer on ranked tensor requires to always return memref

These checks are assertions (i.e. preconditions), however, they actually
prevent an apparently useful bufferization where builtin tensors could
become custom buffers. Lift these assertions, maintaining the
verification procedure unchanged, to allow builtin -> custom
bufferizations at operation boundary level.
@andrey-golubev andrey-golubev requested a review from a team as a code owner November 18, 2025 12:33
@andrey-golubev
Copy link
Contributor Author

This should allow us to switch to mlir::bufferization::getBuffer() instead of maintaining our copy of it in NPU.

@andrey-golubev andrey-golubev merged commit 6ccc228 into npu/release/20.x Nov 19, 2025
8 checks passed
@andrey-golubev andrey-golubev deleted the cherry_pick_to_buffer_fix branch November 19, 2025 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants