Optimize an experimental disk-backed UMAP graph
Source:R/massive_umap_optimizer.R
massive_umap_optimize.RdStreams a symmetric fuzzy CSR graph for each epoch. CPU coordinates use float32 RAM or an explicitly requested writable memory-mapped file. CUDA streams bounded edge batches. Its default layout must fit VRAM; explicit managed storage allows CUDA paging from host RAM. Sampling times are derived from edge weights instead of storing a per-edge schedule. CPU supports file-backed 2D or 3D initialization; Completed CPU or CUDA epochs can be checkpointed and resumed without rescanning earlier epochs.
Usage
massive_umap_optimize(
graph,
init,
output,
n_epochs = 200L,
negative_sample_rate = 5L,
learning_rate = 1,
min_dist = 0.1,
repulsion_strength = 1,
seed = 1L,
chunk_rows = 8192L,
memory_limit = "16GB",
backend = "cpu",
n.cores = 1L,
checkpoint = FALSE,
resume = FALSE,
checkpoint_every = 10L,
layout_storage = "memory"
)Arguments
- graph
A result of
massive_umap_fuzzy_graph().- init
A file-backed
massive_matrix()of initial coordinates.- output
New
.f32file for the resulting coordinates.- n_epochs
Number of optimization epochs, at least two because the first epoch initializes the edge-sampling schedule.
- negative_sample_rate
Negative samples per positive edge.
- learning_rate
Initial learning rate.
- min_dist
UMAP minimum-distance curve parameter.
- repulsion_strength
Repulsive-force multiplier.
- seed
Random seed for negative sampling.
- chunk_rows
Maximum graph rows per sequential read.
- memory_limit
Host working-buffer budget. The full layout counts in CPU RAM mode; OS page cache for a mapped layout is not capped by this value. CUDA preflights device allocations against free device memory; managed CUDA coordinates count against the host budget.
- backend
"cpu"or"cuda"; CUDA has no CPU fallback.- n.cores
Only one worker is currently supported.
- checkpoint
Save a full coordinate snapshot at completed epochs.
- resume
Continue a matching interrupted fit on the same backend.
- checkpoint_every
Number of epochs between snapshots.
- layout_storage
"memory"(default),"mmap"for CPU writable mapping, or"managed"for explicit CUDA unified memory. Managed storage may page between host and GPU and requires a supporting GPU.