Skip to content

RFC: Simplify tweezer kernel execution. #94

@weinbe58

Description

@weinbe58

Background

Currently in order to execute a tweezer kernel one must assign the tones to a tweezer kernel to get a device function:


x_tones = range(...)
y_tones = range(...)
device_fn = schedule.device_fn(tweezer_kernel, x_tones, y_tones)
# invoke device function to do actual execution
device_fn(...)

Proposal

However, in most cases if the tweezer has eclusive access to the AOD, which is a lot of current use-cases, we can infer the x_tones and y_tones from the invoke statement of device_fn (assuming the arguments are compile time constants.

As such it would make sense to allow for a simplified call convention. where if you directly invoke tweezer_kernel directly, it will automatically assign the tones to the kernel because in this case there is exclusive access to the AOD.

The previous code could be simplified to: tweezer_kernel(...).

implementation

In this case all we need to do is implement a special path.AutoGen statement in the path dialect that would at runtime/const-prop generate the Path value with the appropriate x_tones and y_tones from the Trace analysis of the kernel with the arguments provided.

Then in the rewrite from Schedule to Path the RewriteInvoke will need to be updated to look for this call convention and rewrite the invoke to path.AutoGen

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions