Skip to content

Optimize transpose operation using shared memory for LLVMGPU backend #10005

Closed

Description

@ThomasRaoux

Request description

Currently transpose operations are being vectorized (as long as they are aligned) and we usually end up with code that looks like:

r0 = load
r1 = load
r2 = load
r3 = load
store4 { r0, r1, r2, r3 }

We could optimize it using shared memory to be able to do load4 from main memory.

We should do:

{r0, r1, r2, r3} = load4
store4 {r0, r1, r2, r3} -> shared memory
m0 = load_shared_memory
m1 = load_shared_memory
m2 = load_shared_memory
m3 = load_shared_memory 
store4 {m0, m1, m2, m3} -> global

Note that In order to avoid bank conflicts we should make sure the shared memory allocation is aligned on 32 + 1.

We should start with aligned case and then this can be combined with #10003 to handle unaligned cases.

What component(s) does this issue relate to?

Compiler

Additional context

No response

Activity

  1. added
    performance ⚡
    codegen/nvvm
    on Aug 4, 2022
  2. allieculp commented on Aug 4, 2022

    @allieculp

    @okkwon Any idea of priority for this?

  3. okkwon commented on Aug 5, 2022

    @okkwon
    Member

    It is already set to P2.

  4. ThomasRaoux commented on Aug 16, 2022

    @ThomasRaoux
    ContributorAuthor
  5. added a commit that references this issue on Aug 30, 2022
  6. ThomasRaoux commented on Mar 22, 2023

    @ThomasRaoux
    ContributorAuthor

    Done and working

  7. moved this from Not Started to Done in (Deprecated) IREEon Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

codegen/nvvmperformance ⚡

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions