Skip to content

iree.composite_buffer type to reduce malloc storm during lowering #3354

Closed

Description

@benvanik

Finding that after the flow level of large constants that remain after optimization are copied a few times due to storage uniquer misses. Especially during the final stages of transformation where buffers are stitched together (constant storage packing, etc). For really big constants it's better to extern those, but for the mid-size ones (or when targeting certain deployments) it'd be nice not to be churning through GBs of memory :/

Having a custom attribute type that stores a list of (offset, length, elements_attr) tuples would let us reuse the uniqued storage for the larger elements attribute up until final serialization (where we are streaming to an output and not just malloc+memcpying).

Something like #iree.composite_buffer<[#iree.span<0, 1024, dense<...>...>, ...]> with a CompositeBufferAttr::writeTo(...stream...) method.

Activity

  1. added
    compiler/dialects
    performance ⚡
    on Oct 6, 2020
  2. self-assigned this
    on Oct 6, 2020
  3. added
    ew 🤮
    on Nov 22, 2020
  4. added 5 commits that reference this issue on Aug 25, 2021
    d0f91aa
    21373be
    7cac8c7
    70c2123
    e59758e
  5. added a commit that references this issue on Aug 25, 2021
    30463f1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

compiler/dialectsew 🤮performance ⚡

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions