stormlog.infer.correlation_events
Versioned, engine-neutral inference execution records.
The v1 endpoint records in stormlog.infer.events remain client
observations. These v2 records describe server execution without assigning
shared work to individual requests merely because they participated in it.
Functions
|
The intervals in which a GPU activity kept its device busy, or None. |
|
Read mixed legacy and correlation records in their original order. |
|
Parse one v1 or v2 JSONL record without fabricating missing evidence. |
Classes
|
A scoped trace activity and its optional link to an iteration. |
|
Versioned run identity for an inference JSONL artifact. |
|
Availability and outcome for one optional capture component. |
|
Offset and uncertainty for comparing two distinct clock domains. |
|
Capture identity and evidence quality shared by one emitted record. |
|
Common event identity; subclasses own their event-specific evidence. |
|
An ID scoped to its producer within a run. |
|
One server execution iteration, recorded once for all participants. |
An unchanged v1 record; server correlation remains unknown. |
|
|
One request's role in one shared execution iteration. |
|
One logical request observation; attempts are separate identities. |
|
A generic named stage span, for LLM and non-LLM workloads. |
- class stormlog.infer.correlation_events.ActivityReferenceEvent(*, context, event_id, metadata=<factory>, activity_ref, activity_kind, attribution_status, activity_domain='unknown', iteration_ref=None, correlation_scope=None, trace_attachment_id=None, runtime_correlation_id=None, cuda_correlation_id=None, stream_id=None, graph_id=None, start_ns=None, end_ns=None)[source]
Bases:
CorrelationEventA scoped trace activity and its optional link to an iteration.
- Parameters:
context (CorrelationContext)
event_id (str)
metadata (dict[str, Any])
activity_ref (EntityRef)
activity_kind (str)
attribution_status (str)
activity_domain (str)
iteration_ref (EntityRef | None)
correlation_scope (EntityRef | None)
trace_attachment_id (str | None)
runtime_correlation_id (int | None)
cuda_correlation_id (int | None)
stream_id (int | None)
graph_id (int | None)
start_ns (int | None)
end_ns (int | None)
- EVENT_TYPE: ClassVar[str] = 'infer.activity_ref'
- activity_kind: str
- attribution_status: str
- activity_domain: str = 'unknown'
- trace_attachment_id: str | None = None
- runtime_correlation_id: int | None = None
- cuda_correlation_id: int | None = None
- stream_id: int | None = None
- graph_id: int | None = None
- start_ns: int | None = None
- end_ns: int | None = None
- property schema_version: int
Busy intervals change what the span means, so they take version 3.
- class stormlog.infer.correlation_events.ArtifactIdentityEvent(*, context, event_id, metadata=<factory>, artifact_kind, created_at_ns)[source]
Bases:
CorrelationEventVersioned run identity for an inference JSONL artifact.
- Parameters:
context (CorrelationContext)
event_id (str)
metadata (dict[str, Any])
artifact_kind (str)
created_at_ns (int)
- EVENT_TYPE: ClassVar[str] = 'infer.artifact'
- artifact_kind: str
- created_at_ns: int
- class stormlog.infer.correlation_events.CapabilityEvent(*, context, event_id, metadata=<factory>, component, available, supported=<factory>, enabled=<factory>, collected=<factory>)[source]
Bases:
CorrelationEventAvailability and outcome for one optional capture component.
- Parameters:
context (CorrelationContext)
event_id (str)
metadata (dict[str, Any])
component (str)
available (bool)
supported (list[str])
enabled (list[str])
collected (list[str])
- EVENT_TYPE: ClassVar[str] = 'infer.capabilities'
- component: str
- available: bool
- supported: list[str]
- enabled: list[str]
- collected: list[str]
- class stormlog.infer.correlation_events.ClockAlignmentEvent(*, context, event_id, metadata=<factory>, from_clock_domain, to_clock_domain, offset_ns, uncertainty_ns, valid_from_ns=None, valid_to_ns=None)[source]
Bases:
CorrelationEventOffset and uncertainty for comparing two distinct clock domains.
- Parameters:
context (CorrelationContext)
event_id (str)
metadata (dict[str, Any])
from_clock_domain (str)
to_clock_domain (str)
offset_ns (int)
uncertainty_ns (int)
valid_from_ns (int | None)
valid_to_ns (int | None)
- EVENT_TYPE: ClassVar[str] = 'infer.clock_alignment'
- from_clock_domain: str
- to_clock_domain: str
- offset_ns: int
- uncertainty_ns: int
- valid_from_ns: int | None = None
- valid_to_ns: int | None = None
- class stormlog.infer.correlation_events.CorrelationContext(run_id, session_id, producer_id, source, clock_domain, clock_kind, collection_mode, provenance, source_version=None, engine=None, engine_version=None, backend=None, backend_version=None, host=None, pid=None, device_uuid=None, rank=None, local_rank=None, world_size=None)[source]
Bases:
objectCapture identity and evidence quality shared by one emitted record.
- Parameters:
run_id (str)
session_id (str)
producer_id (str)
source (str)
clock_domain (str)
clock_kind (str)
collection_mode (str)
provenance (str)
source_version (str | None)
engine (str | None)
engine_version (str | None)
backend (str | None)
backend_version (str | None)
host (str | None)
pid (int | None)
device_uuid (str | None)
rank (int | None)
local_rank (int | None)
world_size (int | None)
- run_id: str
- session_id: str
- producer_id: str
- source: str
- clock_domain: str
- clock_kind: str
- collection_mode: str
- provenance: str
- source_version: str | None = None
- engine: str | None = None
- engine_version: str | None = None
- backend: str | None = None
- backend_version: str | None = None
- host: str | None = None
- pid: int | None = None
- device_uuid: str | None = None
- rank: int | None = None
- local_rank: int | None = None
- world_size: int | None = None
- class stormlog.infer.correlation_events.CorrelationEvent(*, context, event_id, metadata=<factory>)[source]
Bases:
objectCommon event identity; subclasses own their event-specific evidence.
- Parameters:
context (CorrelationContext)
event_id (str)
metadata (dict[str, Any])
- context: CorrelationContext
- event_id: str
- metadata: dict[str, Any]
- EVENT_TYPE: ClassVar[str]
- property schema_version: int
- property elapsed_ns: int | None
Only local monotonic spans have an unqualified duration.
- class stormlog.infer.correlation_events.EntityRef(producer_id, id)[source]
Bases:
objectAn ID scoped to its producer within a run.
- Parameters:
producer_id (str)
id (str)
- producer_id: str
- id: str
- class stormlog.infer.correlation_events.IterationEvent(*, context, event_id, metadata=<factory>, iteration_ref, batch_ref=None, start_ns=None, end_ns=None)[source]
Bases:
CorrelationEventOne server execution iteration, recorded once for all participants.
- Parameters:
context (CorrelationContext)
event_id (str)
metadata (dict[str, Any])
iteration_ref (EntityRef)
batch_ref (EntityRef | None)
start_ns (int | None)
end_ns (int | None)
- EVENT_TYPE: ClassVar[str] = 'infer.iteration'
- start_ns: int | None = None
- end_ns: int | None = None
- class stormlog.infer.correlation_events.LegacyInferenceRecord(raw)[source]
Bases:
objectAn unchanged v1 record; server correlation remains unknown.
- Parameters:
raw (dict[str, Any])
- raw: dict[str, Any]
- class stormlog.infer.correlation_events.MembershipEvent(*, context, event_id, metadata=<factory>, request_ref, iteration_ref, role, attempt_ref=None, input_tokens=None, output_tokens=None, kv_bytes=None)[source]
Bases:
CorrelationEventOne request’s role in one shared execution iteration.
- Parameters:
context (CorrelationContext)
event_id (str)
metadata (dict[str, Any])
request_ref (EntityRef)
iteration_ref (EntityRef)
role (str)
attempt_ref (EntityRef | None)
input_tokens (int | None)
output_tokens (int | None)
kv_bytes (int | None)
- EVENT_TYPE: ClassVar[str] = 'infer.membership'
- role: str
- input_tokens: int | None = None
- output_tokens: int | None = None
- kv_bytes: int | None = None
- class stormlog.infer.correlation_events.RequestEvent(*, context, event_id, metadata=<factory>, request_ref, attempt_ref=None, backend_request_ref=None, start_ns=None, end_ns=None, status=None, input_tokens=None, output_tokens=None, kv_bytes=None)[source]
Bases:
CorrelationEventOne logical request observation; attempts are separate identities.
- Parameters:
context (CorrelationContext)
event_id (str)
metadata (dict[str, Any])
request_ref (EntityRef)
attempt_ref (EntityRef | None)
backend_request_ref (EntityRef | None)
start_ns (int | None)
end_ns (int | None)
status (str | None)
input_tokens (int | None)
output_tokens (int | None)
kv_bytes (int | None)
- EVENT_TYPE: ClassVar[str] = 'infer.request'
- start_ns: int | None = None
- end_ns: int | None = None
- status: str | None = None
- input_tokens: int | None = None
- output_tokens: int | None = None
- kv_bytes: int | None = None
- class stormlog.infer.correlation_events.StageEvent(*, context, event_id, metadata=<factory>, stage_ref, name, request_ref=None, iteration_ref=None, start_ns=None, end_ns=None, input_tokens=None, output_tokens=None, kv_bytes=None)[source]
Bases:
CorrelationEventA generic named stage span, for LLM and non-LLM workloads.
- Parameters:
context (CorrelationContext)
event_id (str)
metadata (dict[str, Any])
stage_ref (EntityRef)
name (str)
request_ref (EntityRef | None)
iteration_ref (EntityRef | None)
start_ns (int | None)
end_ns (int | None)
input_tokens (int | None)
output_tokens (int | None)
kv_bytes (int | None)
- EVENT_TYPE: ClassVar[str] = 'infer.stage'
- name: str
- start_ns: int | None = None
- end_ns: int | None = None
- input_tokens: int | None = None
- output_tokens: int | None = None
- kv_bytes: int | None = None
- stormlog.infer.correlation_events.activity_busy_intervals(activity)[source]
The intervals in which a GPU activity kept its device busy, or None.
Without
metadata.intervalsthe activity is busy for[start_ns, end_ns), and None means it has no complete span. With them (schema version 3) it is busy only inside those[offset_ns, duration_ns]pairs fromstart_ns, which must be sorted, disjoint, and inside the span; anything else is aValueError.- Parameters:
activity (ActivityReferenceEvent)
- Return type:
list[tuple[int, int]] | None
- stormlog.infer.correlation_events.load_inference_artifact(path)[source]
Read mixed legacy and correlation records in their original order.
- Parameters:
path (str | Path)
- Return type: