Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Patch for parallel option "offload" #105

Closed

Conversation

PokhodenkoSA
Copy link

Introduced by @reazulhoque.
Possibly numba should provide a way to extend parallel options.

Field gen_spirv corresponds to offload option. gen_spirv is used only in numba.dppl.

Introduced by @reazulhoque.
Possibly numba should provide a way to extend parallel options.
@PokhodenkoSA PokhodenkoSA mentioned this pull request Nov 9, 2020
50 tasks
Copy link

@DrTodd13 DrTodd13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will certainly remove gen_spirv as a baked in Numba parallel option. If you had access at the right time in the compile process then you could monkey-patch this option back in from outside of default Numba. If these PRs are going to create a hook at the appropriate time then monkey patching would work.

@PokhodenkoSA
Copy link
Author

PokhodenkoSA commented Nov 10, 2020

Investigation results:

  1. gen_spirv variable is not necessary and could be removed, but value.pop('offload', False) make values empty and eliminates exception.
  2. dppl uses offload flag in examples and tests.
  • the final goal is to remove offload option for njit
    • examples and tests should be updated to use with context.
    • and dppl sources should also be changed to not use offload option
  • if it not be removed then we need to upstream it or monkey-patch as @DrTodd13 proposed.

Final conclusion: We need to modify tests and examples first and then remove the option.

/CC @diptorupd

@DrTodd13
Copy link

What is the proposal for how to convey offload mode to the compilation pipeline when compiling a function called within a with context? @PokhodenkoSA

@PokhodenkoSA
Copy link
Author

PokhodenkoSA commented Nov 10, 2020

What is the proposal for how to convey offload mode to the compilation pipeline when compiling a function called within a with context?

Sorry, I didn't understand the question. Could you please provide an example? It is possible that we missed something.

@DrTodd13
Copy link

What is the proposal for how to convey offload mode to the compilation pipeline when compiling a function called within a with context?

Sorry, I didn't understand the question. Could you please provide an example? It is possible that we missed something.

Previously, compilation would look at the parallel flags to see if it should go through the GPU offload code. If that flag is removed from the parallel flags object then what will compilation look at to determine whether to go through the GPU offload code or not?

@reazulhoque
Copy link

Hi @DrTodd13 I think right now we check if we are in dpctl device_context (https://github.com/IntelPython/numba/blob/pydppl/numba/dppl/target_dispatcher.py#L63).

@PokhodenkoSA
Copy link
Author

PokhodenkoSA commented Nov 12, 2020

@diptorupd @reazulhoque
Is it enough to have only with device_context to manipulate offloading? Is it really no need anymore for njit flag for offloading?
Possibly, I am not familiar well with last discussions with customers and our new commitments.

@diptorupd
Copy link

Yes, the semantics that we finalized is to not add any new njit flag and only use with device_context to trigger offloading. The njit can be removed IMO.

@PokhodenkoSA
Copy link
Author

Parallel option "offload" was removed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants