Compare commits

..

2 Commits

Author SHA1 Message Date
Michael Pilosov
b99406671e simplify comment in UI re: locked 2D 2026-04-21 20:16:58 -06:00
Michael Pilosov
230c3032e5 parallelism limits 2026-04-21 20:16:33 -06:00
2 changed files with 18 additions and 6 deletions

View File

@ -188,7 +188,7 @@ REDUCERS: Dict[str, Dict[str, Any]] = {
"label": "PCA",
"blurb": "Principal component analysis. Linear, fast, deterministic.",
"key": [
("n_components", "int", 2, None, "Locked to 2 — flow asserts 2D output."),
("n_components", "int", 2, None, "Locked."),
],
"advanced": [
("svd_solver", "str", "auto", ["auto", "full", "arpack", "randomized"], None),
@ -201,7 +201,7 @@ REDUCERS: Dict[str, Dict[str, Any]] = {
"label": "FactorAnalysis",
"blurb": "Gaussian latent-factor model with per-feature noise.",
"key": [
("n_components", "int", 2, None, "Locked to 2 — flow asserts 2D output."),
("n_components", "int", 2, None, "Locked."),
("random_state", "int", 42, None, None),
],
"advanced": [
@ -215,7 +215,7 @@ REDUCERS: Dict[str, Dict[str, Any]] = {
"label": "t-SNE",
"blurb": "Stochastic neighbour embedding. Local structure preserved.",
"key": [
("n_components", "int", 2, None, "Locked to 2 — flow asserts 2D output."),
("n_components", "int", 2, None, "Locked."),
("perplexity", "float", 30.0, None, None),
("random_state", "int", 42, None, None),
],
@ -232,7 +232,7 @@ REDUCERS: Dict[str, Dict[str, Any]] = {
"label": "UMAP",
"blurb": "Uniform manifold approximation. Preserves local + some global structure.",
"key": [
("n_components", "int", 2, None, "Locked to 2 — flow asserts 2D output."),
("n_components", "int", 2, None, "Locked."),
("n_neighbors", "int", 15, None, None),
("min_dist", "float", 0.1, None, None),
("random_state", "int", 42, None, None),
@ -249,7 +249,7 @@ REDUCERS: Dict[str, Dict[str, Any]] = {
"label": "PaCMAP",
"blurb": "Pairwise-controlled manifold approximation. Balanced local/global.",
"key": [
("n_components", "int", 2, None, "Locked to 2 — flow asserts 2D output."),
("n_components", "int", 2, None, "Locked."),
("n_neighbors", "int", 10, None, None),
("MN_ratio", "float", 0.5, None, None),
("FP_ratio", "float", 2.0, None, None),
@ -266,7 +266,7 @@ REDUCERS: Dict[str, Dict[str, Any]] = {
"label": "TriMap",
"blurb": "Triplet-based dimensionality reduction. Emphasises global structure.",
"key": [
("n_dims", "int", 2, None, "Locked to 2 — flow asserts 2D output."),
("n_dims", "int", 2, None, "Locked."),
("n_inliers", "int", 10, None, None),
("n_outliers", "int", 5, None, None),
("n_random", "int", 5, None, None),

View File

@ -7,6 +7,18 @@ import sys
os.environ.setdefault("PREFECT_API_URL", "http://localhost:4200/api")
os.environ.setdefault("DO_NOT_TRACK", "1")
# Pin per-process thread pools to 1 so Ray's worker parallelism doesn't
# multiply against BLAS/numba/etc. thread pools — otherwise 4 workers × N
# cores → thrash. Must be set before numpy/numba/sklearn import, since
# those libs latch onto these env vars at import time. Ray manages OMP
# per-task-CPU but does NOT manage NUMBA_NUM_THREADS, which is what
# PaCMAP/UMAP use for their optimization loops.
os.environ.setdefault("OMP_NUM_THREADS", "1")
os.environ.setdefault("MKL_NUM_THREADS", "1")
os.environ.setdefault("OPENBLAS_NUM_THREADS", "1")
os.environ.setdefault("NUMEXPR_NUM_THREADS", "1")
os.environ.setdefault("NUMBA_NUM_THREADS", "1")
from datetime import timedelta
import math
from pathlib import Path