Skip to content

Conversation

@Alexandr-Solovev
Copy link
Contributor

@Alexandr-Solovev Alexandr-Solovev commented Oct 27, 2025

Description

This pr is a copy of #3255 with extensions.

Enhancement: Add CPU distributed support

This PR introduces several improvements for CPU-based distributed computing in oneDAL:

  1. Added support for distributed CPU policies.
  2. Added distributed linear regression on CPU.
  3. Added Multi-CPU samples.

Checklist:

Completeness and readability

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes or created a separate PR with updates and provided its number in the description, if necessary.
  • Git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details).
  • I have resolved any merge conflicts that might occur with the base branch.

Testing

  • I have run it locally and tested the changes extensively.
  • All CI jobs are green or I have provided justification why they aren't.
  • I have extended testing suite if new functionality was introduced in this PR.

Performance

  • I have measured performance for affected algorithms using scikit-learn_bench and provided at least a summary table with measured data, if performance change is expected.
  • I have provided justification why performance and/or quality metrics have changed or why changes are not expected.
  • I have extended the benchmarking suite and provided a corresponding scikit-learn_bench PR if new measurable functionality was introduced in this PR.

@Alexandr-Solovev Alexandr-Solovev marked this pull request as ready for review October 28, 2025 14:54
@Alexandr-Solovev Alexandr-Solovev added the dpc++ Issue/PR related to DPC++ functionality label Oct 28, 2025
@Alexandr-Solovev Alexandr-Solovev marked this pull request as draft November 4, 2025 14:49
@Alexandr-Solovev Alexandr-Solovev marked this pull request as ready for review November 5, 2025 09:13
@Alexandr-Solovev Alexandr-Solovev marked this pull request as draft November 5, 2025 09:21
@Alexandr-Solovev
Copy link
Contributor Author

@david-cortes-intel @david-cortes-intel Can you please review this pr one more time? I will add conda-recipe testing and optimizing dataset usage in the next pr.

@Alexandr-Solovev
Copy link
Contributor Author

/intelci: run

@david-cortes-intel
Copy link
Contributor

@Alexandr-Solovev Could you please add another line after this one:

cmake `# required to build the examples only`

With requirements like this:

    cmake `# required to build the examples only` \
    impi-devel impi_rt `# required to build the samples only`

@david-cortes-intel
Copy link
Contributor

david-cortes-intel commented Nov 28, 2025

@Alexandr-Solovev I see the CPU distributed sample depends on the DPC component, even though it doesn't use it:

-- Missed required DAL component: onedal_dpc
--   _dal_lib-NOTFOUND must exist.
-- Missed required DAL component: onedal_parameters_dpc
--   _dal_lib-NOTFOUND must exist.

@david-cortes-intel
Copy link
Contributor

Also I get this error despite having the MPI dependencies installed:

-- Found MPI_C: /export/users/dcortes/miniforge3/envs/icxconda/lib/libmpi.so (found version "4.1")
-- Could NOT find MPI_CXX (missing: MPI_CXX_WORKS) 
CMake Error at /export/users/dcortes/miniforge3/envs/icxconda/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find MPI (missing: MPI_CXX_FOUND) (found version "4.1")
Call Stack (most recent call first):
  /export/users/dcortes/miniforge3/envs/icxconda/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  /export/users/dcortes/miniforge3/envs/icxconda/share/cmake-3.31/Modules/FindMPI.cmake:1842 (find_package_handle_standard_args)
  /export/users/dcortes/repos/oneDAL/__release_lnx/daal/latest/samples/cmake/setup_samples.cmake:31 (find_package)
  CMakeLists.txt:35 (find_dependencies)

@theComputeKid
Copy link
Member

Are there tests added to ensure this runs on AArch64 as expected?

@Alexandr-Solovev
Copy link
Contributor Author

/intelci: run

@Alexandr-Solovev
Copy link
Contributor Author

@Alexandr-Solovev I see the CPU distributed sample depends on the DPC component, even though it doesn't use it:

-- Missed required DAL component: onedal_dpc
--   _dal_lib-NOTFOUND must exist.
-- Missed required DAL component: onedal_parameters_dpc
--   _dal_lib-NOTFOUND must exist.

I have fixed this issue! Thanks, now it has no deps on SYCL/dpc

@Alexandr-Solovev
Copy link
Contributor Author

Also I get this error despite having the MPI dependencies installed:

-- Found MPI_C: /export/users/dcortes/miniforge3/envs/icxconda/lib/libmpi.so (found version "4.1")
-- Could NOT find MPI_CXX (missing: MPI_CXX_WORKS) 
CMake Error at /export/users/dcortes/miniforge3/envs/icxconda/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find MPI (missing: MPI_CXX_FOUND) (found version "4.1")
Call Stack (most recent call first):
  /export/users/dcortes/miniforge3/envs/icxconda/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  /export/users/dcortes/miniforge3/envs/icxconda/share/cmake-3.31/Modules/FindMPI.cmake:1842 (find_package_handle_standard_args)
  /export/users/dcortes/repos/oneDAL/__release_lnx/daal/latest/samples/cmake/setup_samples.cmake:31 (find_package)
  CMakeLists.txt:35 (find_dependencies)

Can you doublecheck please with the latest commit?

@Alexandr-Solovev
Copy link
Contributor Author

Are there tests added to ensure this runs on AArch64 as expected?

There are no tests, but I believe it should work, I will doublecheck it

INSTALL.md Outdated

DPC++ examples (running on devices supported by SYCL, such as GPU) from oneAPI are also auto-generated within these folders when oneDAL is built with DPC++ support (target `oneapi` in the Makefile), but be aware that it requires a DPC++ compiler such as ICX, and executing the examples requires the DPC++ runtime as well as the GPGPU drivers. The DPC++ examples can be found under `examples/oneapi/dpc`.

oneDAL samples are also auto-generated in `daal/latest/samples/oneapi/cpp/`(Multi-CPU) and `daal/latest/samples/oneapi/dpc/`(Multi-GPU) when oneDAL is built with DPC++ support (target oneapi in the Makefile). Note that building and running the samples requires a DPC++ compiler such as ICX, and MPI/CCL.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this last part shouldn't apply anymore to the CPU samples?

Note that building and running the samples requires a DPC++ compiler such as ICX, and MPI/CCL.

@david-cortes-intel
Copy link
Contributor

Also I get this error despite having the MPI dependencies installed:

-- Found MPI_C: /export/users/dcortes/miniforge3/envs/icxconda/lib/libmpi.so (found version "4.1")
-- Could NOT find MPI_CXX (missing: MPI_CXX_WORKS) 
CMake Error at /export/users/dcortes/miniforge3/envs/icxconda/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find MPI (missing: MPI_CXX_FOUND) (found version "4.1")
Call Stack (most recent call first):
  /export/users/dcortes/miniforge3/envs/icxconda/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  /export/users/dcortes/miniforge3/envs/icxconda/share/cmake-3.31/Modules/FindMPI.cmake:1842 (find_package_handle_standard_args)
  /export/users/dcortes/repos/oneDAL/__release_lnx/daal/latest/samples/cmake/setup_samples.cmake:31 (find_package)
  CMakeLists.txt:35 (find_dependencies)

Can you doublecheck please with the latest commit?

Example works for me now.

dal::preview::infer(comm, lr_desc, x_test_vec.at(rank_id), result_train.get_model());

if (comm.get_rank() == 0) {
std::cout << "Prediction results:\n" << result_infer.get_responses() << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it could make it more clear here that it is printing only the data from the rank with ID=0. And maybe it could print the coefficients.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@david-cortes-intel david-cortes-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, pending the changes that will be left for the next PR.

@Alexandr-Solovev
Copy link
Contributor Author

/intelci: run

@Alexandr-Solovev Alexandr-Solovev merged commit 14ba9e2 into uxlfoundation:main Dec 4, 2025
22 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dpc++ Issue/PR related to DPC++ functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants