Skip to content

[water] Add design doc for elements-per-thread handling#790

Open
tyb0807 wants to merge 2 commits intoiree-org:mainfrom
tyb0807:ept
Open

[water] Add design doc for elements-per-thread handling#790
tyb0807 wants to merge 2 commits intoiree-org:mainfrom
tyb0807:ept

Conversation

@tyb0807
Copy link
Contributor

@tyb0807 tyb0807 commented Jan 30, 2026

This document analyzes how elements_per_thread (EPT) is used in PyWave and proposes that Water use index.size instead of separate EPT attributes.

TL;DR:

  • EPT is redundant for most ops (Read, Write, MMA, Reduce, Broadcast) since it's already encoded in index.size
  • Only Atomic and Scatter need special attributes (atomic_count, scatter_count) since they may process fewer elements than vector size
  • PropagateElementsPerThread pass can be simplified/removed

Please let me know if my understanding is not correct.

This document analyzes how elements_per_thread (EPT) is used in wave_lang
and proposes that Water use index.size instead of separate EPT attributes.

TL;DR:
- EPT is redundant for most ops (Read, Write, MMA, Reduce, Broadcast)
  since it's already encoded in index.size
- Only Atomic and Scatter need special attributes (atomic_count,
  scatter_count) since they may process fewer elements than vector size
- PropagateElementsPerThread pass can be simplified/removed

Signed-off-by: tyb0807 <sontuan.vu@amd.com>
Documents what code can be simplified if PropagateElementsPerThread
pass is removed and type conversion happens during lowering instead.

Signed-off-by: tyb0807 <sontuan.vu@amd.com>
Copy link
Contributor

@tgymnich tgymnich left a comment

Choose a reason for hiding this comment

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

Nice

@martin-luecke
Copy link
Contributor

I like the plan

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