Julenmendieta/MILAB-6501_handleHugeInputs - #111
Merged
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Comment on lines
+1270
to
+1277
| keys_parts, coords_parts, n_degenerate = [], [], 0 | ||
| for ks, mat in _stream_clonotypes(pf, args.key_col, args.dim_col, args.value_col, D): | ||
| c, nd = _transform_batch_cpu(pca, k_pca, umap_model, args.umap_components, mat) | ||
| keys_parts.append(ks) | ||
| coords_parts.append(c) | ||
| n_degenerate += nd | ||
| keys = np.concatenate(keys_parts) if keys_parts else np.array([], dtype=object) | ||
| coords = np.vstack(coords_parts) if coords_parts else np.empty((0, args.umap_components)) |
There was a problem hiding this comment.
Output accumulation remains unbounded
When a CPU embedding run contains enough clonotypes, this loop retains every key and coordinate batch, then duplicates them with concatenate/vstack and again as Python lists and a Polars frame, causing the process to exhaust the newly capped 48 GiB allocation despite the input matrix being streamed.
Prompt To Fix With AI
This is a comment left during a code review.
Path: software/umap/src/main.py
Line: 1270-1277
Comment:
**Output accumulation remains unbounded**
When a CPU embedding run contains enough clonotypes, this loop retains every key and coordinate batch, then duplicates them with `concatenate`/`vstack` and again as Python lists and a Polars frame, causing the process to exhaust the newly capped 48 GiB allocation despite the input matrix being streamed.
How can I resolve this? If you propose a fix, please make it concise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Greptile Summary
This PR changes embedding-mode UMAP to use a bounded CPU fit sample and batched projection, propagates embedding dimensionality through the workflow, and updates resource sizing and SDK dependencies.
pl7.app/embedding/length; it is now passed as--dims, with first-row-group inference as a fallback.--max-sequences; CPU PCA and UMAP are now fitted on this sample before all clonotypes are transformed.Confidence Score: 3/5
The PR should not merge until the CPU embedding output is streamed or otherwise bounded, because huge inputs can still exhaust the newly reduced RAM allocation.
Input feature matrices are streamed, but all output keys and coordinates remain resident and are copied repeatedly during concatenation, Python-list conversion, and DataFrame creation, so peak CPU memory still grows with clonotype count.
Files Needing Attention: software/umap/src/main.py and workflow/src/resource-formula.lib.tengo
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Long-format embedding Parquet] --> B[Stream clonotype batches] B --> C[Seeded bounded fit sample] C --> D[Fit centered PCA] D --> E[Fit CPU UMAP] B --> F[Transform each batch] D --> F E --> F F --> G[Accumulate all keys and coordinates] G --> H[Materialize TSV output] A --> I[GPU device matrix] I --> J[Fit-on-all cuML PCA and UMAP] J --> HPrompt To Fix All With AI
Reviews (1): Last reviewed commit: "Changeset" | Re-trigger Greptile
Context used: