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

Proposal for resolving benign validation errors when auto-optimizing for non-CPU devices #1323

Closed
wants to merge 3 commits into from

Conversation

alexnick83
Copy link
Contributor

A standard workflow for optimizing programs to run on non-CPU devices involves instrumenting smaller kernels assuming that the inputs and output (non-transient data) are already on the device, i.e., no copies from the host to the device and back are needed. This is usually achieved by changing the non-transient data's storage to, e.g., GPU or FPGA global memory and then applying the appropriate device-specific transformation. However, when auto-optimizing, many other transformations are executed before GPU/FPGATransform. During this process, the SDFG is most likely invalid because the non-transient data on the device may appear to be accessed in the host's context, resulting in validation errors. Such errors are benign since the device-specific transformations will appropriately update schedules and storages, and they will introduce any needed copies.

This PR proposes a quick way to address the above issue. It introduces a new configuration parameter, check_accessibility, under the experimental category, having by default the value True. The fix consists of two components:

  • The dace.sdfg.validation._accessible helper method checks the parameter's value and immediately returns True if the parameter is set to False.
  • The auto-optimizer sets the parameter to False, if the selected device is other than CPU. It restores the original value of the parameter (as set by the user) just before applying GPU or FPGATransform.

…onding configuration parameter is set to False.
…estores the configuration parameter's value just before applying device-specific transformations.
@tbennun
Copy link
Collaborator

tbennun commented Jul 21, 2023

@alexnick83 shall we close this?

@BenWeber42
Copy link
Contributor

Hi, thanks a lot for the excellent description. It sounds like this PR tends to be more of a work-around than a proper fix. Is this issue still a priority?

@alexnick83
Copy link
Contributor Author

I think this is superseded by PR #1405 but the correct workflow should be documented.

@alexnick83 alexnick83 closed this Nov 13, 2023
@alexnick83 alexnick83 deleted the autoopt-device-validation-issues branch November 13, 2023 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants