gpu: keep the accumulator in registers when two matmuls in a loop write the same tile
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 22/100
Research direction
Start from the pass added in #3381 that promotes a tensor-core accumulator to registers across a loop, and find where it decides a tile is single-matmul only. The reproducer is the loop in the issue body: two matmuls writing the same tile offset, with a second sa/sb buffer feeding the second one. Done means that shape also keeps acc[w] in registers, verified against the existing pass tests and this two-buffer loop.
Written by the indexing model from the issue text.
Description
The pass that keeps a tensor-core accumulator in registers through a loop (#3381) takes a tile that one matmul reads and writes. A loop with two matmuls into the same tile keeps the accumulator in shared memory:
for kp in 0..k / 64 {
// copies of two K tiles into sa[0], sb[0] and sa[1], sb[1]
for w in 0..4 across subgroups {
acc[w] = acc[w] + (sa[0][w] as f32) @ (sb[0] as f32);
}
for w in 0..4 across subgroups {
acc[w] = acc[w] + (sa[1][w] as f32) @ (sb[1] as f32);
}
}
This is the shape of a kernel with two tile buffers, where the copy of the second tile runs while the subgroups use the first. All the matmuls into the tile at the same offset should share one set of registers.
- Dominant language
- Rust
- Stars
- 35
- Forks
- 5
- Avg merge
- 12h 26m
- Merged PRs (30d)
- 799
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vx-lang/Vx
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
bug testing
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
`pub struct` gives "Expected 'fn' after 'pub'": the error should say that a struct needs no `pub`Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug devex
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
longbridge/gpui-kit#4031 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
neuralmagic/crucible#465 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
compiler P3
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
HerringtonDarkholme/hd-lang#2162 ·
Maintainers usually reply within 1 day
-
embedded SQL: pin correlated-guard behaviour when a closed variable is reassigned inside a branchOpenpriority: low
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
jonathanong/no-mistakes#3627 ·
Maintainers usually reply within 1 day