iree icon indicating copy to clipboard operation
iree copied to clipboard

[Stream] Selecting unified encodings from encoding resolvers.

Open hanhanW opened this issue 2 weeks ago • 1 comments

Add a new getUnifiedEncoding method to the LayoutResolverAttr interface that returns a unified encoding given multiple candidate encodings. This is used by the UnifyEncodingForGlobals pass to select an appropriate encoding when the same source data has multiple encoded versions.

Also refactor GlobalEncodingAnalyzer to:

  • Set up the layout resolver from dialect interfaces internally
  • Compute unified encodings as part of the analysis phase
  • Provide a getUnifiedEncoding(name) getter for querying results

This simplifies the pass by moving analysis-related logic into the analyzer class, making the pass focused on applying transformations.

Update lit tests to include device definitions and affinity attributes on stream.tensor.* ops, which are required for the pass to resolve layout attributes properly. It also switches identity_resolver to specialization_resolver, which improves the test quality. Identity encoding is used in fallback solution.

It is a step towards https://github.com/iree-org/iree/issues/22485

hanhanW avatar Dec 12 '25 09:12 hanhanW

The PR depends on

  • https://github.com/iree-org/iree/pull/22886
  • https://github.com/iree-org/iree/pull/22891

hanhanW avatar Dec 12 '25 09:12 hanhanW