[Codegen] Add phase group information into a new enum for shared mem info#24471
[Codegen] Add phase group information into a new enum for shared mem info#24471Muzammiluddin-Syed-ECE wants to merge 10 commits into
Conversation
0ca1510 to
a1669f9
Compare
kuhar
left a comment
There was a problem hiding this comment.
Why is the shared mem model so coarse-grained? For example, the number of banks changed between cdna3 and cdna4.
|
I was reading the original PR comment: #24428 (comment). Just wondering, would it be a better choice to keep bank_count, bank_width, and phase_schedule as orthogonal fields? Bundling them into one enum would mean adding a new SharedMemoryModel case for every change, which might feel like a bit ofburden |
The coarseness reflects how little the shared mem model changes in the features it tracks across architectures. For your example, there is only a real distinction in the cdna line between cdna1-3 and cdna4 so only cdna4 is given its own enum. edit: Thinking on it longer, we don't lose anything by having an entry per arch and gain clarity. ill just make it more fine-grained. |
Because these fields represent hardware details, they are extremely stable and shouldn't change beyond adding new entries for every new piece of hardware. |
c8fd2a6 to
0b9a60c
Compare
| // Write operations (ds_write_*) may have different phase scheduling, but | ||
| // we haven't needed to handle write-side bank conflicts yet. | ||
| std::optional<SmallVector<SmallVector<int64_t>>> | ||
| getPhaseGroups(SharedMemoryModel model, int64_t readBytes, int64_t numThreads) { |
There was a problem hiding this comment.
Can you rename it to indicate these are read phase groups? Writes have their own groups.
There was a problem hiding this comment.
I'd rather add a todo to add an access type function argument like AccessType rw where AccessType is an enum with values {READ, WRITE}.
getPhaseGroups(SharedMemoryModel model, int64_t readBytes, int64_t numThreads, AccessType rw)…ry information Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
f8f9eb4 to
fd277d1
Compare
fd277d1 to
f8f3e03
Compare
This is the first of two PRs meant to improve the xor shuffling strategy for resolving bank conflicts. See: #24428
This change does two things: