Added parallel processing for metric evaluations + Progress Bar (Error handling done properly) #107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Template
Description
This pull request introduces parallel evaluation support for running multiple evaluations simultaneously for metric_list . By using max_workers and max_evaluations_per_thread parameters, we distribute metric evaluations across multiple threads, enabling concurrent processing. For example, when evaluating 5 metrics with max_workers=2, the system splits the work into smaller chunks (2-2-1), allowing two workers to process metrics simultaneously. This parallelization reduces the total evaluation time, especially for large metric sets. If we process 100 metrics, instead of evaluating them sequentially (which could take 100 units of time), parallel processing with 2 workers could theoretically complete in roughly 50 units of time, providing a significant performance boost. The max_evaluations_per_thread parameter further optimizes this by controlling the workload per thread, preventing any single thread from becoming a bottleneck.
Related Issue
1.4. Add Batch Evaluation Support
Type of Change
Please delete options that are not relevant.
How Has This Been Tested?
Evaluation Tests Documentation
This document outlines the details of the evaluation tests implemented to ensure proper functionality and robustness.
Test Descriptions
test_evaluation_initialization
: Verifies Proper Setuptest_chunk_metrics
: Tests Metric Chunkingtest_evaluate_empty_metric_list
: Validates Empty List HandlingValueError
when attempting to evaluate an empty list of metrics.test_evaluate_with_invalid_metric
: Tests Invalid Metric Handlingtest_evaluate_with_valid_metrics
: Tests Valid Metric Evaluationgoal_decomposition_efficiency
,goal_fulfillment_rate
) are properly evaluated.test_get_results
: Verifies Result Retrievaltest_get_trace_data_invalid_id
: Tests Invalid Trace ID Handlingtest_parallel_processing_configuration
: Tests Parallel ProcessingChecklist:
Additional Context
Progess Bar
Parallel Processing
Impact on Roadmap
Optimizes performance
Prevents system crashes