diff --git a/CHANGELOG.md b/CHANGELOG.md index 46cfb64..126c1ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -287,10 +287,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 like-for-like steps and still loses the standard workflow by 1.2–2.5x, to seeded UMAP and presto's Wilcoxon. With Seurat's optimiser on both sides, clustering finds the same number of clusters on all four datasets, at 1.1–1.2x Seurat's time from - 8,000 cells up. DESeq2 has a row for the first time, 3.9x faster than Seurat's, but - pydeseq2 starts one worker process per core, and they took the process tree from - under 1 GB to 5.2 GB. The M4 Pro sweep is kept in `results_m4pro/`, and the report's - two findings from it are labelled as such. + 8,000 cells up. DESeq2 has a row for the first time, 2.5x faster than Seurat's on + half its memory. The M4 Pro sweep is kept in `results_m4pro/`, and the report's two + findings from it are labelled as such. ### Fixed @@ -490,6 +489,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The DE tutorial's fold-change figure was titled "13,712 genes, 1,172 shared cells", typed in before the feature renaming and the new clusters. The title is now counted from the data: 13,714 genes and 1,183 cells. +- **`find_markers(test_use="deseq2")` runs in one process.** pydeseq2 starts a joblib + worker per CPU core, once for its data set and again for its test, and the workers + outlive the call. Re-measuring the performance report found them taking the process + tree from under 1 GB to 5.2 GB on PBMC 3k's DE bench to save 1.5 s, and doubling + the out-of-core tutorial's peak to 11.5 GB. DESeq2 runs in one R process and the + answer does not depend on the worker count, so truecell now gives pydeseq2 one. The + bench's call takes 4.0 s where it took 2.5 s, still 2.5x faster than Seurat's, and + peaks at 1.2 GB. `tests/test_deseq2_seurat_parity.py` fails if any of pydeseq2's + parallel sections asks for more than one job. ## [1.2.0] - 2026-08-10 diff --git a/tests/test_deseq2_seurat_parity.py b/tests/test_deseq2_seurat_parity.py index fe907d8..0eae2cc 100644 --- a/tests/test_deseq2_seurat_parity.py +++ b/tests/test_deseq2_seurat_parity.py @@ -121,6 +121,32 @@ def test_the_fit_tracks_deseq2_step_by_step(): assert nan_pattern == np.isnan(_values("pvalue")).tolist() +def test_the_fit_runs_in_one_process(monkeypatch): + """DESeq2 runs in one R process; pydeseq2 starts a joblib worker per core. + + Those workers outlive the call. On the benchmark's PBMC 3k DE call they took the + process tree from under 1 GB to 5.1 GB to save 1.6 s, for the same output. So + every parallel section pydeseq2 opens must ask for one job. + """ + import pydeseq2.default_inference as inference + + jobs = [] + real_parallel = inference.Parallel + + def recording_parallel(*args, **kwargs): + jobs.append(kwargs.get("n_jobs")) + return real_parallel(*args, **kwargs) + + monkeypatch.setattr(inference, "Parallel", recording_parallel) + genes, samples, groups = REF["genes"], np.array(REF["samples"]), np.array(REF["groups"]) + counts = pd.DataFrame(np.array(REF["counts"], dtype=np.int64), index=genes, columns=samples) + order = list(samples[groups == "A"]) + list(samples[groups == "B"]) + _deseq2.fit(counts.loc[REF["tested_features"], order].T, + np.isin(order, samples[groups == "A"])) + assert jobs, "pydeseq2 opened no parallel section, so nothing was checked" + assert set(jobs) == {1}, jobs + + LOW = REF["low_count"] diff --git a/truecell/_deseq2.py b/truecell/_deseq2.py index cd3e824..8320793 100644 --- a/truecell/_deseq2.py +++ b/truecell/_deseq2.py @@ -132,6 +132,7 @@ def fit(counts: pd.DataFrame, group1: np.ndarray): p-values, NaN where ``results()``' Cook's cutoff removes them, as R gives NA. """ from pydeseq2.dds import DeseqDataSet + from pydeseq2.default_inference import DefaultInference from pydeseq2.ds import DeseqStats values = counts.to_numpy() @@ -144,11 +145,17 @@ def fit(counts: pd.DataFrame, group1: np.ndarray): group1 = np.asarray(group1, dtype=bool) metadata = pd.DataFrame( {"condition": np.where(group1, "group1", "group2")}, index=counts.index) + # One process, as DESeq2 runs in R. Left to itself, pydeseq2 starts a joblib + # worker per CPU core for each object below, and the workers outlive the call: + # on the benchmark's PBMC 3k DE call they took the process tree from under 1 GB + # to 5.1 GB to save 1.6 s. The answer does not depend on the worker count. + inference = DefaultInference(n_cpus=1) # max_disp is DESeq2's maxDisp, max(10, samples). pydeseq2 enforces that maximum # itself; passing it keeps the rule from depending on that. dds = DeseqDataSet( counts=counts, metadata=metadata, design="~condition", refit_cooks=False, max_disp=max(10.0, float(counts.shape[0])), min_disp=MIN_DISP, quiet=True, + inference=inference, ) dds.fit_size_factors(fit_type="ratio") dds.fit_genewise_dispersions() @@ -175,7 +182,7 @@ def fit(counts: pd.DataFrame, group1: np.ndarray): dds.calculate_cooks() stats = DeseqStats(dds, contrast=["condition", "group1", "group2"], alpha=0.05, - quiet=True) + quiet=True, inference=inference) # nbinomWaldTest floors the fitted means at minmu before weighting them; # DeseqStats.run_wald_test does not, so run its Wald test with the floor. design = stats.design_matrix.to_numpy(dtype=float) diff --git a/tutorials/benchmark/PERFORMANCE.md b/tutorials/benchmark/PERFORMANCE.md index 24c7988..10fb0d0 100644 --- a/tutorials/benchmark/PERFORMANCE.md +++ b/tutorials/benchmark/PERFORMANCE.md @@ -28,8 +28,8 @@ Reproduce with `bash tutorials/benchmark/sweep.sh` (41 minutes here). > clusters on all four datasets (9, 12, 16 and 8; truecell 1.0.0 found 8, 9, 15 > and 7), at close to Seurat's cost — see > [2.5](#25-clustering-runs-seurats-optimiser). And `find_markers(test_use="deseq2")` -> is Seurat's per-cell test now, so DESeq2 has a row for the first time, with a -> memory cost worth knowing about ([section 5](#5-named-operations)). +> is Seurat's per-cell test now, so DESeq2 has a row for the first time +> ([section 5](#5-named-operations)). --- @@ -51,8 +51,8 @@ Seurat's Wilcoxon is presto's C++. | VST feature selection | | **1.7–2.5x faster** | | Scaling; exact neighbours | 1.1–1.8x and 1.5–3.2x faster on two datasets each | 1.1–1.6x and 1.1–3.0x faster on the other two | | Clustering, Seurat's optimiser on both sides | | **1.1–1.2x faster** at ≥8k cells, 2.3x at 2.7k | -| Differential expression, 7 of the 8 shared tests | **1.7–8.2x faster** | | -| Wilcoxon — `de_wilcox` and `find_all_markers` | | **1.6–3.6x faster** (presto) | +| Differential expression, 7 of the 8 shared tests | **1.7–8.9x faster** | | +| Wilcoxon — `de_wilcox` and `find_all_markers` | | **1.6–3.7x faster** (presto) | | Seeded UMAP | | **1.7–3.9x faster** | | Harmony | **1.6x faster** | | | CCA integration | | **3.1x faster** | @@ -60,7 +60,7 @@ Seurat's Wilcoxon is presto's C++. | SCTransform | **1.4x faster**, half the memory | | | Moran's I | **77x faster**, and the only one without an *n* limit | | | Peak memory, standard workflow | **1.04–1.4x lighter** at ≥8k cells | 1.5x lighter at 2.7k | -| Peak memory, the DE bench | | **2.0x lighter**: pydeseq2 starts a worker process per core (section 5) | +| Peak memory, the DE bench | **2.0x lighter**, with DESeq2 in one process (section 5) | | The tally is generated by `make_report.py`, not counted by hand. @@ -416,18 +416,18 @@ Median of 2 timed repeats per arm, warm-up discarded. *Shared pipeline* excludes | Step | Truecell | Seurat | Faster by | Truecell peak RSS | Seurat peak RSS | Truecell result | Seurat result | |---|---:|---:|---:|---:|---:|---:|---:| -| `import` | 0.44s | — | — | 143 MB | — | | | -| `prep` | 1.01s | 1.91s | **1.9x** | 863 MB | 909 MB | 9 | 9 | -| `de_wilcox` | 0.18s | 0.05s | 3.6x slower | 864 MB | 936 MB | 1254 | 1254 | -| `de_t` | 0.22s | 0.75s | **3.3x** | 864 MB | 1126 MB | 1254 | 1254 | -| `de_bimod` | 0.11s | 0.72s | **6.3x** | 865 MB | 992 MB | 1254 | 1254 | -| `de_LR` | 1.44s | 2.41s | **1.7x** | 916 MB | 1053 MB | 1254 | 1254 | -| `de_negbinom` | 2.38s | 6.25s | **2.6x** | 922 MB | 1108 MB | 1254 | 1254 | -| `de_roc` | 0.19s | 1.54s | **8.2x** | 922 MB | 1145 MB | 1254 | 1254 | -| `de_MAST` | 1.55s | 6.37s | **4.1x** | 924 MB | 1709 MB | 1254 | 1254 | -| `de_DESeq2` | 2.50s | 9.67s | **3.9x** | 5175 MB | 2543 MB | 2347 | 2347 | -| `library_load` | — | 1.21s | — | — | 475 MB | | | -| **shared pipeline** | **9.6s** | **29.7s** | **3.1x** | **5177 MB** | **2543 MB** | | | +| `import` | 0.45s | — | — | 140 MB | — | | | +| `prep` | 1.01s | 1.98s | **2.0x** | 863 MB | 1005 MB | 9 | 9 | +| `de_wilcox` | 0.19s | 0.05s | 3.7x slower | 864 MB | 1005 MB | 1254 | 1254 | +| `de_t` | 0.23s | 0.78s | **3.4x** | 864 MB | 1157 MB | 1254 | 1254 | +| `de_bimod` | 0.11s | 0.73s | **6.4x** | 865 MB | 992 MB | 1254 | 1254 | +| `de_LR` | 1.46s | 2.48s | **1.7x** | 916 MB | 1099 MB | 1254 | 1254 | +| `de_negbinom` | 2.37s | 6.36s | **2.7x** | 923 MB | 1143 MB | 1254 | 1254 | +| `de_roc` | 0.19s | 1.67s | **8.9x** | 923 MB | 1174 MB | 1254 | 1254 | +| `de_MAST` | 1.57s | 5.92s | **3.8x** | 924 MB | 1829 MB | 1254 | 1254 | +| `de_DESeq2` | 4.00s | 10.01s | **2.5x** | 1190 MB | 2395 MB | 2347 | 2347 | +| `library_load` | — | 1.26s | — | — | 419 MB | | | +| **shared pipeline** | **11.1s** | **30.0s** | **2.7x** | **1190 MB** | **2395 MB** | | | Median of 2 timed repeats per arm, warm-up discarded. *Shared pipeline* excludes interpreter start-up. @@ -470,20 +470,19 @@ completely unaffected by the BLAS. Both arms test the same two groups of cells (truecell writes the assignment, R adopts it). The seven tests that apply the fold-change pre-filter test the same 1,254 genes and return 1,254 rows on both sides; DESeq2, which skips that filter in both tools, tests 2,347. Truecell -wins seven of the eight: `roc` 8.2x, `bimod` 6.3x, `MAST` 4.1x, `DESeq2` 3.9x, -`t` 3.3x, `negbinom` 2.6x, `LR` 1.7x. It loses `wilcox` by 3.6x, which is +wins seven of the eight: `roc` 8.9x, `bimod` 6.4x, `MAST` 3.8x, `t` 3.4x, +`negbinom` 2.7x, `DESeq2` 2.5x, `LR` 1.7x. It loses `wilcox` by 3.7x, which is presto's C++ Wilcoxon against `scipy.stats.mannwhitneyu`. `negbinom` has been -truecell's own GLM since 2.0.0, where it was statsmodels', and stays 2.6x ahead. - -**DESeq2 has a row now, and a memory cost.** In 1.0.0 the two tools meant -different things by the name and truecell's had no row here; since 2.0.0 -`test_use="deseq2"` is Seurat's per-cell `DESeq2DETest`. It is 3.9x faster -(2.50s against 9.67s), but it takes the process tree from under 1 GB to 5.2 GB. -That is pydeseq2: it starts one worker process per core, 18 here, and truecell -does not limit it; the workers stay alive after the call returns. Measured -separately, the same call held to one worker takes 4.2s and peaks at 1.2 GB, -with identical output — still 2.3x faster than Seurat, which runs DESeq2 in -one process. +truecell's own GLM since 2.0.0, where it was statsmodels', and stays 2.7x ahead. + +**DESeq2 has a row now.** In 1.0.0 the two tools meant different things by the +name and truecell's had no row here; since 2.0.0 `test_use="deseq2"` is Seurat's +per-cell `DESeq2DETest`. It is 2.5x faster (4.00s against 10.01s) on half +Seurat's memory, and it runs in one process, as DESeq2 does in R. Left to its +default, pydeseq2 starts one worker process per core. The first measurement for +this report caught that: with 18 workers the call took 2.50s, but the process +tree went from under 1 GB to 5.2 GB and stayed there after the call returned, +for the same output. 2.0.0 gives pydeseq2 one worker. **Batch integration.** Harmony goes to truecell at 1.6x (harmonypy against R's harmony, neither BLAS-bound), and so does RPCA, at 1.9x. Seurat's CCA is @@ -506,30 +505,29 @@ this one is a wall, and no BLAS changes it. |---|---:|---:|---:|---:|---:| | `pbmc3k` | 13.7s | 7.3s | 1.9x slower | 2693 MB | 1844 MB | | `sctransform` | 49.0s | 54.0s | **1.1x** | 1669 MB | 3316 MB | -| `de` | 108.7s | 303.7s | **2.8x** | 7158 MB | 5503 MB | +| `de` | 121.0s | 304.4s | **2.5x** | 3063 MB | 5564 MB | | `dimreduc` | 7.3s | 18.9s | **2.6x** | 1027 MB | 1205 MB | | `objects` | 1.5s | 3.9s | **2.6x** | 1403 MB | 2011 MB | | `integration` | 37.6s | 42.9s | **1.1x** | 5474 MB | 6296 MB | | `cellcycle` | 4.8s | 12.5s | **2.6x** | 3728 MB | 15482 MB | | `svf` | 0.8s | 5.8s | **7.7x** | 408 MB | 1068 MB | | `visium` | 2.8s | 5.6s | **2.0x** | 1615 MB | 2055 MB | -| `lazy` | 139.0s | 8.1s | 17.2x slower | 11459 MB | 4064 MB | +| `lazy` | 165.4s | 8.0s | 20.6x slower | 5649 MB | 4118 MB | These are the tutorial scripts as they ship, not the benches — a different question, and a noisier one. Each script also prints validation, writes CSVs or draws figures, and the two sides do not do equal amounts of that. Two rows need saying out loud: -* **`lazy` is not a 17x loss.** The Python script runs eight DE tests on an +* **`lazy` is not a 21x loss.** The Python script runs eight DE tests on an out-of-core layer; `FindMarkers` on a BPCells `IterableMatrix` supports `wilcox` alone, so the R script attempts eight and completes one. That is a capability difference being reported by a stopwatch — the R script finishes - sooner because there is less it can do. Half its Python peak of 11.5 GB is - pydeseq2's per-core workers (section 5): held to one worker, the same script - peaks at 5.6 GB, measured separately. + sooner because there is less it can do. Its Python peak fell from 11.5 GB to + 5.6 GB when DESeq2 moved to one process (section 5). * **`de`** runs all nine tests on both sides, and Seurat's `MAST`, `DESeq2` and - `negbinom` are most of its 303.7s. Its Python peak of 7.2 GB is mostly - pydeseq2's workers again: held to one worker, the script peaks at 3.1 GB. + `negbinom` are most of its 304.4s. Its Python peak fell from 7.2 GB to 3.1 GB + when DESeq2 moved to one process. --- @@ -544,7 +542,7 @@ dense TSV truecell reads 20,729 cells in 0.57s and 1.2 GB against Seurat's **PCA is truecell's by 1.5–2.2x.** Randomized SVD against irlba, both on the same Accelerate. -**Truecell wins seven of the eight shared DE tests** by 1.7–8.2x, and Moran's I +**Truecell wins seven of the eight shared DE tests** by 1.7–8.9x, and Moran's I by 77x with no *n* limit. **Seurat wins eight operations, and two of them decide the totals.** @@ -552,7 +550,7 @@ by 77x with no *n* limit. | Operation | Gap | Where it comes from | |---|---|---| | `umap` (seeded) | 1.7–3.9x | umap-learn drops to one thread under a `random_state` | -| `de_wilcox` | 3.6x | presto's C++ Wilcoxon vs `scipy.stats.mannwhitneyu` | +| `de_wilcox` | 3.7x | presto's C++ Wilcoxon vs `scipy.stats.mannwhitneyu` | | `integrate_cca` | 3.1x | | | `find_all_markers` | 1.6–2.6x | presto again, one call per cluster | | `hvg_vst` | 1.7–2.5x | | @@ -587,11 +585,11 @@ what keeps truecell behind on totals it would otherwise win at ≥8k cells (2.3) Either document it at the call site or expose the choice, so reproducibility is something a caller opts into knowingly rather than pays for by default. -**3. Limit pydeseq2's worker processes.** One per core bought 1.6s on this DE -bench and cost about 4 GB, which stays resident after the call returns. On a many-core -server the cost grows with the core count. One worker gives the same output. +**3. ~~Limit pydeseq2's worker processes.~~ Done in 2.0.0 — see section 5.** +One worker per core bought 1.5s on the DE bench and cost 4 GB that stayed +resident after the call, more on a machine with more cores. -**4. Consider a fast path for Wilcoxon.** `scipy.stats.mannwhitneyu` is 3.6x +**4. Consider a fast path for Wilcoxon.** `scipy.stats.mannwhitneyu` is 3.7x off presto on the same 1,254 genes, and Wilcoxon is the default test — so it lands on `find_all_markers` too, and is the whole of that gap. diff --git a/tutorials/benchmark/results/pbmc3k_de.seurat.json b/tutorials/benchmark/results/pbmc3k_de.seurat.json index 40c59bb..65f5745 100644 --- a/tutorials/benchmark/results/pbmc3k_de.seurat.json +++ b/tutorials/benchmark/results/pbmc3k_de.seurat.json @@ -4,7 +4,7 @@ "cores": "18", "memory_gb": 51.5, "platform": "macOS-27.0-arm64-arm-64bit", - "timestamp": "2026-09-18T14:13:38" + "timestamp": "2026-09-18T18:55:33" }, "blas": { "r": "R version 4.6.1 (2026-06-24)", @@ -18,110 +18,110 @@ "repeat": 1, "threads": null, "exit_code": 0, - "wall_seconds": 31.023848056793213, - "process_peak_rss_mb": 2543.21875, - "baseline_rss_mb": 0.0625, - "n_samples": 444, + "wall_seconds": 31.281569004058838, + "process_peak_rss_mb": 2387.484375, + "baseline_rss_mb": 0.125, + "n_samples": 455, "steps": [ { "step": "library_load", - "t0": 1789720957.051258, - "t1": 1789720958.27042, - "seconds": 1.219162, + "t0": 1789737870.949205, + "t1": 1789737872.204263, + "seconds": 1.255058, "anchor": null, - "peak_rss_mb": 475.671875, - "rss_start_mb": 74.09375, - "delta_rss_mb": 401.578125 + "peak_rss_mb": 418.21875, + "rss_start_mb": 64.25, + "delta_rss_mb": 353.96875 }, { "step": "prep", - "t0": 1789720958.274396, - "t1": 1789720960.185013, - "seconds": 1.910617, + "t0": 1789737872.208214, + "t1": 1789737874.194419, + "seconds": 1.986205, "anchor": 9, - "peak_rss_mb": 909.28125, - "rss_start_mb": 488.609375, - "delta_rss_mb": 420.671875 + "peak_rss_mb": 1005.0, + "rss_start_mb": 420.296875, + "delta_rss_mb": 584.703125 }, { "step": "de_wilcox", - "t0": 1789720960.193993, - "t1": 1789720960.245202, - "seconds": 0.051209, + "t0": 1789737874.203585, + "t1": 1789737874.254325, + "seconds": 0.05074, "anchor": 1254, - "peak_rss_mb": 972.65625, - "rss_start_mb": 972.65625, + "peak_rss_mb": 1005.0, + "rss_start_mb": 1005.0, "delta_rss_mb": 0.0 }, { "step": "de_t", - "t0": 1789720960.245268, - "t1": 1789720960.989371, - "seconds": 0.744103, + "t0": 1789737874.254394, + "t1": 1789737875.018012, + "seconds": 0.763618, "anchor": 1254, - "peak_rss_mb": 1128.921875, - "rss_start_mb": 972.65625, - "delta_rss_mb": 156.265625 + "peak_rss_mb": 1164.171875, + "rss_start_mb": 1033.3125, + "delta_rss_mb": 130.859375 }, { "step": "de_bimod", - "t0": 1789720960.989436, - "t1": 1789720961.709029, - "seconds": 0.719593, + "t0": 1789737875.01808, + "t1": 1789737875.744141, + "seconds": 0.726061, "anchor": 1254, - "peak_rss_mb": 996.015625, - "rss_start_mb": 876.234375, - "delta_rss_mb": 119.78125 + "peak_rss_mb": 995.203125, + "rss_start_mb": 900.84375, + "delta_rss_mb": 94.359375 }, { "step": "de_LR", - "t0": 1789720961.709099, - "t1": 1789720964.119707, - "seconds": 2.410608, + "t0": 1789737875.744213, + "t1": 1789737878.251823, + "seconds": 2.50761, "anchor": 1254, - "peak_rss_mb": 1070.734375, - "rss_start_mb": 996.015625, - "delta_rss_mb": 74.71875 + "peak_rss_mb": 1105.78125, + "rss_start_mb": 1007.921875, + "delta_rss_mb": 97.859375 }, { "step": "de_negbinom", - "t0": 1789720964.119768, - "t1": 1789720970.38761, - "seconds": 6.267842, + "t0": 1789737878.251888, + "t1": 1789737884.674106, + "seconds": 6.422218, "anchor": 1254, - "peak_rss_mb": 1108.171875, - "rss_start_mb": 1097.265625, - "delta_rss_mb": 10.90625 + "peak_rss_mb": 1143.609375, + "rss_start_mb": 1092.859375, + "delta_rss_mb": 50.75 }, { "step": "de_roc", - "t0": 1789720970.387675, - "t1": 1789720971.931042, - "seconds": 1.543367, + "t0": 1789737884.674181, + "t1": 1789737886.344621, + "seconds": 1.67044, "anchor": 1254, - "peak_rss_mb": 1145.3125, - "rss_start_mb": 1134.3125, - "delta_rss_mb": 11.0 + "peak_rss_mb": 1178.296875, + "rss_start_mb": 1169.765625, + "delta_rss_mb": 8.53125 }, { "step": "de_MAST", - "t0": 1789720971.931122, - "t1": 1789720978.298326, - "seconds": 6.367204, + "t0": 1789737886.3447, + "t1": 1789737892.229316, + "seconds": 5.884616, "anchor": 1254, - "peak_rss_mb": 1708.625, - "rss_start_mb": 1171.484375, - "delta_rss_mb": 537.140625 + "peak_rss_mb": 1829.21875, + "rss_start_mb": 1178.296875, + "delta_rss_mb": 650.921875 }, { "step": "de_DESeq2", - "t0": 1789720978.298471, - "t1": 1789720987.964644, - "seconds": 9.666173, + "t0": 1789737892.229465, + "t1": 1789737902.120064, + "seconds": 9.890599, "anchor": 2347, - "peak_rss_mb": 2543.21875, - "rss_start_mb": 1708.625, - "delta_rss_mb": 834.59375 + "peak_rss_mb": 2387.484375, + "rss_start_mb": 1829.65625, + "delta_rss_mb": 557.828125 } ], "log": "tutorials/benchmark/logs/pbmc3k_de.seurat.1.log" @@ -132,110 +132,110 @@ "repeat": 2, "threads": null, "exit_code": 0, - "wall_seconds": 30.973789930343628, - "process_peak_rss_mb": 2543.125, - "baseline_rss_mb": 0.6875, - "n_samples": 443, + "wall_seconds": 31.431775093078613, + "process_peak_rss_mb": 2401.625, + "baseline_rss_mb": 0.71875, + "n_samples": 457, "steps": [ { "step": "library_load", - "t0": 1789720988.074703, - "t1": 1789720989.281916, - "seconds": 1.207213, + "t0": 1789737902.229802, + "t1": 1789737903.487255, + "seconds": 1.257453, "anchor": null, - "peak_rss_mb": 474.734375, - "rss_start_mb": 77.03125, - "delta_rss_mb": 397.703125 + "peak_rss_mb": 419.71875, + "rss_start_mb": 66.46875, + "delta_rss_mb": 353.25 }, { "step": "prep", - "t0": 1789720989.285879, - "t1": 1789720991.190007, - "seconds": 1.904128, + "t0": 1789737903.491219, + "t1": 1789737905.469218, + "seconds": 1.977999, "anchor": 9, - "peak_rss_mb": 909.265625, - "rss_start_mb": 488.609375, - "delta_rss_mb": 420.65625 + "peak_rss_mb": 1004.40625, + "rss_start_mb": 419.71875, + "delta_rss_mb": 584.6875 }, { "step": "de_wilcox", - "t0": 1789720991.199089, - "t1": 1789720991.251864, - "seconds": 0.052775, + "t0": 1789737905.478163, + "t1": 1789737905.529347, + "seconds": 0.051184, "anchor": 1254, - "peak_rss_mb": 899.921875, - "rss_start_mb": 899.921875, + "peak_rss_mb": 1004.40625, + "rss_start_mb": 1004.40625, "delta_rss_mb": 0.0 }, { "step": "de_t", - "t0": 1789720991.25193, - "t1": 1789720991.999249, - "seconds": 0.747319, + "t0": 1789737905.529435, + "t1": 1789737906.324289, + "seconds": 0.794854, "anchor": 1254, - "peak_rss_mb": 1122.1875, - "rss_start_mb": 1041.546875, - "delta_rss_mb": 80.640625 + "peak_rss_mb": 1149.125, + "rss_start_mb": 1032.765625, + "delta_rss_mb": 116.359375 }, { "step": "de_bimod", - "t0": 1789720991.999313, - "t1": 1789720992.718474, - "seconds": 0.719161, + "t0": 1789737906.324354, + "t1": 1789737907.055291, + "seconds": 0.730937, "anchor": 1254, - "peak_rss_mb": 988.6875, - "rss_start_mb": 875.390625, - "delta_rss_mb": 113.296875 + "peak_rss_mb": 988.65625, + "rss_start_mb": 874.5625, + "delta_rss_mb": 114.09375 }, { "step": "de_LR", - "t0": 1789720992.718545, - "t1": 1789720995.123911, - "seconds": 2.405366, + "t0": 1789737907.055364, + "t1": 1789737909.507207, + "seconds": 2.451843, "anchor": 1254, - "peak_rss_mb": 1035.953125, - "rss_start_mb": 1004.375, - "delta_rss_mb": 31.578125 + "peak_rss_mb": 1092.609375, + "rss_start_mb": 1006.484375, + "delta_rss_mb": 86.125 }, { "step": "de_negbinom", - "t0": 1789720995.123976, - "t1": 1789721001.353446, - "seconds": 6.22947, + "t0": 1789737909.507269, + "t1": 1789737915.804146, + "seconds": 6.296877, "anchor": 1254, - "peak_rss_mb": 1108.203125, - "rss_start_mb": 1087.1875, - "delta_rss_mb": 21.015625 + "peak_rss_mb": 1143.375, + "rss_start_mb": 1092.609375, + "delta_rss_mb": 50.765625 }, { "step": "de_roc", - "t0": 1789721001.353511, - "t1": 1789721002.891139, - "seconds": 1.537628, + "t0": 1789737915.804215, + "t1": 1789737917.465489, + "seconds": 1.661274, "anchor": 1254, - "peak_rss_mb": 1145.34375, - "rss_start_mb": 1108.203125, - "delta_rss_mb": 37.140625 + "peak_rss_mb": 1170.046875, + "rss_start_mb": 1169.53125, + "delta_rss_mb": 0.515625 }, { "step": "de_MAST", - "t0": 1789721002.891238, - "t1": 1789721009.256625, - "seconds": 6.365387, + "t0": 1789737917.465572, + "t1": 1789737923.423568, + "seconds": 5.957996, "anchor": 1254, - "peak_rss_mb": 1708.625, - "rss_start_mb": 1171.515625, - "delta_rss_mb": 537.109375 + "peak_rss_mb": 1829.765625, + "rss_start_mb": 1178.75, + "delta_rss_mb": 651.015625 }, { "step": "de_DESeq2", - "t0": 1789721009.256775, - "t1": 1789721018.939327, - "seconds": 9.682552, + "t0": 1789737923.42372, + "t1": 1789737933.551325, + "seconds": 10.127605, "anchor": 2347, - "peak_rss_mb": 2543.125, - "rss_start_mb": 1708.65625, - "delta_rss_mb": 834.46875 + "peak_rss_mb": 2401.625, + "rss_start_mb": 1829.765625, + "delta_rss_mb": 571.859375 } ], "log": "tutorials/benchmark/logs/pbmc3k_de.seurat.2.log" diff --git a/tutorials/benchmark/results/pbmc3k_de.truecell.json b/tutorials/benchmark/results/pbmc3k_de.truecell.json index 98569d2..f4a77a1 100644 --- a/tutorials/benchmark/results/pbmc3k_de.truecell.json +++ b/tutorials/benchmark/results/pbmc3k_de.truecell.json @@ -4,7 +4,7 @@ "cores": "18", "memory_gb": 51.5, "platform": "macOS-27.0-arm64-arm-64bit", - "timestamp": "2026-09-18T14:12:05" + "timestamp": "2026-09-18T18:53:58" }, "blas": { "numpy": "2.4.6", @@ -19,110 +19,110 @@ "repeat": 1, "threads": null, "exit_code": 0, - "wall_seconds": 10.51613187789917, - "process_peak_rss_mb": 5173.484375, - "baseline_rss_mb": 1.609375, - "n_samples": 147, + "wall_seconds": 11.746921062469482, + "process_peak_rss_mb": 1190.40625, + "baseline_rss_mb": 0.953125, + "n_samples": 172, "steps": [ { "step": "import", - "t0": 1789720904.6208858, - "t1": 1789720905.063406, - "seconds": 0.4425201416015625, + "t0": 1789737815.415794, + "t1": 1789737815.8560221, + "seconds": 0.4402282238006592, "anchor": null, - "peak_rss_mb": 143.375, - "rss_start_mb": 1.609375, - "delta_rss_mb": 141.765625 + "peak_rss_mb": 140.90625, + "rss_start_mb": 0.953125, + "delta_rss_mb": 139.953125 }, { "step": "prep", - "t0": 1789720905.063463, - "t1": 1789720906.074903, - "seconds": 1.0114400386810303, + "t0": 1789737815.8560882, + "t1": 1789737816.856871, + "seconds": 1.0007827281951904, "anchor": 9, - "peak_rss_mb": 862.796875, - "rss_start_mb": 143.375, - "delta_rss_mb": 719.421875 + "peak_rss_mb": 862.9375, + "rss_start_mb": 214.484375, + "delta_rss_mb": 648.453125 }, { "step": "de_wilcox", - "t0": 1789720906.0772228, - "t1": 1789720906.261224, - "seconds": 0.18400120735168457, + "t0": 1789737816.8591669, + "t1": 1789737817.049856, + "seconds": 0.1906890869140625, "anchor": 1254, - "peak_rss_mb": 863.890625, - "rss_start_mb": 863.359375, - "delta_rss_mb": 0.53125 + "peak_rss_mb": 864.34375, + "rss_start_mb": 862.9375, + "delta_rss_mb": 1.40625 }, { "step": "de_t", - "t0": 1789720906.261278, - "t1": 1789720906.483669, - "seconds": 0.22239112854003906, + "t0": 1789737817.049897, + "t1": 1789737817.2820659, + "seconds": 0.23216891288757324, "anchor": 1254, - "peak_rss_mb": 864.0, - "rss_start_mb": 864.0, - "delta_rss_mb": 0.0 + "peak_rss_mb": 864.40625, + "rss_start_mb": 864.34375, + "delta_rss_mb": 0.0625 }, { "step": "de_bimod", - "t0": 1789720906.483718, - "t1": 1789720906.59703, - "seconds": 0.1133120059967041, + "t0": 1789737817.2821171, + "t1": 1789737817.3967721, + "seconds": 0.1146550178527832, "anchor": 1254, - "peak_rss_mb": 864.765625, - "rss_start_mb": 864.296875, - "delta_rss_mb": 0.46875 + "peak_rss_mb": 865.28125, + "rss_start_mb": 864.40625, + "delta_rss_mb": 0.875 }, { "step": "de_LR", - "t0": 1789720906.5970728, - "t1": 1789720908.037382, - "seconds": 1.4403090476989746, + "t0": 1789737817.39682, + "t1": 1789737818.855608, + "seconds": 1.4587879180908203, "anchor": 1254, - "peak_rss_mb": 915.6875, - "rss_start_mb": 864.765625, - "delta_rss_mb": 50.921875 + "peak_rss_mb": 916.015625, + "rss_start_mb": 865.28125, + "delta_rss_mb": 50.734375 }, { "step": "de_negbinom", - "t0": 1789720908.037438, - "t1": 1789720910.416255, - "seconds": 2.378817081451416, + "t0": 1789737818.85567, + "t1": 1789737821.214813, + "seconds": 2.359143018722534, "anchor": 1254, - "peak_rss_mb": 922.09375, - "rss_start_mb": 915.734375, - "delta_rss_mb": 6.359375 + "peak_rss_mb": 922.4375, + "rss_start_mb": 916.09375, + "delta_rss_mb": 6.34375 }, { "step": "de_roc", - "t0": 1789720910.416307, - "t1": 1789720910.60499, - "seconds": 0.18868303298950195, + "t0": 1789737821.2148612, + "t1": 1789737821.402627, + "seconds": 0.18776583671569824, "anchor": 1254, - "peak_rss_mb": 922.109375, - "rss_start_mb": 922.109375, + "peak_rss_mb": 922.4375, + "rss_start_mb": 922.4375, "delta_rss_mb": 0.0 }, { "step": "de_MAST", - "t0": 1789720910.605037, - "t1": 1789720912.157087, - "seconds": 1.5520501136779785, + "t0": 1789737821.402682, + "t1": 1789737822.966296, + "seconds": 1.5636138916015625, "anchor": 1254, - "peak_rss_mb": 923.75, - "rss_start_mb": 922.109375, - "delta_rss_mb": 1.640625 + "peak_rss_mb": 924.03125, + "rss_start_mb": 922.4375, + "delta_rss_mb": 1.59375 }, { "step": "de_DESeq2", - "t0": 1789720912.157145, - "t1": 1789720914.657032, - "seconds": 2.499886989593506, + "t0": 1789737822.9663491, + "t1": 1789737826.936555, + "seconds": 3.970205783843994, "anchor": 2347, - "peak_rss_mb": 5171.5625, - "rss_start_mb": 923.75, - "delta_rss_mb": 4247.8125 + "peak_rss_mb": 1190.265625, + "rss_start_mb": 924.03125, + "delta_rss_mb": 266.234375 } ], "log": "tutorials/benchmark/logs/pbmc3k_de.truecell.1.log" @@ -133,110 +133,110 @@ "repeat": 2, "threads": null, "exit_code": 0, - "wall_seconds": 10.500158071517944, - "process_peak_rss_mb": 5180.625, - "baseline_rss_mb": 0.75, - "n_samples": 146, + "wall_seconds": 11.817707061767578, + "process_peak_rss_mb": 1190.546875, + "baseline_rss_mb": 2.265625, + "n_samples": 172, "steps": [ { "step": "import", - "t0": 1789720915.137565, - "t1": 1789720915.581822, - "seconds": 0.4442570209503174, + "t0": 1789737827.1634839, + "t1": 1789737827.619492, + "seconds": 0.4560081958770752, "anchor": null, - "peak_rss_mb": 143.328125, - "rss_start_mb": 0.75, - "delta_rss_mb": 142.578125 + "peak_rss_mb": 139.84375, + "rss_start_mb": 2.265625, + "delta_rss_mb": 137.578125 }, { "step": "prep", - "t0": 1789720915.581887, - "t1": 1789720916.582319, - "seconds": 1.000432014465332, + "t0": 1789737827.619553, + "t1": 1789737828.6378539, + "seconds": 1.0183007717132568, "anchor": 9, - "peak_rss_mb": 862.78125, - "rss_start_mb": 143.328125, - "delta_rss_mb": 719.453125 + "peak_rss_mb": 863.125, + "rss_start_mb": 165.234375, + "delta_rss_mb": 697.890625 }, { "step": "de_wilcox", - "t0": 1789720916.584547, - "t1": 1789720916.770419, - "seconds": 0.18587183952331543, + "t0": 1789737828.640099, + "t1": 1789737828.8267741, + "seconds": 0.1866750717163086, "anchor": 1254, - "peak_rss_mb": 863.84375, - "rss_start_mb": 863.625, - "delta_rss_mb": 0.21875 + "peak_rss_mb": 864.390625, + "rss_start_mb": 864.1875, + "delta_rss_mb": 0.203125 }, { "step": "de_t", - "t0": 1789720916.7704651, - "t1": 1789720916.994168, - "seconds": 0.22370290756225586, + "t0": 1789737828.826829, + "t1": 1789737829.048384, + "seconds": 0.22155499458312988, "anchor": 1254, - "peak_rss_mb": 863.96875, - "rss_start_mb": 863.84375, - "delta_rss_mb": 0.125 + "peak_rss_mb": 864.5, + "rss_start_mb": 864.390625, + "delta_rss_mb": 0.109375 }, { "step": "de_bimod", - "t0": 1789720916.994216, - "t1": 1789720917.108145, - "seconds": 0.11392903327941895, + "t0": 1789737829.048436, + "t1": 1789737829.1606321, + "seconds": 0.11219620704650879, "anchor": 1254, - "peak_rss_mb": 864.828125, - "rss_start_mb": 864.53125, - "delta_rss_mb": 0.296875 + "peak_rss_mb": 865.296875, + "rss_start_mb": 865.015625, + "delta_rss_mb": 0.28125 }, { "step": "de_LR", - "t0": 1789720917.10819, - "t1": 1789720918.538622, - "seconds": 1.430431842803955, + "t0": 1789737829.160682, + "t1": 1789737830.614552, + "seconds": 1.4538700580596924, "anchor": 1254, - "peak_rss_mb": 915.8125, - "rss_start_mb": 864.828125, - "delta_rss_mb": 50.984375 + "peak_rss_mb": 916.234375, + "rss_start_mb": 865.296875, + "delta_rss_mb": 50.9375 }, { "step": "de_negbinom", - "t0": 1789720918.538683, - "t1": 1789720920.928292, - "seconds": 2.3896090984344482, + "t0": 1789737830.614613, + "t1": 1789737832.9883149, + "seconds": 2.373701810836792, "anchor": 1254, - "peak_rss_mb": 922.21875, - "rss_start_mb": 922.21875, - "delta_rss_mb": 0.0 + "peak_rss_mb": 922.671875, + "rss_start_mb": 916.234375, + "delta_rss_mb": 6.4375 }, { "step": "de_roc", - "t0": 1789720920.928333, - "t1": 1789720921.115515, - "seconds": 0.18718194961547852, + "t0": 1789737832.988373, + "t1": 1789737833.1764631, + "seconds": 0.18809008598327637, "anchor": 1254, - "peak_rss_mb": 922.21875, - "rss_start_mb": 922.21875, - "delta_rss_mb": 0.0 + "peak_rss_mb": 922.703125, + "rss_start_mb": 922.671875, + "delta_rss_mb": 0.03125 }, { "step": "de_MAST", - "t0": 1789720921.1155689, - "t1": 1789720922.663869, - "seconds": 1.54830002784729, + "t0": 1789737833.176515, + "t1": 1789737834.746965, + "seconds": 1.5704498291015625, "anchor": 1254, - "peak_rss_mb": 923.875, - "rss_start_mb": 922.28125, - "delta_rss_mb": 1.59375 + "peak_rss_mb": 924.40625, + "rss_start_mb": 922.75, + "delta_rss_mb": 1.65625 }, { "step": "de_DESeq2", - "t0": 1789720922.663925, - "t1": 1789720925.16259, - "seconds": 2.4986650943756104, + "t0": 1789737834.7470121, + "t1": 1789737838.773468, + "seconds": 4.026455879211426, "anchor": 2347, - "peak_rss_mb": 5179.109375, - "rss_start_mb": 936.828125, - "delta_rss_mb": 4242.28125 + "peak_rss_mb": 1190.4375, + "rss_start_mb": 924.40625, + "delta_rss_mb": 266.03125 } ], "log": "tutorials/benchmark/logs/pbmc3k_de.truecell.2.log" diff --git a/tutorials/benchmark/results/tutorial_scripts.json b/tutorials/benchmark/results/tutorial_scripts.json index 9e042d5..002a434 100644 --- a/tutorials/benchmark/results/tutorial_scripts.json +++ b/tutorials/benchmark/results/tutorial_scripts.json @@ -4,7 +4,7 @@ "cores": "18", "memory_gb": 51.5, "platform": "macOS-27.0-arm64-arm-64bit", - "timestamp": "2026-09-18T14:16:37" + "timestamp": "2026-09-18T18:55:33" }, "blas": { "truecell": { @@ -56,15 +56,15 @@ "truecell": { "cmd": "python pbmc3k_de_tutorial.py", "exit_code": 0, - "wall_seconds": 108.65645098686218, - "peak_rss_mb": 7158.109375, + "wall_seconds": 121.00172519683838, + "peak_rss_mb": 3063.296875, "log": "tutorials/benchmark/logs/tutorial.de.truecell.log" }, "seurat": { "cmd": "Rscript pbmc3k_de_verify.R", "exit_code": 0, - "wall_seconds": 303.6627948284149, - "peak_rss_mb": 5503.328125, + "wall_seconds": 304.3869881629944, + "peak_rss_mb": 5563.765625, "log": "tutorials/benchmark/logs/tutorial.de.seurat.log" } }, @@ -168,15 +168,15 @@ "truecell": { "cmd": "python lazy_bpcells_tutorial.py", "exit_code": 0, - "wall_seconds": 138.96063613891602, - "peak_rss_mb": 11459.09375, + "wall_seconds": 165.416601896286, + "peak_rss_mb": 5648.78125, "log": "tutorials/benchmark/logs/tutorial.lazy.truecell.log" }, "seurat": { "cmd": "Rscript lazy_bpcells_verify.R", "exit_code": 0, - "wall_seconds": 8.091996908187866, - "peak_rss_mb": 4063.765625, + "wall_seconds": 8.03419804573059, + "peak_rss_mb": 4118.140625, "log": "tutorials/benchmark/logs/tutorial.lazy.seurat.log" } }