-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updated Overview page * Added Quick Start Guide * Updated developement guides * Applied review comments * Added examples * Keeping existing docs instead of full clean-up
- Loading branch information
1 parent
70294a3
commit 6239281
Showing
21 changed files
with
475 additions
and
188 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 |
---|---|---|
|
@@ -4,17 +4,21 @@ on: | |
branches: | ||
- master | ||
pull_request: | ||
types: [opened, synchronize, reopened, closed] | ||
|
||
env: | ||
PUBLISH_DIR: doc/_build/html/ | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
jobs: | ||
build-and-deploy: | ||
name: Build and Deploy Docs | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
env: | ||
python-ver: '3.9' | ||
CHANNELS: '-c dppy/label/dev -c intel -c conda-forge --override-channels' | ||
|
@@ -116,4 +120,65 @@ jobs: | |
uses: peaceiris/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: doc/_build/html/ | ||
publish_dir: ${{ env.PUBLISH_DIR }} | ||
|
||
- name: Publish pull-request docs | ||
if: | | ||
!github.event.pull_request.head.repo.fork && github.event.pull_request && github.event.action != 'closed' | ||
uses: peaceiris/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ${{ env.PUBLISH_DIR }} | ||
destination_dir: ./pull/${{ github.event.number }} | ||
allow_empty_commit : true | ||
keep_files: true | ||
commit_message: ${{ github.event.head_commit.message }} | ||
publish_branch: gh-pages | ||
user_name: 'github-actions[bot]' | ||
user_email: 'github-actions[bot]@users.noreply.github.com' | ||
|
||
- name: Comment with URL to published pull-request docs | ||
if: | | ||
!github.event.pull_request.head.repo.fork && github.event.pull_request && github.event.action != 'closed' | ||
env: | ||
PR_NUM: ${{ github.event.number }} | ||
uses: mshick/[email protected] | ||
with: | ||
message: | | ||
View rendered docs @ https://intelpython.github.io/dpnp/pull/${{ env.PR_NUM }}/index.html | ||
allow-repeats: false | ||
|
||
clean: | ||
if: | | ||
!github.event.pull_request.head.repo.fork && github.event.pull_request && github.event.action == 'closed' | ||
needs: build-and-deploy | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Remove docs [PR closed] | ||
env: | ||
PR_NUM: ${{ github.event.number }} | ||
run: | | ||
git remote add tokened_docs https://IntelPython:${{ secrets.GITHUB_TOKEN }}@github.com/IntelPython/dpnp.git | ||
git fetch tokened_docs | ||
git checkout --track tokened_docs/gh-pages | ||
echo `pwd` | ||
[ -d pull/${PR_NUM} ] && git rm -rf pull/${PR_NUM} | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
git commit -m "Removing docs for closed pull request ${PR_NUM}" | ||
git push tokened_docs gh-pages | ||
- name: Modify the comment with URL to official documentation | ||
uses: mshick/[email protected] | ||
with: | ||
find: | | ||
View rendered docs @.+ | ||
replace: | | ||
View rendered docs @ https://intelpython.github.io/dpnp/index.html |
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
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,16 @@ | ||
.. | ||
********************************************************** | ||
THESE ARE EXTERNAL PROJECT LINKS USED IN THE DOCUMENTATION | ||
********************************************************** | ||
|
||
.. _NumPy*: https://numpy.org/ | ||
.. _Python* Array API Standard: https://data-apis.org/array-api/ | ||
.. _OpenCl*: https://www.khronos.org/opencl/ | ||
.. _oneAPI Level Zero: https://spec.oneapi.io/level-zero/latest/index.html | ||
.. _DPC++: https://www.apress.com/gp/book/9781484255735 | ||
.. _SYCL*: https://www.khronos.org/sycl/ | ||
.. _dpctl: https://intelpython.github.io/dpctl/latest/index.html | ||
.. _Data Parallel Control Library: https://intelpython.github.io/dpctl/latest/index.html | ||
.. _Intel oneAPI Base Toolkit: https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit.html | ||
.. _Intel Distribution for Python*: https://www.intel.com/content/www/us/en/developer/tools/oneapi/distribution-for-python.html | ||
.. _Intel AI Analytics Toolkit: https://www.intel.com/content/www/us/en/developer/tools/oneapi/ai-analytics-toolkit.html |
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,37 +1,20 @@ | ||
========================================================= | ||
DPNP -- A NumPy-compatible library for SYCL-based devices | ||
========================================================= | ||
.. _index: | ||
.. include:: ./ext_links.txt | ||
|
||
.. module:: dpnp | ||
|
||
`DPNP <https://github.com/IntelPython/dpnp>`_ is a NumPy-like library accelerated with SYCL on Intel devices. | ||
It provides Python interfaces for many NumPy functions, and includes a subset of methods of :class:`dpnp.ndarray`. | ||
Under the hood it is based on native C++ and oneMKL based kernels. | ||
|
||
Being drop-in replacement for Numpy its usage is very similar to Numpy: | ||
|
||
>>> import dpnp as np | ||
|
||
The :class:`dpnp.ndarray` class is a compatible alternative of :class:`numpy.ndarray`. | ||
|
||
>>> x = np.array([1, 2, 3]) | ||
|
||
``x`` in the above example is an instance of :class:`dpnp.ndarray` that is created identically to ``NumPy``'s one. | ||
The key difference of :class:`dpnp.ndarray` from :class:`numpy.ndarray` is | ||
that the memory is allocated on Intel GPU when setting up ``DPNP_QUEUE_GPU=1`` in the environment. | ||
Data Parallel Extension for NumPy* | ||
================================== | ||
|
||
|
||
Most of the array manipulations are also done in the way similar to NumPy such as: | ||
|
||
>>> s = np.sum(x) | ||
|
||
Please see the :ref:`API Reference <dpnp_reference>` for the complete list of supported NumPy APIs | ||
along with their limitations. | ||
.. module:: dpnp | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
install | ||
overview | ||
quick_start_guide | ||
reference/index | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:caption: Development information | ||
|
||
dpnp_backend_api | ||
dpctl |
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,40 @@ | ||
.. _overview: | ||
.. include:: ./ext_links.txt | ||
|
||
Overview | ||
======== | ||
|
||
.. module:: dpnp | ||
|
||
The Data Parallel Extension for NumPy* (dpnp package) - a library that | ||
implements a subset of `NumPy*`_ that can be executed on any | ||
data parallel device. The subset is a drop-in replacement of core `NumPy*`_ | ||
functions and numerical data types. | ||
|
||
The Data Parallel Extension for NumPy* is being developed as part of | ||
`Intel AI Analytics Toolkit`_ and is distributed with the | ||
`Intel Distribution for Python*`_. The dpnp package is also available | ||
on Anaconda cloud. Please refer the :doc:`quick_start_guide` page to learn more. | ||
|
||
Being drop-in replacement for `NumPy*`_ means that the usage is very similar: | ||
|
||
>>> import dpnp as np | ||
|
||
The :class:`dpnp.ndarray` class is a compatible alternative of | ||
:class:`numpy.ndarray`. | ||
|
||
>>> x = np.array([1, 2, 3]) | ||
|
||
``x`` in the above example is an instance of :class:`dpnp.ndarray` that | ||
is created identically to ``NumPy*``'s one. The key difference of | ||
:class:`dpnp.ndarray` from :class:`numpy.ndarray` is that the memory | ||
is allocated on the default `SYCL*`_ device, which is a ``"gpu"`` on systems | ||
with integrated or discrete GPU (otherwise it is the ``"host"`` device | ||
on systems that do not have GPU). | ||
|
||
Most of the array manipulations are also done in the way similar to `NumPy*`_ such as: | ||
|
||
>>> s = np.sum(x) | ||
|
||
Please see the :ref:`API Reference <dpnp_reference>` for the complete list of supported `NumPy*`_ APIs | ||
along with their limitations. |
Oops, something went wrong.