Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial evaluation of expressions in new pipeline #466

Open
ivogabe opened this issue Sep 9, 2020 · 0 comments
Open

Partial evaluation of expressions in new pipeline #466

ivogabe opened this issue Sep 9, 2020 · 0 comments

Comments

@ivogabe
Copy link
Contributor

ivogabe commented Sep 9, 2020

In the new pipeline, we should do partial evaluation of expressions on OperationAcc, as defined in Data.Array.Accelerate.AST.Operation. This is mainly beneficial for shapes of arrays.

  • The simplification should work on both host-side expressions (which are wrapped in Compute in PreOpenAcc) and device-side expressions (which are contained in ArgExp or ArgFun).
  • When doing inline, take into account that scalars can both exists in the buffer environment ('external' environment, mainly containing shapes of arrays) and the scalar environment ('local' environment, containing variables bound by lambdas and lets). That is, we should keep track of inlinable expressions in both env and benv in OpenExp env benv e.
  • We may want to re-enable optimizations on associative functions, especially on min as we use that to compute the intersection of shapes. When doing a zipWithN with N>2, we have a chain of min calls and we'd like to simplify that as much as possible.
  • To optimize min better, it might be useful to also keep track of inequalities (eg x <= y) during simplification. This may help us to simplify many shape computations.
  • After partial evaluation we know which arrays have the same size. We should then remove shrink operations for which the output size matches the input size (see mkShrink in Desugar.hs, or a backpermute id which preserves the size). This will allow us to do a zip in constant time
@ivogabe ivogabe added this to To do in Project Elektra via automation Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant