Skip to content

TST: Array API: Skip float64 tests for any float32-limited device - #33895

Merged
ogrisel merged 33 commits into
scikit-learn:mainfrom
cakedev0:xp/dpnp/skip-float64-tests
Apr 30, 2026
Merged

ogrisel merged 33 commits into
scikit-learn:mainfrom
cakedev0:xp/dpnp/skip-float64-tests

Conversation

@cakedev0

@cakedev0 cakedev0 commented Apr 29, 2026 •

Copy link
Copy Markdown
Member

Reference Issues/PRs

Follow-up from #32460

Fixes #33907

Context

When testing locally #32460 I noticed float64 tests were running and failing even though my intel GPU doesn't support float64. Those tests are currently skipped for "mps" devices (which all only support float32), we now have to extend this skip logic to intel GPUs for which just the device_name isn't enough to know whether float64 are supported.

What does this implement/fix? Explain your changes.

  • Accept dtype_name in _array_api_for_test and skip test if max supported dtype is too small
  • Change a "if mps" to "if max supported dtype too small" in _check_array_api_core (it was failing for StandardScaler because numpy result was up-casted to float64)
  • Change the "if mps" in test_max_precision_float_dtype to a runtime-check (so we test __array_namespace_info__ against run-time check, I think it's nice too have that)

Result: all dpnp-gpu tests pass on my machine (SCIPY_ARRAY_API=1 pytest sklearn -k "dpnp and gpu")

ogrisel and others added 30 commits October 9, 2025 15:39
@cakedev0
cakedev0 marked this pull request as ready for review April 29, 2026 16:33
@cakedev0 cakedev0 changed the title [WIP] TST: Array API: Skip float64 tests for float32 non-MPS devices TST: Array API: Skip float64 tests for float32 non-MPS devices Apr 29, 2026
@cakedev0 cakedev0 changed the title TST: Array API: Skip float64 tests for float32 non-MPS devices TST: Array API: Skip float64 tests for any float32-limited device Apr 29, 2026
@virchan virchan added float32 Issues related to support for 32bit data CUDA CI labels Apr 30, 2026
@github-actions github-actions Bot removed the CUDA CI label Apr 30, 2026

@virchan virchan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for the PR, @cakedev0.

Could you fix the codecov CI failure?

@OmarManzoor OmarManzoor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thank you @cakedev0

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the fix.

@ogrisel
ogrisel merged commit 4fd35ca into scikit-learn:main Apr 30, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Array API float32 Issues related to support for 32bit data No Changelog Needed

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Make _array_api_for_tests accept a dtype_name and raise SkipTest if the requested dtype/device is not supported

4 participants