Skip to contents

Runs the existing native Leiden or Louvain implementation on a resident landmark graph. Saved CPU-, CUDA-, or Metal-built KNN rows are streamed through inverse-distance weighted community voting. A supplied landmark selection preserves reference labels at their source rows.

Usage

massive_cluster_landmarks(
  reference_graph,
  knn,
  output,
  method = c("leiden", "louvain"),
  selection = NULL,
  backend = "cpu",
  n.cores = 1L,
  chunk_rows = NULL,
  memory_limit = fastembedr_memory_option(),
  resolution = 1,
  n_iterations = 10L,
  n_runs = 1L,
  steps = 4L,
  seed = 1L,
  checkpoint = FALSE,
  checkpoint_every = 100L,
  resume = FALSE,
  devices = NULL,
  parallel.mode = c("restarts", "fit")
)

Arguments

reference_graph

A knn_graph() result for the landmark rows.

knn

Saved CPU-, CUDA-, or Metal-built query-to-landmark graph from massive_landmark_knn().

output

New prefix for label and confidence output files.

method

"leiden" or "louvain".

selection

Optional result of massive_select_landmarks() from the query source; selected rows retain their fitted community labels.

backend

"cpu" for all methods, or "cuda" or "metal" for landmark-graph Louvain and Leiden. Streamed community voting remains on CPU. GPU requests fail explicitly if unavailable.

n.cores

CPU workers for community voting and, when n_runs > 1, independent Leiden/Louvain fitting restarts.

chunk_rows

Maximum query rows per batch.

memory_limit

Conservative RAM budget for voting buffers.

resolution

Modularity resolution for Leiden or Louvain.

n_iterations

Maximum local-moving passes.

n_runs

Independent seeded graph-clustering runs.

steps

Reserved legacy control; only the default is accepted.

seed

Random seed for Leiden or Louvain.

checkpoint

Save landmark communities and completed output rows.

checkpoint_every

Save progress after this many query batches.

resume

Continue from matching partial outputs and checkpoint.

devices

Optional distinct CUDA devices. Multiple devices coordinate one resident landmark-graph fit; label voting remains CPU-streamed.

parallel.mode

"restarts" uses workers for independent CPU fits; "fit" uses them for one shared CPU Louvain/Leiden fit.

Value

A lightweight fastEmbedR_massive_clusters descriptor with one-based uint32 labels, float32 confidence, and landmark metadata.