Skip to main content

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.

License

Apache-2.0.

Metadata

Release files for ingero-annotate 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ingero-annotate 0.1.1
File Size Uploaded Provenance Actions
ingero_annotate-0.1.1.tar.gz 16.9 kB With provenance Details for ingero_annotate-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ingero-annotate 0.1.1
File Interpreter ABI Platform Actions
ingero_annotate-0.1.1-py3-none-any.whl Python 3 none any Details for ingero_annotate-0.1.1-py3-none-any.whl

Total release size: 28.2 kB

Release files / ingero_annotate-0.1.1.tar.gz

Download URL ingero_annotate-0.1.1.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
34d7c7ec0cc0497757cf01f66813a1e6ce3e6268334fd2bd26bde245c69fa8b4
BLAKE2b-256 checksum
How to use checksums
ae8371ed095e3bcd4003289eeb3f0df9240133c15f3f2e48c71d762f94b8d88a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release files / ingero_annotate-0.1.1-py3-none-any.whl

Download URL ingero_annotate-0.1.1-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
01a7d50161b4bb75b86af16e73c50f1fe415063dba0bf0fe187f4b43e30a3c09
BLAKE2b-256 checksum
How to use checksums
2909620abd87ac9f27756070c656cd7516f8917e9c478cd317fe257a1ce36f52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Security for ingero-annotate 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ingero_annotate-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page