Skip to content

Framework for symbolic optimizations #122

@ViralBShah

Description

@ViralBShah

We need a framework to express certain mathematical optimizations in julia itself. These may be expressed as rules that are run after types have been inferred. Examples are:

  1. A' * B, A' \ B: Can be computed without computing the transpose by calling BLAS/LAPACK routines
  2. A - B + C .* D: Can be computed without temporaries
  3. A[m:n, p:q] + B: Avoid computing the ref.
  4. A[m:n, p:q] * B: Avoid computing the sref, and call DGEMM directly in cases where this is possible.
  5. [ a b c; d f; e]: Compute the entire concatenation in one shot.
  6. A[p,q] = B[r,s]: Temporary can be avoided by calling assign(A, sub(B, r, s), p, q)

In all cases, temporaries can be avoided. Either we can do it with optimizations, or have the parser such expressions down to the runtime. If a matching runtime implementation for such cases is not found, the existing base case should certainly be used.

Metadata

Metadata

Assignees

Labels

performanceMust go fasterspeculativeWhether the change will be implemented is speculative

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions