Skip to content

Skip cuML probe on CPU-only hosts in resolve_backend#37

Open
NetZissou wants to merge 1 commit into
mainfrom
fix/skip-cuml-import-on-cpu
Open

Skip cuML probe on CPU-only hosts in resolve_backend#37
NetZissou wants to merge 1 commit into
mainfrom
fix/skip-cuml-import-on-cpu

Conversation

@NetZissou

@NetZissou NetZissou commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

check_cuml_available() does a full import cuml which is very slow and pointless when no GPU is present.

resolve_backend() now short-circuites: check_cuml_available() now only runs when cuda_available is True.

I encountered this when using a uv venv that installed cuml but the app was running on a login node with no GPU attached. The code was importing cuml which slowed down the kick-start time drastically. Fixed it by using a short-circuit optimization, programming 101.

`check_cuml_available()` does a full `import cuml` which is very slow
and pointless when no GPU is present.

`resolve_backend()` now short-circuites: `check_cuml_available()` now
only runs when `cuda_available` is True.
@NetZissou NetZissou requested a review from egrace479 June 11, 2026 17:56
@NetZissou NetZissou self-assigned this Jun 11, 2026
@NetZissou NetZissou added the enhancement New feature or request label Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant