CyteArc keeps large matrices in Zarr and streams planned blocks through memory. It does not load the full count matrix simply because a DataStore is opened. Memory use still depends on the operation: graph construction and clustering can hold structures in addition to the streamed count blocks.
Set resources and inspect a run¶
Set a budget and worker count when sharing a machine or submitting a batch job. For an existing RNA store, this example allows up to four workers and a 16 GiB operation budget:
# Import CyteArc for the analysis.
import cytearc
# Open the existing store with the chosen resource limits.
ds = cytearc.DataStore("data.zarr", mem_budget="16G", nthreads=4)
# Run the RNA recipe under a new analysis label.
run = ds.pipeline.rna(label="rna_analysis")
# Inspect recorded stage timings, memory use, and reused results.
run.report()Use a new label for each run. To inspect a completed run without recomputing it, reopen its label with ds.pipeline.open(label="rna_analysis") and call report() on that result. The report includes stage timings, sampled resident memory (RSS), and the warnings that each stage logged. Sampled peaks can miss brief allocations.
mem_budget is an operation budget, not a hard cap on total process resident memory. It covers the data that CyteArc holds: the arrays and blocks that grow with the cells, features, values and chunks an operation works on. Python, Zarr and NumPy hold a little more of their own, such as objects, file buffers and temporaries, so leave some headroom beside the budget. Memory the process already holds when an operation starts, such as the interpreter, native libraries, graph structures, and earlier results, is not subtracted either, so a process can peak at its resident memory plus the budget.
The sections below explain what the budget covers, how workers are chosen, and how to compare measurements.
Resource controls¶
Memory budget¶
mem_budget accepts bytes, a size such as "8G", or a fraction of detected system memory such as "0.6". The size suffixes K, M, G, and T are powers of 1024, alone or followed by B or iB, so "8G", "8GB", and "8GiB" are the same budget. A budget that is not a positive finite size, such as "inf", and a worker count below one, from nthreads or CYTEARC_WORKERS, raise ValueError. Without an explicit value or CYTEARC_MEM_BUDGET, it defaults to 75% of detected memory, using the smaller of physical memory and any detected cgroup limit: the total, not the memory free when the budget is resolved, so leave room for other processes on a shared host. Physical memory comes from /proc/meminfo on Linux, sysconf on macOS and other Unix systems, and GlobalMemoryStatusEx on Windows. Where neither physical memory nor a cgroup limit can be read, a default or fractional budget raises RuntimeError, and a size such as mem_budget="16G" still works. Explicit budgets, including fractions of detected memory, are not reduced. Each operation reserves within it the blocks it reads and what Zarr holds while it reads them: for a sharded array, such as the counts, a shard-level copy of the selection and the compressed chunks the read touches in a shard, and for every array the chunks it decodes, which an unsharded array, such as normalized data, holds beside their compressed bytes. For a block transformed by a chain of element-wise steps, such as library-size scaling followed by a logarithm, it reserves the step of the chain that holds the most, one step’s input beside its output. It also reserves its kernel scratch and results, and limits its concurrent reads and writes and the width of automatically sized feature batches to fit. Imports write the default count layout unless they are given a policy, and an import whose default count shards do not fit stops before it writes, naming the smaller policy that fits; given policy="fit", it writes that policy instead. A sparse import charges what its producer holds: a source batch of one band of rows, which holds an int64 row and column beside each value, and the band’s values, which it holds twice, with two mask bytes each, while it cuts the band. That is about 62 bytes for each nonzero count of a band of 4-byte values, beside the band it writes; rows whose indices are unsorted or repeated add their sort, and an assay of a few features, such as antibodies whose band spans every cell, is charged its own values only. Subset, repack, merge, and grouped assays fit the count layout to the budget by default, writing smaller count shards. The layout changes how the counts are stored, never the store’s identity.
Some steps hold whole structures in memory beside their streamed blocks, and compare an estimate of them with the budget before they read a coordinate or graph:
an approximate nearest-neighbor index holds every cell’s coordinates and links, about
4 * dims + 8 * ann_m + 130bytes per cell on x86-64 Linux, whilegraph.ann_indexbuilds and saves it and whilegraph.neighborsloads and queries it; a query also holds the indices and distances of every cell’s neighbors, 8 bytes per neighbor;an in-memory k-means embedding initialization holds the coordinates of every cell;
pipeline cluster selection holds the coordinates of its sample of at most 10,000 cells, in their stored dtype and as float64, beside the silhouette’s distance chunks; it sizes those chunks from the remaining budget with an allowance for temporary arrays and caps each distance chunk at 1 GiB;
Harmony holds the float64 coordinates three times, as its input, its original copy, and its corrected copy, and float64 soft cluster assignments with
n_clustersvalues per cell, about 1.5 KB per cell with 30 dimensions and 100 clusters, plus per-level regression sums oflevels x n_clusters x dimsfloats, beside the batch labels it read, about 60 bytes per cell for each column of short labels;an import that shuffles cells holds the order of the cells and its inverse, 16 bytes per cell; each writer of its temporary rows, one per value-scan process of an H5AD import, holds a count and a mark for every cell, 9 bytes per cell, and up to 1 GiB of rows waiting for their temporary file within its share of
mem_budget. H5AD and Seurat imports hold each per-cell array other than counts whole, in the file’s order, while they write it in shuffled order: an H5AD import its selected embeddings and each key’s cluster labels, a Seurat import its cell IDs, each metadata column, assay membership, active identity, and each reduction’s coordinates and cell names. They check each such array againstmem_budgetbeside what they hold throughout, such as the order and the cell IDs, and refuse before they write anything when one does not fit. A CSV import holds its cell columns from its pass over the file until the counts are written, andSparseToZarrthe rows’ sizes in shuffled order, 8 bytes per cell;WNN integration holds every assay’s neighbors and coordinates and the integrated graph;
SNN integration holds every source graph and a float64 matrix of shared-neighbor fractions per graph;
the connectivity conversion holds every cell’s neighbor indices and distances and the edges it builds from them, about 29 bytes per neighbor;
Leiden clustering, UMAP, and t-SNE load the whole graph, about 28 bytes per stored edge and twice that when they symmetrize it, beside what they compute: Leiden’s own backend holds the symmetric graph and its first aggregates, and UMAP the fuzzy union of the graph with its sampling schedules, about 100 bytes per stored edge; for t-SNE only the arrays CyteArc passes to
sgtsnepiare counted, not its own working memory;the trajectory calls that score or load a pseudotime or a fate map, among them
pseudotime,load_pseudotime,fate,curves,lineage_membershipandbranch_cells, load the graph it was computed on and number the graph’s connected components: the load forms the fuzzy union as Leiden’s symmetrized load does, and numbering the components holds up to three more copies of the union, which SciPy 1.16 makes when it casts float32 weights to float64, beside the subgraph that a pseudotime of some of the graph’s cells takes first. Later SciPy releases copy less. Scoring a pseudotime also holds the scored component’s graph and its solve, MINRES’s vectors or ARPACK’s basis and singular vectors. These calls read the source and sink labels, a stored source/sink vector and its cells’ IDs, or a direction score before the graph, each as a read of a cell-aligned artifact is charged, and keep only which listed label each cell holds;lineage_membershipchecks the graph’s load against the larger of the load and what the membership holds with its inputs, andfateagainst the larger of the load and what mapping the fates holds, so one refusal names a budget that runs them.imputation.diffusion, the smoothing ofscores.potencyandgraph.loadcheck the graph’s load before they read it too, beside the operator’s first step, the smoothing, or nothing. The loaders of saved feature analyses along a pseudotime or a fate map,load_markers,load_aggregation,load_lineage_markers,load_driversandload_lineage_aggregation, check their saved table of every feature, fingerprinting its arrays and reading its statistics and its frozen feature names and IDs, and then read the selected features’ rows; they size both from the table’s stored arrays and check them with their graph’s load, andplots.pseudotime_heatmapandplots.lineage_heatmapadd what drawing holds, so one refusal, which names the saved table where it needs more than the graph, names a budget that loads them.markers,aggregation,lineage_markers,driversandlineage_aggregationcheck a saved result against the budget before they read it to reuse it.
Over the budget, such a step raises MemoryBudgetError before it reads anything or creates or loads an index, naming the bytes, the cells and other sizes, and the limit; it never changes its algorithm on its own. The estimates count the arrays that grow with the data; silhouette also counts the distance buffers and reductions made beside its distance chunks. The budget compares them with its limit; they are not a cap on the memory of the process, which also holds the interpreter, native libraries and their own buffers, and earlier results. A coordinate stream’s reads reserve what its consumer holds while it reads, and a consumer releases each block before the stream reads the next. Cluster selection reads its sampled cells in blocks of the stored coordinates, so it decodes every stored chunk that holds one of them, which for a sample spread over a large normalized matrix is most of it.
graph.ann_index saves the index through a temporary file of about 4 * dims + 8 * ann_m + 20 bytes per cell, and graph.neighbors loads it through another one of the same size, in the system’s temporary directory (TMPDIR on Linux and macOS); leave that much free space there. variants.import_counts sorts the rows that outgrow its budget in runs in the same directory, about 4 bytes per count row of mgatk’s files, and removes them when the import ends. An import that shuffles cells keeps the cells’ rows in the reader’s temp_dir, about one byte per stored count, and deletes them as it writes the counts. A composite with remote sources keeps downloaded source objects in the same temporary directory, up to CYTEARC_SOURCE_CACHE_BYTES per open composite (2 GiB unless set; 0 reads the sources directly). That disk space is outside mem_budget, and where the temporary directory is memory-backed, such as a tmpfs /tmp, it uses memory.
An RNA run with pca={"dims": 0} builds its graph on the normalized values of the selected features, one coordinate per highly variable gene, so the memory and time of the ANN index, the neighbor queries, the embedding initialization, and cluster selection scale with the HVG count instead of the PCA dimensions. At 1,000,000 cells the index alone holds about 4.3 GB with 1,000 HVGs and 8.3 GB with 2,000 at the default ann_m=24, and the embedding initialization holds every cell’s coordinates, 4 bytes per HVG per cell, when one stored band holds every cell; pass embedding_initialization={"batch_size": ...} with a batch size below the cell count to select its streamed fit, which holds a sample of the cells and one block of coordinates at a time.
A stream that closes early, such as one whose consumer stops or fails, can leave a chunk fetch or decode of one of its reads still running on a codec thread. That call ends just after, holding at most one chunk per busy codec thread, which is part of the headroom to leave: in the default layouts a chunk holds at most 128 MiB of normalized values, 100 MB of counts and 16 MiB of a new store’s cell column.
What a refusal names¶
The receptor import, clonotypes, gene_usage, spectratype, export_airr and the other repertoire steps charge what each step will hold to the budget before the step allocates, and refuse a step that would pass it before anything is written. So do the imports of clones, lineage barcodes, recorder alleles, phylogenies and variant counts, from the selected cells’ positions and IDs to the artifact they write: the join of the files’ barcodes to the cells, the clones gathered, the records encoded, each chunk of a file, whose rows the room left when the file is planned sizes, and the save. So do from_column, which stamps the column by its stored chunks before it reads a label, the clone summaries, their loads and the clone export, the figure labels of clonotypes, and the calls of clones from lineage barcodes, recorder alleles and phylogenies, each on one ledger from its first read to its write, the steps of clone calling and the search for near sequences included. So do the screen’s guide calling, call_guides and import_guide_calls, perturbation.labels, their loaders and the perturbation recipe’s check of a call file, from the guide IDs, the cells’ positions, samples and IDs to the calls, labels and fits they write: the call file’s parse and the join of its barcodes, the histograms of the fitted methods as they grow, the padded calls and the save. So does genotype_clones, from the sites it reads to the clones it writes: the calls, read in bands of cells whose rows the room sizes and packed 64 sites to a word, each fit’s arrays of cells by components and each step of its search, or the exact rule’s sets and graph. Every grouping of cells, of the clone summaries, of gene usage and junction lengths, of figures and of the clone callers’ within columns, charges the same way what it reads and builds beside what the call holds when it groups. The refusal is a MemoryBudgetError, a MemoryError, whose message names the step, the bytes the call needs at that step and the budget, and closes with the budget that passes the step:
Importing contigs for 8 selected cells holds about 1154586 bytes for a chunk of 1000 contig rows
as parsed, more than the memory budget of 1000000 bytes. Raise mem_budget to at least 1154586
bytes, or pass a smaller cell_selection.The error holds the same numbers as needed_bytes and budget_bytes, and the step as item. A budget of needed_bytes passes that step; a later step can need more, and names it the same way. A step whose blocks take a share of the room, such as a file’s chunks or from_column’s blocks of labels, reads larger blocks at a larger budget, so the budget that its refusals name runs it, and a budget a little below may run it too, with smaller blocks. Each step is charged:
a read of a stored array: its result and the chunks that Zarr decodes at once, each as stored, at the bound of its compressed bytes, and decoded, so a store’s cell columns, which new stores chunk by their cells and widths (cell column chunks), are charged by the chunks they are stored in. A whole read runs at the highest Zarr concurrency, up to the operation’s, whose decoded chunks fit what the budget leaves, and one chunk at a time when only that fits. A read of selected rows reads a band of chunks at a time beside each row’s indices, 48 bytes a row while it orders them and 32 while it reads, a block of each band’s rows, 512 bytes, and the copy that Zarr takes of the rows each decoded chunk holds before it places them. A sharded array is read a band of inner chunks at a time, so that no fetch takes more than a band of a shard. Each band is a read of its own, and CPython keeps objects that the earlier bands’ reads freed on its free lists, which on Python 3.13 fill with the tuples that Zarr builds (Zarr's memory controls), so a read of several bands is also charged the objects of the earlier bands’ reads, 32 KiB and 4 KiB for each of their chunks, up to 192 KiB for a one-dimensional array and 743 KiB for an array of more axes, where what such reads leave levels off. A read of a local store also holds the buffer of each file it reads: before Python 3.14, the file system’s block size, or
io.DEFAULT_BUFFER_SIZEwhere that is unknown, for every file, and from Python 3.14, which reads a whole file unbuffered, the block size, at leastio.DEFAULT_BUFFER_SIZE, 128 KiB, and at most 8 MiB, for each part of a shard of several chunks. Text of variable width, which another tool can write with Zarr’sdtype=str, is charged by what its values hold, as a measure of the column finds them once in each operation. While Zarr decodes a chunk of it, each value holds its stored bytes, a 4-byte length and its UTF-8 bytes, the Python string that the decoder makes of it and a reference to that string, a copy of its UTF-8 bytes in a string beyond ASCII, and the value that NumPy keeps: 16 bytes, and for a value of more than 15 bytes in UTF-8 a quarter more than its bytes and its size, a byte up to 255 bytes and 8 beyond. A chunk is charged as the chunk whose values hold the most, a whole read as every value, and a read of some rows as the longest value for each row but no more than every value, so one long label leaves the charge of the others as it was; 20,000 labels of 71 ASCII characters in one chunk are charged 301 bytes a value while their chunk decodes and 106 once read. Scattered rows of such text are read a stored chunk’s span at a time, which Zarr returns before the rows are taken from it, and a read keeps charged with its rows the objects of Zarr’s read, 32 KiB for the read and 4 KiB for each chunk it takes, which stay held once it returns, by its caller or on CPython’s free lists, since the strings that it then makes are charged by their characters. The measure reads one stored chunk at a time: before it reads a chunk it charges what decoding the chunk holds at the least, each value as an empty string, and once the chunk is measured, what reading it held, from its own values; it casts values of up to 64 characters to fixed-width text, at most 1 MiB at a time beside the buffer of NumPy’s cast, and makes Python strings of longer ones. A categorical column is read as its codes, charged so, beside its categories and the labels the read returns; a read that returns strings returns one Python string per category, which the rows share, and a grouping or the samples of an operation read its codes alone and code the cells through the categories, so they hold a code per cell instead of a label (categorical columns). A cell selection’s cells are found in its flags, one for each cell of the store, read whole, beside 24 bytes for each cell it selects while their positions are found, moved and returned;what the step builds: Python strings at 41 bytes and one per character in ASCII, 57 and one up to U+00FF, 58 and two up to U+FFFF and 60 and four beyond, by the widest character a string holds; NumPy and Zarr text at four bytes a character of its widest value; an object array at 8 bytes a value; a sort’s copy, and half as much again for a stable sort or, on values of one or two bytes, as much again; and a pandas hash table at 16 bytes and a bit for each bucket, a power of two at most 77% full, for every value hashed up to about a million and then for every distinct value. Coding labels in their natural order also holds, for each distinct label, its sort key: a tuple of its runs of digits and of other characters and a casefolded copy of its text, and for text beyond ASCII the UTF-8 copy that pandas keeps in each string it hashes, which a grouping charges with each label it reads;
a stamp of an array’s stored chunks, as
from_columntakes of its column: the stored bytes of the largest batch of chunks fetched at once, each hashed as fetched, by their file sizes where the store reports them and decoded otherwise;writing an artifact: what
cell_data_write_bytesstates, the chunks that Zarr encodes from the costliest array at once;a stream of counts, as guide calling streams the guide counts: a block of the rows of a stored chunk and the stream’s decode beside what the call holds, since a smaller block would decode the same chunk again for each block, then as many blocks ahead as the budget leaves room for.
The count value scan, which reads every count of an import to choose the dtype that stores the counts, words its refusal as the example above does. It names the budget of the longest row or column of the matrix, also when that comes after the one that the scan stopped at or in another run of a 10x HDF5 file’s selected barcodes, so a budget of needed_bytes scans the whole matrix. An H5AD import restates the refusals of its scan, of its shuffle and of its conversion of a matrix compressed by column in the same words, with its own budget: what the step needs beside the IDs, names and other arrays that the import holds throughout. A conversion refused before it reads any entry names the budget of its row with the most entries, which the row indices give. Shuffled imports of 10x HDF5, Matrix Market and Tapestri files restate the refusals of their scan and shuffle beside the cell order. A shuffled CSV import restates its shuffle’s refusal the same way, with the least budget that passes the shuffle, since a larger budget sizes larger buckets, which need less memory beside them. SparseToZarr restates its scan’s refusal beside the matrices that it holds.
Every other memory check raises a MemoryBudgetError with the same three fields and keeps its own message, which ends with the bytes the step needs where it named none:
the plans of streamed work: the units and tasks of a storage plan, asynchronous buffers, feature streams, and copies of metadata;
imports and other count writes: the count layout, whose
CountLayoutMemoryErroris aMemoryBudgetError, the sparse and dense band writes,countsT, the conversions of the readers (sparse rows, H5AD matrices compressed by column, Seurat sources), composites, and merges;normalization, its document frequencies and its feature batches;
the steps that state their own peak: PCA, k-means, Harmony, ANN indexes, integration, graph loads, streaming and materialized LSI, diffusion, imputation, fate mapping, lineage curves, trees, membership and binning, Paris, cell calling, HTO demultiplexing, chromVAR, GRN inference, marker search, cluster selection, melding, mapping and graph export;
reads of cell-aligned artifacts, such as
artifacts.load_valuesandselect_cells, which check the cells’ positions and every array that the call reads at them twice: before anything is read, and once the positions are read, before any value is.
needed_bytes is always a mem_budget: where a step plans with part of the budget, as normalization’s producer does beside its writer and chromVAR’s background model with half of it, it names the whole budget that leaves the step what it needs. One refusal names no budget that passes it: a count write handed a batch larger than its producer reserved names what the write would reserve with that batch, which can be below the budget, since the producer broke its own reservation. Lineage curves write the cells’ positions and distances a whole chunk band of 100,000 rows at a time, and count each band and what Zarr holds to write it. The checks of the other variant operations raise a MemoryError of their own, and the screen’s other operations, efficiency, edistance, signature, mixscape, associations, profiles and cluster, raise a MemoryBudgetError in their own words.
The budget bounds the bytes that these steps charge, not the resident memory of the process. The identity checks of stored cell and feature selections, which most operations run once on their inputs, read the row identifiers one stored chunk at a time and hold one chunk, with its selected rows where they check a row order, outside the budget: at most 16 MiB of values in a new store’s cell table. Only the first check of a process decodes the identifiers; later checks reuse its fingerprint while the identifiers’ stored bytes are unchanged, and so do the checks of the columns that a run snapshot holds, such as the feature names of a graph’s highly variable genes. A planner that sizes a step before its call has a ledger, such as the loads of variant calls and recorder alleles, measures a column of variable-width text without a ledger to charge, and holds one stored chunk of it outside the budget the same way, unless a read of the operation measured the column first. glibc can also keep freed buffers of 32 MiB or less resident after an operation; setting the MALLOC_MMAP_THRESHOLD_ environment variable, for example to 131072, before Python starts returns them to the system.
Worker concurrency¶
Worker concurrency is auto-detected from the process environment. On shared hosts, multiprocess jobs, or remote object stores, set CYTEARC_WORKERS or pass the advanced nthreads constructor argument to bound the maximum worker budget. Zarr decompresses and compresses a store’s chunks on at most nthreads threads for every read and write through its DataStore: opening the store, its operations, plots, exports and recipes, and the arrays that you compute from it yourself, such as ds.RNA.rawData, so nthreads=1 keeps that work on one core. DataStores open on one store, or on one location, such as a local folder or a remote URL, decompress its chunks on the fewest of their nthreads, and an import, a subset, a merge, a mount, a composite or a repack does this work on its own nthreads. A Zarr codec pipeline that you configure in place of Zarr’s default decompresses on all of the host’s threads. More workers can increase concurrent buffers or remote requests, so pair a large worker budget with an explicit mem_budget. Opt-in parallel UMAP layouts and ANN index builds are faster but not reproducible: two runs on several threads can differ even with the same thread count. Their artifact identities therefore record only the parallel or ann_parallel flag, and the thread counts are execution options, so the same request reuses its result on any machine. A serial UMAP layout runs on one thread and releases the GIL during each epoch, so other Python threads of the process, such as an application’s heartbeat, keep running. Doublet detection scores as many samples at once as the workers and the memory budget hold. A sample of 50,000 cells and simulated doublets or more is indexed in 4 parts, built at once, and every index is built on one thread, whatever ann_parallel says, so a sample’s scores are the same for any thread count. Leiden clustering with the default "cytearc" backend runs on the worker budget and returns identical labels for any thread count, so its artifacts record no worker count either; the optional "igraph" and "leidenalg" backends run on one thread. t-SNE always runs on one thread through the optional sgtsnepi package, so its artifacts record no worker count. GRN inference with nthreads above 1 fits the targets left after about two seconds of fitting in worker processes, as many as nthreads allows; regulons.grn runs fewer when the memory budget holds fewer of them, each charged its own copy of the regulators and one fit. Every target’s regressor has the same seed, so the links are the same for any thread count. The workers start as new interpreters that import the main module, so a script keeps its own work under if __name__ == "__main__":.
Each process plans within its own mem_budget and nthreads and knows nothing of what other processes hold, so processes that analyze one store at once (Several processes on one store), or share a machine, each need their share: two processes might each take mem_budget="0.35" and half the cores.
Why RNA stores have two count orientations¶
Most analysis steps walk the matrix by cell. Quality control, library-size normalization, and graph construction read rows of counts. Gene-wise steps such as highly variable gene selection and marker search walk the matrix by feature.
Those two access patterns compete on a single physical layout. CyteArc therefore stores RNA counts twice: counts is cell-major, and countsT contains the same values in gene-major order. They are two orientations of one assay matrix, not two datastores. The second orientation roughly doubles stored RNA counts. ATAC, ADT, and other non-RNA assays keep only counts.
Current RNA stores require a matching current-layout countsT. Store inspection, import, and offline rewrite procedures belong to Import and export and the FAQ, rather than the memory-planning model on this page.
Storage profiles¶
New writers use Zarr v3 and choose one of two profiles:
fast_localuses LZ4 with bit-shuffle and is selected automatically for local filesystem, memory, andfile://targets.clouduses Zstandard level 3 and is selected automatically for remote URI targets and other non-local stores.
Override automatic selection with a writer’s profile=, a datastore’s zarrProfile=, or CYTEARC_ZARR_PROFILE=fast_local|cloud. The profile determines the physical encoding when arrays are written. Changing it while reopening an existing store does not rewrite the arrays.
See Explore a remote dataset to mount a remote dataset and save your work separately. Storage options, source identity, and local_cache scratch behavior are covered in Remote storage configuration.
Batch and HPC output¶
Disable animated progress in non-interactive logs and add timestamps:
# Configure output for a non-interactive job.
import cytearc
# Disable progress bars and add log timestamps.
cytearc.configure_output(progress=False, timestamps=True)Progress rendering and log severity are independent. To also select a log level or file:
# Write informational logs to a local file.
cytearc.set_verbosity(level="INFO", filepath="cytearc-run.log")A job that configures Python’s logging can receive CyteArc’s records there instead: cytearc.configure_output(stdlib=True) sends them to the standard-library logger named cytearc, and a record logged during a pipeline stage carries the run ID and stage as its cytearc_run_id and cytearc_stage attributes. set_verbosity returns the records to CyteArc’s own output. With progress bars off, a pipeline run still sends stage_progress events to its callback and listeners, so a job can record progress without rendering bars.
See the utilities API reference for the exact output contract.
Measuring resource use¶
Measure the complete workflow on the hardware and storage service you intend to use. Runtime and memory depend on dataset sparsity, selected features, graph parameters, worker count, cache state, and software versions.
Record the dataset and cell selection, analysis settings, code revision, dependency versions, CPU and memory limits, storage location, and whether the run reused existing artifacts. Keep conversion and download time separate from analysis time, and report both stage timings and the complete elapsed time. Repeat measurements under the same conditions before comparing changes.
A pipeline run records, for each stage, its wall and CPU time, sampled resident memory and the process’s peak, OS threads, network bytes, the worker count and memory budget it was given, the CPUs and memory its process could use, and a trace of samples, beside its warnings and summary, in run.report() (Stage resources). ds.pipeline.plan reports these values from the latest earlier run that computed each stage, so the stages that stay on one core, read the most over the network, or need the most memory show before a run starts. Sampled peaks can miss brief allocations; the process’s peak RSS, which the kernel keeps, holds them when a stage raised it. mem_budget controls planned work and is not a hard limit on the process’s resident memory; see Memory budget.
For focused performance checks, the repository’s benchmark suite measures input-size ladders and projects their scaling to larger workloads:
# Measure the benchmark input sizes and project their scaling.
CYTEARC_RUN_BENCHMARKS=1 uv run pytest -n 0 tests/benchmarksWithout a baseline, this records measurements without a regression comparison. See Contributing for creating a baseline, comparing revisions on the same machine, and interpreting projected delays.
Compare remote and local storage only with matched datasets, analysis settings, resources, and cache conditions. Measurements from one workload do not establish biological correctness or hardware requirements for another. See Explore a remote dataset for storage and mounting mechanics.