aiq.profiler.inference_optimization.bottleneck_analysis.simple_stack_analysis#

Advanced bottleneck analysis for a dataframe that contains: - event_type in {LLM_START, LLM_END, TOOL_START, TOOL_END, …} - llm_name - tool_name - UUID - event_timestamp (float or datetime) - other metadata…

We pair start/end events by UUID, compute operation durations, then analyze concurrency and produce a summary report.

Functions#

profile_workflow_bottlenecks(...)

Perform advanced bottleneck profiling on a workflow dataframe.

Module Contents#

profile_workflow_bottlenecks(
all_steps: list[list[aiq.data_models.intermediate_step.IntermediateStep]],
) aiq.profiler.inference_optimization.data_models.SimpleBottleneckReport#

Perform advanced bottleneck profiling on a workflow dataframe.

  1. Pair LLM_START/LLM_END and TOOL_START/TOOL_END by UUID.

  2. Compute operation durations.

  3. Analyze concurrency (max concurrent usage).

  4. Summarize as SimpleOperationStats and produce a final SimpleBottleneckReport.

Parameters#

all_steps : Intermediate Steps

Returns#

SimpleBottleneckReport

Contains detailed stats per operation and a textual summary of top bottlenecks.