Skip to content

[llm-d] Finalize the KPI regression testing - #159

Merged
kpouget merged 13 commits into
openshift-psap:mainfrom
kpouget:kpis2
Aug 5, 2026
Merged

[llm-d] Finalize the KPI regression testing#159
kpouget merged 13 commits into
openshift-psap:mainfrom
kpouget:kpis2

Conversation

@kpouget

@kpouget kpouget commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • KPI generation now respects include/exclude label filters.
    • S3 export can use configured output locations for CSV, KPI JSON, and analysis files, with fallback discovery when needed.
    • GuideLLM KPI outputs now track intended concurrency more clearly in performance curves and metrics.
  • Bug Fixes

    • KPI analysis now reports configuration problems clearly and fails fast instead of silently continuing.
    • 2D KPI formatting now preserves unit and help metadata more consistently.
  • Documentation

    • Added detailed guidance for KPI definition and regression analysis in plugins.

@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign ashtarkb for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates Caliper KPI filtering, analysis configuration errors, 2D KPI formatting, artifact export, orchestration, plugin contracts, and documentation. GuideLLM now tracks intended concurrency separately and uses it for six 2D KPI curves.

Changes

Caliper workflow updates

Layer / File(s) Summary
KPI label filtering
projects/caliper/cli/commands.py, projects/caliper/engine/kpi/generate.py
KPI generation forwards include and exclude label filters to parsing.
KPI analysis and plugin contracts
projects/caliper/engine/kpi/analyze.py, projects/caliper/engine/kpi/format.py, projects/caliper/tests/*, projects/mcp_gateway/postprocess/tests/*, projects/skeleton/postprocess/default/plugin.py
Analysis configuration errors now return structured failures. 2D records use axis-specific metadata. Tests and plugin integrations remove KPI catalog usage.
Configured artifact export and orchestration
projects/caliper/cli/s3_export.py, projects/caliper/orchestration/*
S3 discovery uses configured output paths. Command construction supports upload IDs and dry runs. Failure logging prefers structured errors.
KPI development documentation
docs/caliper/plugin_kpis.md
The guide covers KPI declarations, discovery, metadata, validation, formatting, testing, aggregation, and derived metrics.
Regression analysis documentation
docs/caliper/plugin_regression.md
The guide covers AnalysisConfig, baseline matching, thresholds, errors, and orchestration settings.

GuideLLM concurrency KPI updates

Layer / File(s) Summary
Intended concurrency data flow
projects/guidellm/postprocess/guidellm/parsing/models.py, projects/guidellm/postprocess/guidellm/parsing/parsers.py, projects/guidellm/tests/test_postprocess_parser.py
Benchmarks serialize intended concurrency separately from effective request concurrency. Aggregated curves expose both series.
Concurrency-based KPI curves
projects/guidellm/postprocess/guidellm/parsing/kpis.py, projects/guidellm/postprocess/guidellm/plugin.py
Six 2D KPIs use intended concurrency as integer x-axis values. The scalar input-token KPI and plugin KPI catalog are removed. Regression configuration is added.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GuideLLMParser
  participant GuideLLMBenchmark
  participant PerformanceCurves
  participant GuideLLMKPIs
  GuideLLMParser->>GuideLLMBenchmark: store effective and intended concurrency
  GuideLLMBenchmark->>PerformanceCurves: serialize intended_concurrency
  GuideLLMParser->>PerformanceCurves: aggregate both concurrency series
  PerformanceCurves->>GuideLLMKPIs: provide intended concurrency curve
  GuideLLMKPIs-->>PerformanceCurves: return validated 2D KPI values
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 61.54% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main goal of finalizing KPI regression testing, which matches the primary objectives and changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kpouget

kpouget commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

/test fournos llm_d janus cpt-xks
/var caliper.postprocess.filtering.include_labels: [version=3.5.0-ea.2]
/var caliper.postprocess.s3.export.enabled: false
/pipeline forge-replot
/clusterless
/replot.url https://mlflow.apps.psap-automation.ibm.rhperfscale.org/#/experiments/322/runs/8a13e32925dd44fda4103fe56cfc09d0?workspace=forge-llmd

@psap-forge-bot

psap-forge-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

🟢 Execution of llm_d janus cpt-xks 🟢

Execution Engine Configuration

forge:
  args:
  - janus
  - cpt-xks
  configOverrides:
    caliper.postprocess.filtering.include_labels:
    - version=3.5.0-ea.2
    caliper.postprocess.s3.export.enabled: false
    caliper.replot.url: https://mlflow.apps.psap-automation.ibm.rhperfscale.org/#/experiments/322/runs/8a13e32925dd44fda4103fe56cfc09d0?workspace=forge-llmd
  project: llm_d

Artifact Links

Test Logs

00 Replot 3 minutes, 18 seconds

🔄 01 Export-Artifacts

Post-processing Status

@psap-forge-bot

psap-forge-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown
🟢 Submission of llm_d janus cpt-xks succeeded after 5 minutes 🟢
/test fournos llm_d janus cpt-xks
/var caliper.postprocess.filtering.include_labels: [version=3.5.0-ea.2]
/var caliper.postprocess.s3.export.enabled: false
/pipeline forge-replot
/clusterless
/replot.url https://mlflow.apps.psap-automation.ibm.rhperfscale.org/#/experiments/322/runs/8a13e32925dd44fda4103fe56cfc09d0?workspace=forge-llmd

@kpouget

kpouget commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

/test fournos llm_d janus cpt-xks
/var caliper.postprocess.filtering.include_labels: [version=3.5.0-ea.2]
/var caliper.postprocess.s3.export.enabled: false
/pipeline forge-replot
/clusterless
/replot.url https://mlflow.apps.psap-automation.ibm.rhperfscale.org/#/experiments/322/runs/8a13e32925dd44fda4103fe56cfc09d0?workspace=forge-llmd

@psap-forge-bot

psap-forge-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

🟢 Execution of llm_d janus cpt-xks 🟢

Execution Engine Configuration

forge:
  args:
  - janus
  - cpt-xks
  configOverrides:
    caliper.postprocess.filtering.include_labels:
    - version=3.5.0-ea.2
    caliper.postprocess.s3.export.enabled: false
    caliper.replot.url: https://mlflow.apps.psap-automation.ibm.rhperfscale.org/#/experiments/322/runs/8a13e32925dd44fda4103fe56cfc09d0?workspace=forge-llmd
  project: llm_d

Artifact Links

Test Logs

00 Replot 3 minutes, 4 seconds

🔄 01 Export-Artifacts

Post-processing Status

@psap-forge-bot

psap-forge-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown
🟢 Submission of llm_d janus cpt-xks succeeded after 4 minutes, 38 seconds 🟢
/test fournos llm_d janus cpt-xks
/var caliper.postprocess.filtering.include_labels: [version=3.5.0-ea.2]
/var caliper.postprocess.s3.export.enabled: false
/pipeline forge-replot
/clusterless
/replot.url https://mlflow.apps.psap-automation.ibm.rhperfscale.org/#/experiments/322/runs/8a13e32925dd44fda4103fe56cfc09d0?workspace=forge-llmd

@kpouget

kpouget commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

merging this version, will test it further 👍🏻

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 14

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/caliper/plugin_kpis.md`:
- Line 165: Update the handler example’s KPI record generation around the
timestamp field so it uses the model or record timestamp, or generates the
current UTC timestamp consistent with projects/caliper/tests/stub_plugin.py,
instead of the fixed 2024-01-01T00:00:00Z value.
- Around line 385-388: Update the validation around the throughput/latency
calculation to check throughput and latency explicitly against None, allowing
throughput=0. Add a separate validation that rejects latency=0 before the
division, while preserving the existing required-value error behavior.
- Line 72: Validate that request_rates and throughputs have equal lengths before
the zip call in the curve-building logic, using the existing length-check
pattern from Lines 237-243. Raise the same type of error or validation failure
used there, and only construct the paired float values after validation
succeeds.
- Around line 314-315: Update the Schema v1 JSONL example near the throughput
record to be valid complete JSON: remove the “...” placeholder and include the
required schema_version, timestamp, labels, and source fields defined by
kpi_record.schema.json while preserving the existing KPI values.
- Around line 327-344: Update both tests to use the guide-defined request_rate
function instead of the undefined throughput_kpi symbol, and align the
missing-data pytest.raises match with request_rate’s actual error message.
- Around line 188-190: Update the exception handling around the KPI conversion
logic to catch only the expected missing-metrics exception, rather than broad
Exception. Preserve graceful handling for absent data, but log a warning or
re-raise conversion errors and programming defects so KPI failures are visible.

In `@docs/caliper/plugin_regression.md`:
- Around line 33-36: Update the comparison_keys section in plugin_regression.md
to reflect the implemented AnalysisConfig behavior: document that the field is
optional and defaults to an empty list when omitted, rather than marking it
required or promising validation the implementation does not perform.
- Around line 212-214: Correct the “higher is better” condition in the Threshold
Comparison section so it documents regression when relative_change is less than
the negative max_relative_regression threshold, while preserving the existing
lower-is-better condition.

In `@projects/caliper/cli/s3_export.py`:
- Around line 101-103: Validate that each enabled producer has a non-empty
configured output before joining paths: in projects/caliper/cli/s3_export.py
lines 101-103 for the CSV producer, lines 133-135 for the KPI JSON producer, and
lines 165-167 for the analysis producer. Reject missing values or apply an
explicit fallback before constructing csv_file_path, kpi_file_path, or
analysis_file_path.
- Around line 703-710: Update the upload-plan construction near the upload_files
handling to classify each discovered file by membership in kpi_json_files,
csv_files, or analysis_files, rather than matching legacy filename patterns.
Ensure configured KPI and analysis outputs are assigned their corresponding
upload keys and included in upload_plan, preserving the existing handling for
CSV and other files.

In `@projects/caliper/engine/kpi/analyze.py`:
- Around line 90-101: Update the analysis-config handling around AnalysisConfig
construction to validate both dictionary-created and existing AnalysisConfig
instances before returning. Validate list fields and their string elements,
ensure max_relative_regression is numeric, and require min_baseline_points to be
at least 1; route every invalid value through the existing structured
configuration-error path, preserving valid configurations.

In `@projects/caliper/engine/kpi/generate.py`:
- Around line 22-23: Update the include_label_filter and exclude_label_filter
annotations in the relevant function signature to use list[dict[str, str]] |
None, matching the structure returned by _parse_label_filters and forwarded by
the CLI.

In `@projects/guidellm/postprocess/guidellm/parsing/parsers.py`:
- Around line 489-490: Update the aggregation flow in the parser method that
currently sorts benchmarks by request_rate so benchmarks are ordered by
intended_concurrency before populating request_concurrency and
intended_concurrency curves. Preserve the existing curve-building behavior, and
add a test covering benchmarks whose request-rate order differs from their
intended-concurrency order, verifying the emitted KPI points follow
intended-concurrency order.
- Around line 346-347: Update the parser’s concurrency assignments to use the
configured streams value for both request_concurrency and intended_concurrency,
removing the effective-concurrency label/comment. Preserve the existing integer
conversion and avoid treating request_concurrency as an observed effective
metric until GuideLLM provides one.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 61c1caea-ce41-4e8b-a87a-c1c94462abcd

📥 Commits

Reviewing files that changed from the base of the PR and between 92ed5dd and 174c77d.

📒 Files selected for processing (22)
  • docs/caliper/plugin_kpis.md
  • docs/caliper/plugin_regression.md
  • projects/caliper/cli/commands.py
  • projects/caliper/cli/s3_export.py
  • projects/caliper/engine/kpi/analyze.py
  • projects/caliper/engine/kpi/catalog.py
  • projects/caliper/engine/kpi/format.py
  • projects/caliper/engine/kpi/generate.py
  • projects/caliper/engine/model.py
  • projects/caliper/orchestration/cli_builder.py
  • projects/caliper/orchestration/postprocess.py
  • projects/caliper/tests/stub_plugin.py
  • projects/caliper/tests/test_kpi_analyze.py
  • projects/guidellm/postprocess/guidellm/parsing/kpis.py
  • projects/guidellm/postprocess/guidellm/parsing/models.py
  • projects/guidellm/postprocess/guidellm/parsing/parsers.py
  • projects/guidellm/postprocess/guidellm/plugin.py
  • projects/guidellm/tests/test_postprocess_parser.py
  • projects/mcp_gateway/postprocess/mcp_gateway/plugin.py
  • projects/mcp_gateway/postprocess/tests/test_mcp_gateway_plugin.py
  • projects/rhaiis/postprocess/plugin.py
  • projects/skeleton/postprocess/default/plugin.py
💤 Files with no reviewable changes (6)
  • projects/caliper/engine/kpi/catalog.py
  • projects/caliper/engine/model.py
  • projects/rhaiis/postprocess/plugin.py
  • projects/mcp_gateway/postprocess/mcp_gateway/plugin.py
  • projects/mcp_gateway/postprocess/tests/test_mcp_gateway_plugin.py
  • projects/skeleton/postprocess/default/plugin.py

Comment thread docs/caliper/plugin_kpis.md
Comment thread docs/caliper/plugin_kpis.md
Comment thread docs/caliper/plugin_kpis.md
Comment thread docs/caliper/plugin_kpis.md
Comment thread docs/caliper/plugin_kpis.md
Comment thread projects/caliper/cli/s3_export.py
Comment thread projects/caliper/engine/kpi/analyze.py
Comment thread projects/caliper/engine/kpi/generate.py
Comment thread projects/guidellm/postprocess/guidellm/parsing/parsers.py
Comment thread projects/guidellm/postprocess/guidellm/parsing/parsers.py
@kpouget
kpouget merged commit 93bb296 into openshift-psap:main Aug 5, 2026
5 of 6 checks passed
@kpouget
kpouget deleted the kpis2 branch August 5, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant