Skip to content

[Snippets][CPU] Introduce EliminateInplaceOps pass#33963

Open
aobolensk wants to merge 2 commits intoopenvinotoolkit:masterfrom
aobolensk:snippets-cpu-eliminate-inplace-ops
Open

[Snippets][CPU] Introduce EliminateInplaceOps pass#33963
aobolensk wants to merge 2 commits intoopenvinotoolkit:masterfrom
aobolensk:snippets-cpu-eliminate-inplace-ops

Conversation

@aobolensk
Copy link
Contributor

Details:

  • Make jit_fill_emitter not responcible for inplace operations
  • Introduce EliminateInplaceOps pass as a part of snippets pass pipeline that removes all inplace operations so they don't reach code emission stage

Tickets:

  • 126270

Copy link
Contributor

@v-Golubev v-Golubev left a comment

Choose a reason for hiding this comment

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

Actually, such Fill ops shouldn't be inserted at all. Previously, we had to have them in the graph for all loop iterations, because InsertSpecificIterations was applied after AssignRegisters. Now, we can change this behavior, and insert Fill op only for last loop iteration. To do that, we should replace an existing SetFillOffset with a new InsertFill handler

@aobolensk
Copy link
Contributor Author

aobolensk commented Feb 5, 2026

Actually, such Fill ops shouldn't be inserted at all. Previously, we had to have them in the graph for all loop iterations, because InsertSpecificIterations was applied after AssignRegisters. Now, we can change this behavior, and insert Fill op only for last loop iteration. To do that, we should replace an existing SetFillOffset with a new InsertFill handler

I have tried to implement it but faced with a problem that on the insertion point I actually just don't know whether Fill should be only the last iteration or in the entire loop.

The point is that it should be performed contextually. For example, in softmax, there is need in Fill for all iterations sometimes (at least since it required pre-fill for max calculation), in other reduce only cases - only on the last

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants