EnzymeAD / EnzymeAD/Enzyme-JAX

Triangular Matrix Multiply

Open
#1,067 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
MLIR
Stars
131
Forks
53
Avg merge
1d 10h
Merged PRs (30d)
193

Description

Lowering to `dot_general` is not ideal in this case since it assumes dense tensors. We can pattern match triangular matrices and convert dot_general to a `enzymexla.trmm` which can be lowered to:

1. BLAS trmm with a custom_call (loop for the batched case)
2. cuBLAS trmm with a custom_call or to batched_trmm in the batched case
3. All other backends lower it back to a dot_general

We can possibly run the detection and lowering as a last pass, but any phase ordering issues needs to be confirmed once

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the existing lowering to dot_general and identify where triangular matrix patterns could be detected. Confirm phase-ordering constraints before deciding where the conversion belongs. Done means triangular cases use enzymexla.trmm, with the listed BLAS, cuBLAS, batched, and fallback paths accounted for.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.