Skip to main content

A lightweight Python wrapper for a subset of SYCL.

Project description

Code style: black Imports: isort pre-commit Coverage Status Generate Documentation Join the chat at https://matrix.to/#/#Data-Parallel-Python_community:gitter.im OpenSSF Scorecard

oneAPI logo

Data Parallel Control

Data Parallel Control or dpctl is a Python library that allows users to control the execution placement of a compute kernel on an XPU.

The compute kernel can be a code:

  • written by the user, e.g., using numba-dpex
  • that is part of a library, such as oneMKL

The dpctl library is built upon the SYCL standard. It implements Python bindings for a subset of the standard runtime classes that allow users to:

  • query platforms
  • discover and represent devices and sub-devices
  • construct contexts and queues

dpctl features classes for SYCL Unified Shared Memory (USM) management and implements a tensor array API.

The library helps authors of Python native extensions written in C, Cython, or pybind11 to access dpctl objects representing SYCL devices, queues, memory, and tensors.

Dpctl is the core part of a larger family of data-parallel Python libraries and tools to program on XPUs.

Installing

You can install the library using conda or pip package managers. It is also available in the Intel(R) Distribution for Python (IDP).

Intel(R) oneAPI

You can find the most recent release of dpctl every quarter as part of the Intel(R) oneAPI releases.

To get the library from the latest oneAPI release, follow the instructions from Intel(R) oneAPI installation guide.

NOTE: You need to install the Intel(R) oneAPI AI Analytics Tookit to get IDP and dpctl.

Conda

To install dpctl from the Intel(R) channel on Anaconda cloud, use the following command:

conda install dpctl -c intel

Pip

The dpctl can be installed using pip obtaining wheel packages either from PyPi or from Intel(R) channel on Anaconda. To install dpctl wheel package from Intel(R) channel on Anaconda, run the following command:

python -m pip install --index-url https://pypi.anaconda.org/intel/simple dpctl

Installing the bleeding edge

To try out the current master, install it from our development channel on Anaconda cloud:

conda install dpctl -c dppy/label/dev

Building

Refer to our Documentation for more information on setting up a development environment and building dpctl from the source.

Examples

Our examples are located in the examples/ folder and are organized in sub-folders. Examples in the Python/ folder demonstrate how to inspect the heterogeneous platform, select a device, create an execution queue, and how to control device memory allocation and execution placement.

Examples in Cython/, C/, and Pybind11 folders demonstrate creation of SYCL-powered native Python extensions. Please refer to each folder's README document for directions on how to build and use each example.

Running Tests

Tests are located in folder dpctl/tests.

To run the tests, use:

pytest --pyargs dpctl

Running full test suite requires working C++ compiler. To run the test suite without one, use:

pytest --pyargs dpctl -k "not test_cython_api"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

dpctl-0.16.0-0-cp310-cp310-win_amd64.whl (27.0 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

dpctl-0.16.0-0-cp310-cp310-manylinux2014_x86_64.whl (30.3 MB view hashes)

Uploaded CPython 3.10

dpctl-0.16.0-0-cp39-cp39-win_amd64.whl (27.0 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

dpctl-0.16.0-0-cp39-cp39-manylinux2014_x86_64.whl (30.4 MB view hashes)

Uploaded CPython 3.9

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page