Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port of Batch Engine code #40133

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ralph-msft
Copy link
Member

A port of the bare minimum batch engine code from the Promptflow repo. The focus was on expediency, rather than elegance and some items are still stubs or don't do much currently. A follow-up PR will integrate this new code so that it can be invoked as part of an evaluate call.

Things that still need to be done:

  • Handle errors properly for OpenAI requests
  • Handle "target" functions being passed
  • Capture token usage from OpenAI requests (though this does not currently work right now)
  • Handle logging in a cleaner way
  • Determine what tracing (if any) is needed and either implement that code or remove it entirely
  • Determine if we still need the saving to a local folder structure, whether this should be changed to save to a single file (optionally?), or remove that code outright

@Copilot Copilot bot review requested due to automatic review settings March 19, 2025 01:24
@ralph-msft ralph-msft requested a review from a team as a code owner March 19, 2025 01:24
@github-actions github-actions bot added the Evaluation Issues related to the client library for Azure AI Evaluation label Mar 19, 2025
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 ports the minimal Batch Engine functionality from the Promptflow repository into the Azure Evaluation SDK. Key changes include implementing core components for batch execution (engine, run, submitter, storage, logging, and exceptions), integration of OpenAI API injection stubs, and updating proxy and client interfaces for batch runs.

Reviewed Changes

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

File Description
legacy/_batch_engine/_run_submitter.py Introduces the RunSubmitter class that submits batch runs and integrates tracing and storage calls.
_engine.py Implements the BatchEngine that processes batch data via asynchronous tasks using semaphores and aggregates results.
_evaluate/_batch_run/init.py Updates all exports to include RunSubmitterClient and refactors import ordering.
Other files New and updated modules for configuration, status handling, logging, exceptions, and result aggregation to support the batch execution functionality.
Comments suppressed due to low confidence (1)

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/legacy/_batch_engine/_engine.py:140

  • [nitpick] The variable name 'input' shadows the built-in function 'input'. Consider renaming it (e.g. to 'record' or 'item') to improve clarity.
for input in data:

@ralph-msft ralph-msft enabled auto-merge (squash) March 19, 2025 01:31
@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

azure-ai-evaluation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Evaluation Issues related to the client library for Azure AI Evaluation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants