Skip to content

Localise output‑dtype; remove global set_api_output_dtype calls #6561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: branch-25.06
Choose a base branch
from

Conversation

Ofek-Haim
Copy link

What

  • Removed all internal cuml.internals.set_api_output_dtype calls from:
    • svm/svm_base.pyx
    • neighbors/kneighbors_regressor.pyx
    • experimental/fil/fil.pyx
    • legacy/fil/fil.pyx
  • Each routine now selects out_dtype locally and casts once before return.

Why

Changing the global output‑dtype inside estimator methods causes
unpredictable side‑effects on subsequent cuML calls.
This PR localises dtype handling, ensuring thread‑/call‑safety.

Fixes

Closes #6412

@Ofek-Haim Ofek-Haim requested a review from a team as a code owner April 20, 2025 20:42
@Ofek-Haim Ofek-Haim requested review from jcrist and bdice April 20, 2025 20:42
Copy link

copy-pr-bot bot commented Apr 20, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions bot added the Cython / Python Cython or Python issue label Apr 20, 2025
@Ofek-Haim Ofek-Haim force-pushed the fix/output-dtype-local branch from 7c204de to ce9b9da Compare April 20, 2025 21:05
@csadorf
Copy link
Contributor

csadorf commented Apr 21, 2025

/ok to test ce9b9da

@csadorf
Copy link
Contributor

csadorf commented Apr 22, 2025

@Ofek-Haim Thank you very much for the contribution! It looks like CI got tripped on the style checks. Most style issues can be automatically addressed by running the automated pre-commit hooks. Can you see if you can apply those and then push a fix? Let us know if you have any trouble with this, happy to step you through it in more detail.

@csadorf
Copy link
Contributor

csadorf commented May 1, 2025

@Ofek-Haim Do you need help with bringing this branch up-to-date and fixing the style issues?

@csadorf csadorf added the bug Something isn't working label May 1, 2025
@Ofek-Haim
Copy link
Author

Ofek-Haim commented May 2, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Cython / Python Cython or Python issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't set global output dtype within cuml methods
2 participants