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

Feature/support numba057 #1030

Merged
merged 9 commits into from
May 22, 2023
Merged

Feature/support numba057 #1030

merged 9 commits into from
May 22, 2023

Conversation

diptorupd
Copy link
Contributor

@diptorupd diptorupd commented May 5, 2023

  • Have you provided a meaningful PR description?

Updates numba-dpex to be compatible with numba 0.57. Summary of changes:

  • The in-tree copies of parfor module has been removed and numba-dpex now uses the upstream parfor module and passes.

  • The numba-dpex lowering pass has been removed and parfor lowerer has been updated to handle both lowering when Numba's sroa-like optimization is enabled or disabled.

  • The Numba monkey patches were refactored and split out of the _patches module and moved into a new numba_pathces sub-modules.

  • The deprecated lowerer module has been removed.

  • The NUMBA_DPEX_FALLBACK_ON_CPU config is removed as there is no fallback to CPU for parfor nodes generated for dpnp array expressions.

  • All the parfor lowering modules are now organized into a numba_dpex.core.parfors module.

  • Have you added a test, reproducer or referred to an issue with a reproducer?

  • Have you tested your changes locally for CPU and GPU devices?

  • Have you made sure that new changes do not introduce compiler warnings?

  • If this PR is a work in progress, are you filing the PR as a draft?

Fixes #1028, #1000

@diptorupd diptorupd requested a review from chudur-budur as a code owner May 5, 2023 04:32
@diptorupd diptorupd marked this pull request as draft May 5, 2023 04:32
@diptorupd diptorupd changed the title Feature/support numba057 [WIP] Feature/support numba057 May 5, 2023
@diptorupd
Copy link
Contributor Author

parfor is broken due to the mk_alloc monkeypatch not getting applied properly.

@diptorupd
Copy link
Contributor Author

parfor is broken due to the mk_alloc monkeypatch not getting applied properly.

Fixed the monkey patches. However, something has changes in the typing and dpnp.ndarray is getting inferred as a types.Array and not DpnpNdArray. That is leading to a lowering failure.

@diptorupd
Copy link
Contributor Author

diptorupd commented May 14, 2023

Switching dpex to use Numba's default ParforLower and the NativeParforLowering pass means we do not disable sroa optimization always. Tests need to be added to check if dpex works with both SROA diabled and enabled.

Also, debugging no longer uses dpex's DIBuilder. Need to evaluate.

@diptorupd diptorupd force-pushed the feature/support_numba057 branch 3 times, most recently from c05c817 to e76feca Compare May 18, 2023 21:05
Diptorup Deb added 3 commits May 19, 2023 00:26
   - Moves the Numba monkey patches out of _patches.py
     and into separate modules in a new numba_patches sub-modules.
   - Uses the refactored monkey patches modules
   - Import only __version__ fron numba instead of
     import whole of numba
   - Fixes an issue where the Vectorize registry was getting
     updated inside the dpctl libsyclinterface load function.
    - Removes the in-tree copy of the parfor module with the Numba 0.57
      version of the module.
    - Updates imports to reflect the change in parfor module.
    - Removes deprecated lowerer module.
    - Replaces the dpex-speciic lowering pass with the upstream
      NativeParforLowerer in the dpjit_pipeline. Our own lowering pass
      is now removed.
@diptorupd diptorupd force-pushed the feature/support_numba057 branch from 0bf1547 to ac67cd2 Compare May 19, 2023 06:17
Diptorup Deb added 4 commits May 19, 2023 01:19
   - Moves all parfor codegen files into core.parfors.
   - Renames parfor_lowering_pass to parfor_lowerer as the module
     no longer has a pass.
   - Updates to imports
   - Previously, all dpnp ufuncs were added to
     numba.np.npyimpl.registry. A new registry has been added to
     dpnp_iface.dpnpimpl and now the dpnp ufuncs are added to that
     registry.
   - The DpexKernelTarget has been updated to now load the functions
     in the dpnpimpl.registry.
   - Swapping of ufuncs to use OpenCL intrinsics inside DpexKernelTarget
     now happens only for specific dpnp math functions. As a side effect,
     numpy math functions are no longer supported inside a kernel.
@diptorupd diptorupd force-pushed the feature/support_numba057 branch from ac67cd2 to 04700b1 Compare May 19, 2023 06:19
@diptorupd diptorupd mentioned this pull request May 19, 2023
5 tasks
@github-actions
Copy link
Contributor

Documentation preview: show.

@diptorupd diptorupd changed the title [WIP] Feature/support numba057 Feature/support numba057 May 20, 2023
@diptorupd diptorupd requested a review from ZzEeKkAa May 20, 2023 04:18
@diptorupd diptorupd marked this pull request as ready for review May 20, 2023 04:24
@diptorupd diptorupd requested a review from mingjie-intel as a code owner May 20, 2023 04:24
@diptorupd
Copy link
Contributor Author

@ZzEeKkAa once you test out the docker image we are good to go. The Coverage workflow is failing temporarily due to some issues at coveralls.io's end.

@diptorupd
Copy link
Contributor Author

diptorupd commented May 20, 2023

The Coverage workflow is failing temporarily due to some issues at coveralls.io's end.

The coveralls.io glitch is gone and removing parfors gives us a 15% coverage boost!

@diptorupd diptorupd merged commit 6aca7c3 into main May 22, 2023
@diptorupd diptorupd deleted the feature/support_numba057 branch May 22, 2023 19:07
@github-actions
Copy link
Contributor

Documentation preview removed.

github-actions bot added a commit that referenced this pull request May 22, 2023
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.

Remove usage of lower_extensions
1 participant