Skip to content

support squat matrices in PreserveLinalgMatvecAsLinearTransform - #149

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_996219252
Open

copybara-service[bot] wants to merge 1 commit into
mainfrom
test_996219252

Conversation

@copybara-service

Copy link
Copy Markdown

support squat matrices in PreserveLinalgMatvecAsLinearTransform

Enables PreserveLinalgMatvecAsLinearTransform to match squat matrices
(numDiagonals < numCols) when the target backend supports linear
transforms, and append the necessary squat-diagonal fold reduction tree
via implementSquatDiagonalFold. This avoids falling back to the lower-benefit
rotate-and-reduce lowering and emits higher-level kernel.linear_transform
for squat matvecs.

Example improvements

  • matvec512x784_test:
    • Baseline: 0.394s
    • With change: 0.352s (~10.7% speedup)
  • lola_test:
    • Baseline: preprocessed 811.9ms, total 3.87s
    • With change: preprocessed 801.7ms, total 3.81s

Enables PreserveLinalgMatvecAsLinearTransform to match squat matrices
(numDiagonals < numCols) when the target backend supports linear
transforms, and append the necessary squat-diagonal fold reduction tree
via implementSquatDiagonalFold. This avoids falling back to the lower-benefit
rotate-and-reduce lowering and emits higher-level kernel.linear_transform
for squat matvecs.

Example improvements

- matvec512x784_test:
  - Baseline: 0.394s
  - With change: 0.352s (~10.7% speedup)
- lola_test:
  - Baseline: preprocessed 811.9ms, total 3.87s
  - With change: preprocessed 801.7ms, total 3.81s

PiperOrigin-RevId: 996219252
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.

1 participant