oneDAL icon indicating copy to clipboard operation
oneDAL copied to clipboard

Fix vectorization pragmas for icx compiler

Open Vika-F opened this issue 6 months ago • 1 comments

Description

  • Vectorization pragmas were defined for icx/icpx compilers. Previously they were defined only for icc.
  • Vectorization pragmas were redefined for all compilers in attempt to use OpenMP 5 #pragma omp simd for vectorization where possible: cpp/daal/src/services/service_defines.h
  • Compilation warnings were fixed after pragmas re-definition

Note: The use of #pargma omp simd was not implemented for MSVC because it is required to link with OpenMP to support the feature leading to additional dependency in Windows build.


PR should start as a draft, then move to ready for review state after CI is passed and all applicable checkboxes are closed. This approach ensures that reviewers don't spend extra time asking for regular requirements.

You can remove a checkbox as not applicable only if it doesn't relate to this PR in any way. For example, PR with docs update doesn't require checkboxes for performance while PR with any change in actual code should have checkboxes and justify how this code change is expected to affect performance (or justification should be self-evident).

Checklist to comply with before moving PR from draft:

PR completeness and readability

  • [x] I have reviewed my changes thoroughly before submitting this pull request.
  • [x] I have commented my code, particularly in hard-to-understand areas.
  • [x] Git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details).
  • [x] I have added a respective label(s) to PR if I have a permission for that.
  • [x] I have resolved any merge conflicts that might occur with the base branch.

Testing

  • [x] I have run it locally and tested the changes extensively.
  • [ ] All CI jobs are green or I have provided justification why they aren't.

Performance

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

Vika-F avatar Jun 03 '25 09:06 Vika-F

/intelci: run

Vika-F avatar Jun 17 '25 12:06 Vika-F

/intelci: run

Vika-F avatar Jul 11 '25 09:07 Vika-F

/intelci: run

Vika-F avatar Aug 01 '25 11:08 Vika-F

/intelci: run

Vika-F avatar Sep 04 '25 10:09 Vika-F

Could also add pragmas in finalizeCovariance on file covariance_impl.i.

david-cortes-intel avatar Sep 11 '25 07:09 david-cortes-intel

/intelci: run

Vika-F avatar Sep 17 '25 11:09 Vika-F

/intelci: run

Vika-F avatar Sep 19 '25 15:09 Vika-F

/intelci: run

Vika-F avatar Sep 24 '25 09:09 Vika-F

/intelci: run

Vika-F avatar Sep 26 '25 15:09 Vika-F

/intelci: run

Vika-F avatar Sep 29 '25 11:09 Vika-F

/intelci: run

Vika-F avatar Oct 01 '25 12:10 Vika-F

/intelci: run

Vika-F avatar Oct 02 '25 08:10 Vika-F

/intelci: run

Vika-F avatar Oct 08 '25 10:10 Vika-F

@Vika-F Would you see an improvement in forests if you were to replace those pragmas with omp simd where applicable instead of removing them?

david-cortes-intel avatar Oct 08 '25 11:10 david-cortes-intel

@Vika-F Would you see an improvement in forests if you were to replace those pragmas with omp simd where applicable instead of removing them?

@david-cortes-intel Performance rerun is a rather time consuming thing now. Last time it took 3 CI jobs to get the results from EMR ang GNR. So, I would leave the improvements for the further PRs, and now I am just trying to have no degradations to make it mergeable finally.

Vika-F avatar Oct 08 '25 11:10 Vika-F

/intelci: run

Vika-F avatar Oct 14 '25 10:10 Vika-F

/intelci: run

Vika-F avatar Oct 14 '25 11:10 Vika-F

/intelci: run

Vika-F avatar Oct 23 '25 12:10 Vika-F

/intelci: run

Vika-F avatar Oct 27 '25 09:10 Vika-F

@Vika-F , conda build with clang has failed: https://github.com/uxlfoundation/oneDAL/actions/runs/18882214115/job/53888157260

Alexsandruss avatar Oct 29 '25 15:10 Alexsandruss

@Vika-F , conda build with clang has failed: https://github.com/uxlfoundation/oneDAL/actions/runs/18882214115/job/53888157260

@Vika-F Looks like the build flags are too strict with the warnings. This is the "error":

./cpp/daal/src/algorithms/dtrees/forest/classification/df_classification_predict_dense_default_batch_impl.i:368:57: error: loop not vectorized: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering [-Werror,-Wpass-failed=transform-warning]

david-cortes-intel avatar Oct 29 '25 15:10 david-cortes-intel

PR that should solve the build issue: https://github.com/uxlfoundation/oneDAL/pull/3424

david-cortes-intel avatar Oct 29 '25 16:10 david-cortes-intel