Skip to content

Conversation

@jafioti
Copy link
Collaborator

@jafioti jafioti commented Jan 1, 2026

Motivation

  • Centralize Perfetto trace output tracking so GPU postprocessing can reuse the trace file created by the unified tracing initializer.
  • Let GPU timing postprocessing accept path-like inputs and be invoked automatically when a Perfetto sink is configured.
  • Provide a simple TraceSession API to flush/stop traces and expose the Perfetto output path to avoid duplicating Perfetto wiring in examples.

Description

  • Add src/trace.rs with TraceOptions, TraceSink, TraceSession, init, and helper trace_file_path, and expose the module via pub mod trace;.
  • Record the Perfetto trace file path in TraceSession via a new perfetto_path field and accessor perfetto_path() so other code can postprocess the same file.
  • Change crates/luminal_cuda::record_exec_timings_to_file to accept impl AsRef<std::path::Path> and read/write using the provided path, and call it from examples/llama only when trace_session.perfetto_path() is Some.
  • Emit structured tracing around search/egglog metrics and add per-op spans for native ops (src/graph.rs and src/op.rs) so traces include these events.

Testing

  • Ran cargo fmt, which completed successfully.
  • No additional automated builds or tests were executed.

Codex Task

@jafioti jafioti merged commit f6dad3b into main Jan 1, 2026
5 checks passed
@jafioti jafioti deleted the codex/design-unified-tracing-mechanism branch January 1, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants