Skip to content

Commit

Permalink
Merge pull request #1435 from IntelPython/fix/windows-parfor
Browse files Browse the repository at this point in the history
Migrate parfor to SPIRVKernelDispatcher 675cb79
  • Loading branch information
github-actions[bot] committed Apr 30, 2024
1 parent 740274d commit 6103b6b
Show file tree
Hide file tree
Showing 124 changed files with 1,073 additions and 586 deletions.
2 changes: 1 addition & 1 deletion dev/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 4dd9bd111271e8299ebcca45d149268b
config: fd05f27b09982a018355b52b5e35eb29
tags: 645f666f9bcd5a90fca523b33c5a78b7
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Overview
:widths: auto
:class: summarytable

* - :py:obj:`create_kernel_for_parfor <numba_dpex.core.parfors.kernel_builder.create_kernel_for_parfor>`\ (lowerer, parfor_node, typemap, flags, loop_ranges, has_aliases, races, parfor_outputs)
* - :py:obj:`create_kernel_for_parfor <numba_dpex.core.parfors.kernel_builder.create_kernel_for_parfor>`\ (lowerer, parfor_node, typemap, loop_ranges, races, parfor_outputs)
- Creates a numba_dpex.kernel function for a parfor node.
* - :py:obj:`update_sentinel <numba_dpex.core.parfors.kernel_builder.update_sentinel>`\ (kernel_ir, sentinel_name, kernel_body, new_label)
- Searched all the blocks in the IR generated from a kernel template and
Expand All @@ -36,14 +36,14 @@ Overview
Classes
-------

.. py:class:: ParforKernel(name, kernel, signature, kernel_args, kernel_arg_types, queue: dpctl.SyclQueue, local_accessors=None, work_group_size=None)
.. py:class:: ParforKernel(signature, kernel_args, kernel_arg_types, local_accessors=None, work_group_size=None, kernel_module=None)
Functions
---------
.. py:function:: create_kernel_for_parfor(lowerer, parfor_node, typemap, flags, loop_ranges, has_aliases, races, parfor_outputs) -> ParforKernel
.. py:function:: create_kernel_for_parfor(lowerer, parfor_node, typemap, loop_ranges, races, parfor_outputs) -> ParforKernel
Creates a numba_dpex.kernel function for a parfor node.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ Classes

* - :py:obj:`dump_kernel_string <numba_dpex.core.parfors.kernel_templates.kernel_template_iface.KernelTemplateInterface.dump_kernel_string>`\ ()
- :summarylabel:`abc` \-
* - :py:obj:`dump_kernel_ir <numba_dpex.core.parfors.kernel_templates.kernel_template_iface.KernelTemplateInterface.dump_kernel_ir>`\ ()
- :summarylabel:`abc` \-


.. rubric:: Members
Expand All @@ -49,10 +47,6 @@ Classes
:abstractmethod:


.. py:method:: dump_kernel_ir()
:abstractmethod:





Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ Classes

* - :py:obj:`dump_kernel_string <numba_dpex.core.parfors.kernel_templates.range_kernel_template.RangeKernelTemplate.dump_kernel_string>`\ ()
- Helper to print the kernel function string.
* - :py:obj:`dump_kernel_ir <numba_dpex.core.parfors.kernel_templates.range_kernel_template.RangeKernelTemplate.dump_kernel_ir>`\ ()
- Helper to dump the Numba IR for the RangeKernelTemplate.


.. rubric:: Members
Expand All @@ -53,11 +51,6 @@ Classes
Helper to print the kernel function string.


.. py:method:: dump_kernel_ir()
Helper to dump the Numba IR for the RangeKernelTemplate.





Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ Classes

* - :py:obj:`dump_kernel_string <numba_dpex.core.parfors.kernel_templates.reduction_template.TreeReduceIntermediateKernelTemplate.dump_kernel_string>`\ ()
- Helper to print the kernel function string.
* - :py:obj:`dump_kernel_ir <numba_dpex.core.parfors.kernel_templates.reduction_template.TreeReduceIntermediateKernelTemplate.dump_kernel_ir>`\ ()
- Helper to dump the Numba IR for a


.. rubric:: Members
Expand All @@ -57,12 +55,6 @@ Classes
Helper to print the kernel function string.


.. py:method:: dump_kernel_ir()
Helper to dump the Numba IR for a
TreeReduceIntermediateKernelTemplate.




.. py:class:: RemainderReduceIntermediateKernelTemplate(kernel_name, kernel_params, sentinel_name, redvars, parfor_reddict, redvars_dict, typemap, legal_loop_indices, global_size_var_name, global_size_mod_var_name, partial_sum_size_var_name, partial_sum_var_name, final_sum_var_name, reductionKernelVar)
Expand All @@ -83,8 +75,6 @@ Classes

* - :py:obj:`dump_kernel_string <numba_dpex.core.parfors.kernel_templates.reduction_template.RemainderReduceIntermediateKernelTemplate.dump_kernel_string>`\ ()
- Helper to print the kernel function string.
* - :py:obj:`dump_kernel_ir <numba_dpex.core.parfors.kernel_templates.reduction_template.RemainderReduceIntermediateKernelTemplate.dump_kernel_ir>`\ ()
- Helper to dump the Numba IR for the


.. rubric:: Members
Expand All @@ -94,12 +84,6 @@ Classes
Helper to print the kernel function string.


.. py:method:: dump_kernel_ir()
Helper to dump the Numba IR for the
RemainderReduceIntermediateKernelTemplate.





Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ Overview



.. list-table:: Attributes
:header-rows: 0
:widths: auto
:class: summarytable

* - :py:obj:`keep_alive_kernels <numba_dpex.core.parfors.parfor_lowerer.keep_alive_kernels>`
- \-


Classes
-------
Expand Down Expand Up @@ -96,12 +88,5 @@ Classes



Attributes
----------
.. py:data:: keep_alive_kernels
:value: []





Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Overview

* - :py:obj:`get_dpnp_ufunc_typ <numba_dpex.core.parfors.parfor_pass.get_dpnp_ufunc_typ>`\ (func)
- get type of the incoming function from builtin registry
* - :py:obj:`mk_alloc <numba_dpex.core.parfors.parfor_pass.mk_alloc>`\ (typingctx, typemap, calltypes, lhs, size_var, dtype, scope, loc, lhs_typ, \*\*kws)
- generate an array allocation with np.empty() and return list of nodes.



Expand Down Expand Up @@ -93,6 +95,15 @@ Functions
get type of the incoming function from builtin registry


.. py:function:: mk_alloc(typingctx, typemap, calltypes, lhs, size_var, dtype, scope, loc, lhs_typ, **kws)
generate an array allocation with np.empty() and return list of nodes.
size_var can be an int variable or tuple of int variables.
lhs_typ is the type of the array being allocated.

Taken from numba, added kws argument to pass it to __allocate__





Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@


:orphan:

numba_dpex.core.parfors.parfor_sentinel_replace_pass
====================================================

.. py:module:: numba_dpex.core.parfors.parfor_sentinel_replace_pass
Overview
--------
.. list-table:: Classes
:header-rows: 0
:widths: auto
:class: summarytable

* - :py:obj:`ParforBodyArguments <numba_dpex.core.parfors.parfor_sentinel_replace_pass.ParforBodyArguments>`
- Arguments containing information to inject parfor code inside kernel.
* - :py:obj:`ParforSentinelReplacePass <numba_dpex.core.parfors.parfor_sentinel_replace_pass.ParforSentinelReplacePass>`
- Base class for function passes




Classes
-------

.. py:class:: ParforBodyArguments
Bases: :py:obj:`NamedTuple`

Arguments containing information to inject parfor code inside kernel.


.. rubric:: Overview

.. list-table:: Attributes
:header-rows: 0
:widths: auto
:class: summarytable

* - :py:obj:`loop_body <numba_dpex.core.parfors.parfor_sentinel_replace_pass.ParforBodyArguments.loop_body>`
- \-
* - :py:obj:`param_dict <numba_dpex.core.parfors.parfor_sentinel_replace_pass.ParforBodyArguments.param_dict>`
- \-
* - :py:obj:`legal_loop_indices <numba_dpex.core.parfors.parfor_sentinel_replace_pass.ParforBodyArguments.legal_loop_indices>`
- \-



.. rubric:: Members

.. py:attribute:: loop_body
:type: any



.. py:attribute:: param_dict
:type: any



.. py:attribute:: legal_loop_indices
:type: any





.. py:class:: ParforSentinelReplacePass
Bases: :py:obj:`numba.core.compiler_machinery.FunctionPass`

Base class for function passes



.. rubric:: Overview


.. list-table:: Methods
:header-rows: 0
:widths: auto
:class: summarytable

* - :py:obj:`run_pass <numba_dpex.core.parfors.parfor_sentinel_replace_pass.ParforSentinelReplacePass.run_pass>`\ (state)
- Runs the pass itself. Must return True/False depending on whether


.. rubric:: Members

.. py:method:: run_pass(state)
Runs the pass itself. Must return True/False depending on whether
statement level modification took place.







Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ Classes
:widths: auto
:class: summarytable

* - :py:obj:`copy_final_sum_to_host <numba_dpex.core.parfors.reduction_helper.ReductionKernelVariables.copy_final_sum_to_host>`\ (parfor_kernel)
* - :py:obj:`copy_final_sum_to_host <numba_dpex.core.parfors.reduction_helper.ReductionKernelVariables.copy_final_sum_to_host>`\ (queue_ref)
- \-


.. rubric:: Members

.. py:method:: copy_final_sum_to_host(parfor_kernel)
.. py:method:: copy_final_sum_to_host(queue_ref)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ Overview
:widths: auto
:class: summarytable

* - :py:obj:`create_reduction_main_kernel_for_parfor <numba_dpex.core.parfors.reduction_kernel_builder.create_reduction_main_kernel_for_parfor>`\ (loop_ranges, parfor_node, typemap, flags, has_aliases, reductionKernelVar, parfor_reddict)
* - :py:obj:`create_reduction_main_kernel_for_parfor <numba_dpex.core.parfors.reduction_kernel_builder.create_reduction_main_kernel_for_parfor>`\ (loop_ranges, parfor_node, typemap, reductionKernelVar, parfor_reddict)
- Creates a numba_dpex.kernel function for reduction main kernel.
* - :py:obj:`create_reduction_remainder_kernel_for_parfor <numba_dpex.core.parfors.reduction_kernel_builder.create_reduction_remainder_kernel_for_parfor>`\ (parfor_node, typemap, flags, has_aliases, reductionKernelVar, parfor_reddict, reductionHelperList)
* - :py:obj:`create_reduction_remainder_kernel_for_parfor <numba_dpex.core.parfors.reduction_kernel_builder.create_reduction_remainder_kernel_for_parfor>`\ (parfor_node, typemap, reductionKernelVar, parfor_reddict, reductionHelperList)
- Creates a numba_dpex.kernel function for a reduction remainder kernel.




Functions
---------
.. py:function:: create_reduction_main_kernel_for_parfor(loop_ranges, parfor_node, typemap, flags, has_aliases, reductionKernelVar: numba_dpex.core.parfors.reduction_helper.ReductionKernelVariables, parfor_reddict=None)
.. py:function:: create_reduction_main_kernel_for_parfor(loop_ranges, parfor_node, typemap, reductionKernelVar: numba_dpex.core.parfors.reduction_helper.ReductionKernelVariables, parfor_reddict=None)
Creates a numba_dpex.kernel function for reduction main kernel.


.. py:function:: create_reduction_remainder_kernel_for_parfor(parfor_node, typemap, flags, has_aliases, reductionKernelVar, parfor_reddict, reductionHelperList)
.. py:function:: create_reduction_remainder_kernel_for_parfor(parfor_node, typemap, reductionKernelVar, parfor_reddict, reductionHelperList)
Creates a numba_dpex.kernel function for a reduction remainder kernel.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ Overview
- The Numba type to represent an dpnp.ndarray. The type has the same


.. list-table:: Function
:header-rows: 0
:widths: auto
:class: summarytable

* - :py:obj:`partialclass <numba_dpex.core.types.dpnp_ndarray_type.partialclass>`\ (cls, \*args, \*\*kwds)
- Creates fabric class of the original class with preset initialization



Classes
Expand All @@ -36,6 +44,14 @@ Classes



Functions
---------
.. py:function:: partialclass(cls, *args, **kwds)
Creates fabric class of the original class with preset initialization
arguments.





2 changes: 1 addition & 1 deletion dev/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
VERSION: '0.23.0rc1+19.ga60d0324e',
VERSION: '0.23.0rc1+23.g675cb7923',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
8 changes: 4 additions & 4 deletions dev/autoapi/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<link rel="index" title="Index" href="../genindex.html" /><link rel="search" title="Search" href="../search.html" /><link rel="next" title="numba_dpex.kernel_api" href="numba_dpex/kernel_api/index.html" /><link rel="prev" title="Common issues and tips" href="../user_guide/debugging/common_issues.html" />

<!-- Generated with Sphinx 7.3.7 and Furo 2024.04.27 -->
<title>API Reference - numba-dpex 0.23.0rc1+19.ga60d0324e documentation</title>
<title>API Reference - numba-dpex 0.23.0rc1+23.g675cb7923 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=a746c00c" />
<link rel="stylesheet" type="text/css" href="../_static/styles/furo.css?v=437aa6ec" />
<link rel="stylesheet" type="text/css" href="../_static/graphviz.css?v=fd3f3429" />
Expand Down Expand Up @@ -136,7 +136,7 @@
</label>
</div>
<div class="header-center">
<a href="../index.html"><div class="brand">numba-dpex 0.23.0rc1+19.ga60d0324e documentation</div></a>
<a href="../index.html"><div class="brand">numba-dpex 0.23.0rc1+23.g675cb7923 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
Expand All @@ -159,7 +159,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="../index.html">


<span class="sidebar-brand-text">numba-dpex 0.23.0rc1+19.ga60d0324e documentation</span>
<span class="sidebar-brand-text">numba-dpex 0.23.0rc1+23.g675cb7923 documentation</span>

</a><form class="sidebar-search-container" method="get" action="../search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
Expand Down Expand Up @@ -313,7 +313,7 @@ <h1>API Reference<a class="headerlink" href="#api-reference" title="Link to this

</aside>
</div>
</div><script src="../_static/documentation_options.js?v=187ad1e7"></script>
</div><script src="../_static/documentation_options.js?v=6c320df7"></script>
<script src="../_static/doctools.js?v=9a2dae69"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/scripts/furo.js?v=4e2eecee"></script>
Expand Down
Loading

0 comments on commit 6103b6b

Please sign in to comment.