cirron traces
Read and export the local trace data the Cirron Python SDK produces whenci.profile() runs. Where cirron spool gives you a
file-level view of the raw batch JSON on disk, cirron traces gives you a
semantic view: reconstructs the scope tree across batches, groups records
into sessions, renders flamegraphs, and exports to Parquet, OpenTelemetry,
CSV, or JSON.
Everything runs entirely against the local spool (./.cirron/spool/) and
snapshot directory (./.cirron/snapshots/<span_id>/). No network, no
platform authentication. Your traces are yours, in open formats, on your disk.
Subcommands
cirron traces view: Render a session’s scope tree as a text flamegraphcirron traces list: Table of sessions with counts and sizescirron traces export: Convert to Parquet / OpenTelemetry / CSV / JSONcirron traces clear: Delete sessions and their snapshot directoriescirron traces snapshots: Table of weight/gradient snapshots grouped by spancirron traces snapshot: Inspect stats, histograms, and safetensors tensors for a span
Usage
Global Options
| Option | Description | Default |
|---|---|---|
--spool <dir> | Override the spool directory | ./.cirron/spool |
--json | Emit machine-readable JSON (view, list, snapshots) | — |
--no-color | Disable ANSI color (view, snapshot) | TTY-aware; honors NO_COLOR |
Vocabulary
- Session: One
ci.profile()lifetime, rooted at acirron.sessionspan. Typically one per training run. - Span: A timed scope (epoch, step, forward pass, optimizer step). Spans nest via
parent_id. - Mark: A named scalar (
ci.mark("loss", 0.5)) attached to the innermost open span. - Snapshot: Per-tensor weight or gradient record at an epoch boundary. Stats live inline;
sampled/fullmodes also store safetensors blobs under./.cirron/snapshots/<span_id>/.
end_ns) and walking parent pointers from every cirron.session root. Unknown top-level and per-span fields are ignored. A newer SDK can add metadata without breaking an older CLI.
View the scope tree
Render one or more sessions as an indented text flamegraph.| Option | Description |
|---|---|
--last <n> | Show the N newest sessions (default: 1) |
--name <substr> | Keep only spans whose name contains the substring (ancestors preserved) |
--session <id> | Show a specific session. Prefix match allowed |
--depth <n> | Collapse the tree below depth N (shows aggregate duration and span count) |
--min-wall <dur> | Hide spans shorter than the given duration (ns, us/µs, ms, s, m, h) |
Example output
ci.mark <name>=<value> lines under the span they attach to. point marks render as-is; summary marks carry a (summary) suffix.
With --depth 1, subtrees collapse to … 33.6ms (4 spans, collapsed) aggregates. The collapsed duration sums descendants only, so it’s always ≤ the parent’s wall time.
List sessions
Table of every session in the spool, newest first.cirron.session without end_ns) show (live) and are protected from destructive clear --keep operations.
Export traces
Convert local traces into an open format for DuckDB, pandas, Polars, or any OpenTelemetry backend (Jaeger, Tempo, Honeycomb, etc.).| Option | Description |
|---|---|
--format <fmt> | Required. One of parquet, otel (alias: otlp), csv, json |
--output <path> | Output path. Parquet → directory; other formats → file. Defaults to ./cirron-traces[.ext] |
--session <id> | Export a single session (prefix match allowed). Default: all sessions |
--format parquet
Writes three files into the output directory: spans.parquet (one row per span; columns mirror the platform TraceSpan model), marks.parquet (one row per mark), snapshots.parquet (stats inline; blobs remain on disk). All *_ns columns are INT64.
@dsnp/parquetjs (pure JavaScript) so the CLI’s pkg-built binaries work without native modules.
--format otel
Emits a single OTLP/JSON file. If a tool speaks OTLP, it can read this file. No Cirron-specific reader required.
Works with Jaeger, Grafana Tempo, SigNoz, Uptrace, ClickStack, Honeycomb, Datadog, New Relic, Dynatrace, Splunk Observability, Lightstep, Elastic APM, Axiom, Azure Monitor, Google Cloud Trace, AWS X-Ray (via OTEL collector), otelcol, Grafana Alloy/Agent, Vector, and any OTLP/HTTP /v1/traces endpoint:
resourceSpans[] with service.name=cirron, sdk.version, and cirron.session.id. traceId (32 hex) is derived from the session id; spanId/parentSpanId (16 hex each) from Cirron span ids, derived, not just truncated, so non-hex ids stay spec-valid. startTimeUnixNano/endTimeUnixNano are string-encoded int64 per the OTLP spec. Attributes wrap as AnyValue with correct scalar promotion. Marks attach to their owning span as events[]. Status.code defaults UNSET (0); becomes ERROR (2) if the span has an error attribute. OK is never set proactively (the profiler has no success/failure model).
--format csv
Flat, spans-only CSV streamed to disk (bounded memory). Columns:
--format json
Merged, deduplicated JSON in the same shape as a single spool batch:
id across spans, marks, and snapshots, safe to diff or re-import.
Clear sessions
Delete sessions (batch files plus snapshot directories) with a confirmation prompt by default.| Option | Description |
|---|---|
--before <iso-date> | Only sessions with start_ns before this ISO-8601 date are eligible |
--keep <n> | Retain the N most recent non-live sessions |
--yes | Skip the confirmation prompt |
--no-prune-orphans | Don’t sweep snapshot directories whose span id isn’t referenced by any surviving session |
./.cirron/snapshots/<span_id>/ directories, and by default any orphan snapshot directories. Live sessions are never deleted by --keep; --before deletes them only if their start timestamp is already in the past cutoff.
Confirmation prompt:
cirron spool clear (file-level, deletes batch JSON only). Prefer traces clear for user-facing cleanup.
List snapshots
Weight/gradient snapshots grouped by the span that produced them.- TENSORS: number of snapshot records (one per parameter and per
.gradif gradients were captured). - MODES:
stats(inline only),sampled(stats + blob for some epochs),full(blob every epoch). - WITH BLOB: records carrying a
blob_uri.
Inspect a snapshot
Deep-dive view: combines inline stats with the safetensors file header on disk, renders an ASCII histogram of tensor values, and optionally previews or exports raw tensor data.| Option | Description |
|---|---|
--file <path> | Read a specific safetensors file instead of auto-selecting weights.safetensors and gradients.safetensors under the span directory |
--preview <n> | Print first N values of the selected tensor (requires a tensor argument) |
--tail <n> | Print last N values |
--export <path> | With tensor: write a single-tensor safetensors file. Without tensor: copy whole-span blobs |
--json | Machine-readable output |
--no-color | Disable ANSI color |
Example: span summary
Example: focused tensor view
▁▂▃▄▅▆▇█) scaled to the max bucket count.
Supported dtypes
Every standard safetensors dtype:F64, F32, F16, BF16, I64, I32, I16, I8, U64, U32, U16, U8, BOOL. --preview upcasts F16/BF16 to float32 for display; integer types print exact values (64-bit ints as BigInt).
Export rules
With a tensor name: writes a fresh single-tensor safetensors file containing only the requested tensor. If<path> is an existing directory, the file is written as <tensor_name>.safetensors inside it (non-filename characters replaced with _).
Without a tensor name: copies the candidate safetensors blob(s) to the destination. File vs directory is auto-detected:
- If the path exists on disk, we use what’s there (dir → dir, file → file).
- If the path ends in
.safetensors, it’s treated as a file. - If there’s exactly one blob and the path has no extension, it’s treated as a file.
- Otherwise the path is treated as a directory.
--file to narrow the selection.
Examples
Troubleshooting
| Error | Resolution |
|---|---|
No traces found | Call ci.profile() in your Python script before the work you want to trace, or point --spool at the right directory |
No session found matching <prefix> | Use cirron traces list for valid ids; prefix matching is substring-prefix, not fuzzy |
Tensor "<name>" not found | Run cirron traces snapshot <span> without a tensor name to list all tensors; copy names verbatim (layer1.0.conv1.weight) |
Destination is a single file but N blobs were found | Point --export at a directory, or use --file <path> to pick one blob |
Invalid --before date | Use ISO-8601: 2026-04-20, 2026-04-20T12:00:00Z |
| Ctrl-C during clear | Reports how many files/dirs were deleted before interruption; exit code 130 |
Related Commands
cirron spool: File-level view; required forspool flushto upload batches to the platform.cirron auth: Authenticate beforespool flush(not needed for anytracessubcommand).cirron status: Check CLI + platform connectivity.