Skip to content

Conversation

pavel-esir
Copy link
Contributor

Ticket: CVS-168960

@pavel-esir pavel-esir marked this pull request as ready for review July 3, 2025 14:01
@pavel-esir pavel-esir added this to the 2025.3 milestone Jul 3, 2025
@pavel-esir pavel-esir requested review from Wovchena and apaniukov July 4, 2025 11:14
@Wovchena Wovchena requested a review from popovaan July 4, 2025 11:26
@pavel-esir pavel-esir requested a review from Copilot July 4, 2025 12:36
Copilot

This comment was marked as outdated.

@github-actions github-actions bot added category: continuous batching Continuous batching category: LLM LLM pipeline (stateful, static) category: sampling Sampling / Decoding algorithms category: Python API Python API for GenAI category: CPP API Changes in GenAI C++ public headers no-match-files category: structured output generation labels Jul 4, 2025
@pavel-esir pavel-esir requested a review from apaniukov July 4, 2025 14:01
@github-actions github-actions bot added the category: GHA CI based on Github actions label Jul 4, 2025
@Wovchena Wovchena requested a review from Copilot July 8, 2025 13:27
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR instruments and exposes performance metrics for structured output generation, capturing grammar compilation and initialization timings across C++ and Python layers, along with tests and CI updates.

  • Extend RawPerfMetrics and PerfMetrics to include grammar compile and compiler-init times, with new SummaryStats type.
  • Propagate timings through StructuredOutputController, Sampler, and ContinuousBatchingPipeline in C++.
  • Bind new metrics to Python, update type stubs, add a test for structured output metrics, and tweak CI to skip it in precommit.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/python_tests/test_llm_pipeline.py Added test_perf_metrics_with_structured_output test case
src/python/py_utils.cpp Handle StructuredOutputConfig in kwargs-to-AnyMap conversion
src/python/py_perf_metrics.cpp Bind and document new grammar compile/init metrics in Python
src/python/openvino_genai/py_openvino_genai.pyi Updated stub to include SummaryStats and new PerfMetrics methods
src/cpp/src/sampling/structured_output/structured_output_controller.hpp Record and expose init/compile times, added std::mutex field
src/cpp/src/sampling/structured_output/structured_output_controller.cpp Time grammar compilation and initialization
src/cpp/src/sampling/sampler.hpp Expose get_structured_output_times and clear method
src/cpp/src/sampling/sampler.cpp Implement structured-output timing getters
src/cpp/src/perf_metrics.cpp Implement calc_full_stat, bind new metrics, merge operations
src/cpp/src/generation_config.cpp Read structured_output_config from AnyMap
src/cpp/src/continuous_batching/pipeline_impl.cpp Clear and record structured-output metrics in batch pipeline
src/cpp/include/openvino/genai/perf_metrics.hpp Extend RawPerfMetrics/PerfMetrics definitions
.github/workflows/linux.yml Skip new structured-output test via -k filter
Comments suppressed due to low confidence (2)

.github/workflows/linux.yml:906

  • The -k "not test_perf_metrics_with_structured_output" filter prevents the new structured-output performance test from running in CI. Consider removing or adjusting this filter so the test executes under the appropriate job (e.g., nightly).
          python3 -m pytest -v ${{ env.SRC_DIR }}/tests/python_tests/test_llm_pipeline.py -k "not test_perf_metrics_with_structured_output"

src/cpp/src/sampling/structured_output/structured_output_controller.hpp:87

  • The code uses std::mutex but the header <mutex> is not included in this file, which will cause a compilation error. Please add #include <mutex> at the top.
    std::mutex m_mutex;

@pavel-esir pavel-esir added this pull request to the merge queue Jul 10, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Jul 10, 2025
@Wovchena
Copy link
Collaborator

There's merge conflict

@pavel-esir pavel-esir enabled auto-merge July 11, 2025 07:40
@pavel-esir
Copy link
Contributor Author

There's merge conflict

resolved

@pavel-esir pavel-esir added this pull request to the merge queue Jul 11, 2025
Merged via the queue into openvinotoolkit:master with commit 208e873 Jul 11, 2025
85 of 88 checks passed
@pavel-esir pavel-esir deleted the structured_out_perf_metrics branch July 14, 2025 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: continuous batching Continuous batching category: CPP API Changes in GenAI C++ public headers category: GHA CI based on Github actions category: LLM LLM pipeline (stateful, static) category: Python API Python API for GenAI category: sampling Sampling / Decoding algorithms category: structured output generation feature no-match-files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants