Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feature request: reduction isomorphisms to factor expensive operations out of the loop #79

@Krastanov

Description

@Krastanov

It might be a bit too early to be submitting feature requests, but I recently started toying with LoopModels and thought it would not be a bad idea to copy over some of the LoopVectorizations feature requests that are important to me. Hopefully when this project is mature enough I would be able to contribute actual PRs.

Namely, the transformation mapreduce(fₐ, opₐ, arr) into fᵦ(reduce(opᵦ, arr)) can be extremely useful for increasing performance by taking the elementwise function f and factoring it out of the loop (maybe with some transformation applied to it).

  • In classical error correcting codes and quantum Clifford circuits it is about factoring out count_ones over the xor operator.
  • In probability theory /stats it is about using log(x*y)=log(x)+log(y)
  • It seems it is also useful in graph theory and GraphBLAS has the arithmetic semiring (+, *) replaced with an arbitrary one like (max, +) for instance.

References:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions