daal4py - Intel® oneAPI Data Analytics Library

raw JSON →
2024.7.0 verified Fri May 01 auth: no python

daal4py provides a convenient Python API to Intel® oneAPI Data Analytics Library (oneDAL) for accelerating machine learning and data analysis. Current stable version is 2024.7.0 on PyPI, with newer releases (2025.11.0) available via Intel's Extension for Scikit-learn. Release cadence is approximately monthly.

pip install daal4py
error ModuleNotFoundError: No module named 'daal4py'
cause daal4py not installed or installed in wrong environment.
fix
Run 'pip install daal4py' or 'conda install -c intel daal4py'
error AttributeError: module 'daal4py' has no attribute 'kmeans'
cause Using daal4py version older than 2020 where API changed.
fix
Upgrade daal4py to at least version 2020.0, e.g., 'pip install -U daal4py'
error RuntimeError: Provided context is not sycl_context instance.
cause Passing wrong object to sycl_context or not importing it correctly.
fix
Use 'from daal4py.oneapi import sycl_context' and wrap code in 'with sycl_context("cpu"):'
error TypeError: compute() missing 1 required positional argument: 'data'
cause Calling compute on a method that expects data but none provided.
fix
Ensure algo.compute(data) passes the input array.
breaking daal4py 2020.x has a different API compared to newer versions. Upgrade may require code changes.
fix Refer to migration guide: https://intelpython.github.io/daal4py/migration.html
deprecated Internal dpctl tensor handling functionality is deprecated and will be removed in future releases.
fix Use standard numpy or dpctl arrays directly.
gotcha daal4py objects (e.g., from compute) must not be reused after passing to another compute; create fresh instances.
fix Always create a new algorithm object for each call.
gotcha SYCL context must be set before calling any daal4py compute, otherwise it defaults to CPU host.
fix Use 'with sycl_context("gpu"):' to ensure GPU usage.
conda install -c intel daal4py

Simple K-Means using oneDAL native API with SYCL context.

import numpy as np
import daal4py
from daal4py.oneapi import sycl_context
# Example: K-Means clustering (oneDAL native)
data = np.random.rand(100, 5).astype(np.float64)
with sycl_context('cpu'):
    n_clusters = 3
    algo = daal4py.kmeans(nClusters=n_clusters, maxIterations=100)
    result = algo.compute(data)
print(result.centroids)