Skip to content

Duplicate Script Run #49

Open
Open

Description

@NetZissou

A single button click can produce two concurrent Streamlit script runs, and when that happens resolve_backend("auto") can return different backends for the two runs: one cuml, one sklearn. The duplicate run is preempted before it writes session state, so results stay consistent, but it doubles GPU work and makes the log misleading.

Observation

Embed & Explore, A100 node, auto backend, 36 images:

09:17:10 Starting embedding generation      (x2)
09:17:12 Embeddings stored                  (x1, the other run was preempted)
09:17:31 Auto-resolved reduction backend to sklearn (CPU)
09:17:31 Auto-resolved reduction backend to cuML (GPU: NVIDIA A100-PCIE-40GB)
09:17:31 PROJECTION START                   (x2)
09:17:54 cuML UMAP subprocess completed; Projection complete   (this run wrote the results)
09:17:59 sklearn run: Dim reduction complete, never reaches _run_projection (preempted)

Cause

  1. check_cuml_available() does a live import cuml on every call, with except ImportError: return False. Two threads importing cuML at the same instant is a CPython hazard: the second importer can hit a partially initialized package, raise ImportError, and be reported as "cuML not available". check_cuda_available() is cached; the cuML check is not.
  2. The duplicate run itself: either a duplicated click event over a port-forwarded connection or a second browser tab. The log has no session id, so it cannot be told apart yet.

Activity

  1. self-assigned this
    on Sep 22, 2026
  2. added theissue type on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions