Skip to content

actx.tag() comes too late to benefit eager mode execution #5

Open

Description

@inducer

For lazy mode, actx.tag(MyTag(), 2*x+3) works great. For eager mode, this doesn't help at all, as the result will already be computed (i.e. the kernel whose transformation would have benefited from the metadata was already executed). Is there a tagging interface that can work for both eager and lazy?

cc @alexfikl @thomasgibson @nchristensen @kaushikcfd

x-ref: inducer/meshmode#176

Activity

  1. thomasgibson commented on May 1, 2021

    @thomasgibson
    Collaborator

    This is more or less kinda what I was trying (albeit rushed/incomplete) in inducer/meshmode#170 --- Based on your comments there, I can imagine that one would tag information to a loopy program "as you go", which can then be transformed based on said information in transform_loopy_kernel. This is assuming that, when doing any kind of eager evaluation, it always ends up going through actx.call_loopy.

    Obviously with eager this would be somewhat limited (since results are computed as you go), but some level of code transformation can and should happen along the way.

    With lazy, this information just gets propogated through until evaluation is needed, and so I imagine these transformations will occur at the pytato level.

  2. thomasgibson commented on May 1, 2021

    @thomasgibson
    Collaborator

    In short, I think tagging can still work for eager.

    Update: Unless I am fundamentally misunderstanding something. I guess what I'm wondering is, if all expressions (whether eager or lazy) go through transform_loopy_kernel, then what can we do to potentially take advantage of this?

  3. inducer commented on May 3, 2021

    @inducer
    OwnerAuthor

    if all expressions (whether eager or lazy) go through transform_loopy_kernel, then what can we do to potentially take advantage of this?

    My thought was that lazy would bypass transform_loopy_kernel mostly. And much of eager (specifically the array arithmetic) also directly uses PyOpenCL array arithmetic and bypasses transform_loopy_kernel.

  4. inducer commented on May 3, 2021

    @inducer
    OwnerAuthor

    In short, I think tagging can still work for eager.

    I agree that it can, but what this issue is about is the method actx.tag, whose job it is to apply a tag to an array result. The complaint is that it'll only work for lazy.

  5. transferred this issue frominducer/meshmodeon May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions