You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ee8db17
Browse filesBrowse the repository at this point in the historyBrowse files
feat: amd: rank the matrix entries by issues, with a place
for cycles
Choosing the narrowest entry that fits is a guess, not a rule. Thirteen
output columns take four 4x4 issues or one 16x16 that wastes three of its
sixteen, and which is faster is a property of the two instructions rather
than of the waste.
So the selection is a ranking. issues() counts what an entry takes for
the whole contraction across its four axes; rank() orders by that and
multiplies in CYCLES where it knows an entry. CYCLES is empty and stays
empty until the numbers are read off the ISA and checked like every other
row in the catalogue -- guessing them would make a count read as a cost
model. Filling it is then a table edit rather than a rewrite.
spare_products() is the axis predicate the packing work needed and
packing.py deliberately does not carry: a term product occupies every
output column, so an entry holds a further one only where it is that much
wider. Nine columns leave 23 of a 32-wide entry, which is two more
products; 7 of a 16-wide one, which is none. The contraction axis has
the small quantum and no spare, and the lane axis costs a cross-lane
reduction, so the output axis is the one worth spending.
All three schemes enumerate candidates now, not only the emulated one --
exchange_ops and emu_tiles beside the singular selections, with the
conditions still stated once. ComputeShape carries the leading dimension
and the depth so a ranking can read them; an extent of 0 counts as one
tile, so a caller that does not know them ranks by what it does.
emu_tiles keeps the emitter's k == m condition and now says what it
costs: the 32-wide entry, where three term products would share an issue
instead of one.
AI-generated. Model: Opus 5
0 commit comments