Skip to main content

Annotate live Ingero GPU traces with your application's semantics (training step, epoch, inference request_id, model).

Project description

ingero-annotate

Add semantic labels to GPU traces captured by Ingero.

What is Ingero?

Ingero is an open source eBPF agent that traces what your GPU is doing in production. It attaches to libcudart, libcuda, and Linux kernel tracepoints, then answers questions like "which CUDA kernels stalled and why," "which process held VRAM," and "which rank in a multi-GPU run was the slow one." No source-code changes, no rebuild. You run ingero trace next to your training or inference job.

What ingero trace cannot know on its own is your application's semantics. It sees kernel launches, memcpy timings, scheduler events. It does not see "this is epoch 3, step 42" or "this is request abc-123 for the llama-3-8b model."

That is what ingero-annotate is for.

What does annotate do?

It is a small Python client that pushes semantic labels into the live trace over a Unix-domain socket. The agent attaches those labels to the trace timeline, so when you later run ingero explain or open the trace in Perfetto, you see kernel events keyed to your concepts.

Training example. Emit a step and phase label at each iteration boundary. A question like "which optimizer step had the 4x backward-pass spike" becomes a one-line query against the trace, instead of squinting at unlabeled kernel timings.

Inference example. Emit request_id and model per request. You can then ask "which incoming request caused the GPU saturation at 14:23:07" and get an answer that names the request, instead of just "something heavy happened."

Install

pip install ingero-annotate

Quick start

Run the agent with the annotation socket bound:

sudo ingero trace --record --annotate

Then from your Python code:

import os
from ingero_annotate import AnnotationWriter

writer = AnnotationWriter()                       # connects, or no-ops silently
writer.write({"step": "42"}, pid=os.getpid())     # one instant annotation
writer.write({"phase": "backward"}, pid=os.getpid())
writer.close()

AnnotationWriter is also a context manager for connection lifecycle:

with AnnotationWriter() as w:
    for step in range(1000):
        w.write({"step": str(step)}, pid=os.getpid())
        train_one_step()

If the agent is not running, or the socket is missing, the writer drops silently. Your training or inference code keeps working unchanged.

Don't want to wire it by hand?

Drop-in adapters for common frameworks live in the agent repo, under examples/integrations/:

  • PyTorch Lightning callback
  • HuggingFace Trainer callback
  • DeepSpeed wrapper
  • Accelerate hook
  • Ray task hook
  • vLLM per-request emitter (inference, emits time-bounded spans)

Each one pulls step / epoch / request_id out of its framework and emits annotations for you.

Wire protocol

Each annotation is one line of NDJSON written to the socket:

{"labels": {"step": "42"}, "pid": 1234, "ts": 1700000000000000000}

labels is required. pid scopes the annotation to one process; without it the label applies trace-wide. ts is optional unix nanoseconds (absent means the agent stamps receive time). The contract also supports time-bounded span annotations (span_start / span_end), used today by the vLLM per-request emitter; this library exposes instant annotations and lets specialized adapters write spans directly.

Label keys and values are validated against the agent contract (charsets, length limits) before being sent.

Per-request inference correlation

For per-request inference workloads, ingero explain --by-request and ingero query --by-request group analyzed events by request_id. The output is a time-overlap slice, not exclusive kernel ownership: under continuous batching a single kernel can belong to many in-flight requests. The agent prints that caveat with every per-request report. Full semantics, trust-domain scope, and example output: docs/commands.md.

Links

License

Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ingero_annotate-0.1.1.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ingero_annotate-0.1.1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file ingero_annotate-0.1.1.tar.gz.

File metadata

  • Download URL: ingero_annotate-0.1.1.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ingero_annotate-0.1.1.tar.gz
Algorithm Hash digest
SHA256 34d7c7ec0cc0497757cf01f66813a1e6ce3e6268334fd2bd26bde245c69fa8b4
MD5 b635d6dcc418c6341f695a7dfc06cf2d
BLAKE2b-256 ae8371ed095e3bcd4003289eeb3f0df9240133c15f3f2e48c71d762f94b8d88a

See more details on using hashes here.

Provenance

The following attestation bundles were made for ingero_annotate-0.1.1.tar.gz:

Publisher: publish-pypi.yml on ingero-io/ingero

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ingero_annotate-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ingero_annotate-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ingero_annotate-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 01a7d50161b4bb75b86af16e73c50f1fe415063dba0bf0fe187f4b43e30a3c09
MD5 32e3dc9b97bc83c67fa25aae4ec76f3a
BLAKE2b-256 2909620abd87ac9f27756070c656cd7516f8917e9c478cd317fe257a1ce36f52

See more details on using hashes here.

Provenance

The following attestation bundles were made for ingero_annotate-0.1.1-py3-none-any.whl:

Publisher: publish-pypi.yml on ingero-io/ingero

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page