-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #804 from IntelPython/refactor/kernel_interfaces
Refactor/kernel interfaces 187782d
- Loading branch information
1 parent
f90c4cb
commit db50327
Showing
146 changed files
with
4,380 additions
and
1,130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 6d01fe611eca4871471a05274049ce84 | ||
config: e668f2947a425ed930d2934dd29ee719 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
numba\_dpex.core.caching module | ||
=============================== | ||
|
||
.. automodule:: numba_dpex.core.caching | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
numba\_dpex.core.compiler module | ||
================================ | ||
|
||
.. automodule:: numba_dpex.core.compiler | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
7 changes: 7 additions & 0 deletions
7
dev/_sources/apidoc/numba_dpex.core.kernel_interface.arg_pack_unpacker.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
numba\_dpex.core.kernel\_interface.arg\_pack\_unpacker module | ||
============================================================= | ||
|
||
.. automodule:: numba_dpex.core.kernel_interface.arg_pack_unpacker | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
7 changes: 7 additions & 0 deletions
7
dev/_sources/apidoc/numba_dpex.core.kernel_interface.dispatcher.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
numba\_dpex.core.kernel\_interface.dispatcher module | ||
==================================================== | ||
|
||
.. automodule:: numba_dpex.core.kernel_interface.dispatcher | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
7 changes: 7 additions & 0 deletions
7
dev/_sources/apidoc/numba_dpex.core.kernel_interface.func.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
numba\_dpex.core.kernel\_interface.func module | ||
============================================== | ||
|
||
.. automodule:: numba_dpex.core.kernel_interface.func | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
7 changes: 7 additions & 0 deletions
7
dev/_sources/apidoc/numba_dpex.core.kernel_interface.kernel_base.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
numba\_dpex.core.kernel\_interface.kernel\_base module | ||
====================================================== | ||
|
||
.. automodule:: numba_dpex.core.kernel_interface.kernel_base | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
22 changes: 22 additions & 0 deletions
22
dev/_sources/apidoc/numba_dpex.core.kernel_interface.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
numba\_dpex.core.kernel\_interface package | ||
========================================== | ||
|
||
Submodules | ||
---------- | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
numba_dpex.core.kernel_interface.arg_pack_unpacker | ||
numba_dpex.core.kernel_interface.dispatcher | ||
numba_dpex.core.kernel_interface.func | ||
numba_dpex.core.kernel_interface.kernel_base | ||
numba_dpex.core.kernel_interface.spirv_kernel | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: numba_dpex.core.kernel_interface | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
7 changes: 7 additions & 0 deletions
7
dev/_sources/apidoc/numba_dpex.core.kernel_interface.spirv_kernel.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
numba\_dpex.core.kernel\_interface.spirv\_kernel module | ||
======================================================= | ||
|
||
.. automodule:: numba_dpex.core.kernel_interface.spirv_kernel | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
dev/_sources/apidoc/numba_dpex.core.typeconv.array_conversion.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
numba\_dpex.core.typeconv.array\_conversion module | ||
================================================== | ||
|
||
.. automodule:: numba_dpex.core.typeconv.array_conversion | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
numba\_dpex.core.typeconv package | ||
================================= | ||
|
||
Submodules | ||
---------- | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
numba_dpex.core.typeconv.array_conversion | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: numba_dpex.core.typeconv | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
numba\_dpex.core.utils package | ||
============================== | ||
|
||
Submodules | ||
---------- | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
numba_dpex.core.utils.suai_helper | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: numba_dpex.core.utils | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
7 changes: 7 additions & 0 deletions
7
dev/_sources/apidoc/numba_dpex.core.utils.suai_helper.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
numba\_dpex.core.utils.suai\_helper module | ||
========================================== | ||
|
||
.. automodule:: numba_dpex.core.utils.suai_helper | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.. _caching: | ||
|
||
Caching Mechanism in Numba-dpex | ||
================================ | ||
|
||
Caching is done by saving the compiled kernel code, the ELF object of the executable code. By using the kernel code, cached kernels have minimal overhead because no compilation is needed. | ||
|
||
Unlike Numba, we do not perform file-based caching, instead we use an Least Recently Used (LRU) caching mechanism. However when a kernel needs to be evicted, we utilize numba's file-based caching mechanism described `here <https://numba.pydata.org/numba-doc/latest/developer/caching.html>`_. | ||
|
||
Algorithm | ||
========== | ||
|
||
The caching mechanism for Numba-dpex works as follows: The cache is an LRU cache backed by an ordered dictionary mapped onto a doubly linked list. The tail of the list contains the most recently used (MRU) kernel and the head of the list contains the least recently used (LRU) kernel. The list has a fixed size. If a new kernel arrives to be cached and if the size is already on the maximum limit, the algorithm evicts the LRU kernel to make room for the MRU kernel. The evicted item will be serialized and pickled into a file using Numba's caching mechanism. | ||
|
||
Everytime whenever a kernel needs to be retrieved from the cache, the mechanism will look for the kernel in the cache and will be loaded if it's already present. However, if the program is seeking for a kernel that has been evicted, the algorithm will load it from the file and enqueue in the cache. | ||
|
||
Settings | ||
======== | ||
|
||
Therefore, we employ similar environment variables as used in Numba, i.e. ``NUMBA_CACHE_DIR`` etc. However we add three more environment variables to control the caching mechanism. | ||
|
||
- In order to specify cache capacity, one can use ``NUMBA_DPEX_CACHE_SIZE``. By default, it's set to 10. | ||
- ``NUMBA_DPEX_ENABLE_CACHE`` can be used to enable/disable the caching mechanism. By default it's enabled, i.e. set to 1. | ||
- In order to enable the debugging messages related to caching, one can set ``NUMBA_DPEX_DEBUG_CACHE`` to 1. All environment variables are defined in :file:`numba_dpex/config.py`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.