Phase 3, week 17retrospective

Second-op decision

Softmax adds a reduction the phase-1 path never had, so the choice is a new mechanism against remaining time, not reuse against signal.


Two candidates, one calendar

Softmax is one op with a row reduction around it. An attention block is two contractions around that softmax, plus masking and a layout decision at each boundary. The second is several times the work and it is the one that looks like the job.

The decision is not which is more impressive. It is which one you can carry to a measured table in the weeks you have, because the table is the deliverable and the op is the vehicle.

Price the new mechanisms, not the lines of code

Count what the existing path does not already do. A row reduction is new: vector.multi_reduction with a seed and an ordering rule, and RVV gives you vfredmax and a choice of vfredusum or vfredosum. An exponential is new and worse: there is no vector exponential on RVV, so math.exp becomes a libcall per element until you write a polynomial. Attention adds two contractions you already know how to tile, a transpose you can avoid with the right indexing map, and a fusion decision that determines whether the score matrix ever reaches memory.

That list is the estimate. If two of the new mechanisms are still open when week 20 arrives, the choice was made too late.

What each one lets you say

Softmax supports a claim about a reduction and about the cost of an exponential on a machine with no matrix unit. Attention supports a claim about arithmetic intensity: the materialised form moves the score matrix four times per head, the fused form does not, and the speedup grows with sequence length. The second claim is the one that transfers to another machine, because it is about traffic rather than about this instruction set.

An interviewer can only ask about what you built. Both give them something to ask.

Things that break

Choosing attention because it sounds like the job, then arriving at week 24 with two unfused matmuls and no table. The other failure is choosing softmax and stopping there: a single elementwise op with a reduction does not demonstrate that you can reason about a fusion boundary, and the phase is supposed to end with one.

Sources

A version records the documentation the claim was checked against, not a house pin. Confirm flags with --help on the release you installed.

Check yourself

What does softmax add to a path that already lowers a tiled matmul?

Which reason for choosing the attention block survives scrutiny?

Four weeks remain and neither operator is benchmarked. Which choice is defensible?

0 / 3 correct

← back to the map