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

[DRAFT] update evaluate to be concurrent #1340

Closed
wants to merge 3 commits into from
Closed

Conversation

isahers1
Copy link
Contributor

No description provided.

Comment on lines 668 to 669
if not hasattr(self, '_evaluator_executor'):
self._evaluator_executor = cf.ThreadPoolExecutor(max_workers=4)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't like doing this, but I couldn't figure out another way to pass an executor that doesn't trigger a raise RuntimeError('cannot schedule new futures after shutdown') from _log_evaluation_feedback. I also don't think I ever delete this executor, but I am not 100% sure where to do so

Comment on lines -847 to -850
if example.attachments is not None:
for attachment in example.attachments:
reader = example.attachments[attachment]["reader"]
reader.seek(0)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This no longer works because the evaluators run in parallel. I do not know the ideal solution to this, am open to any and all ideas.

@@ -796,15 +855,17 @@ async def _arun_evaluators(
run = current_results["run"]
example = current_results["example"]
eval_results = current_results["evaluation_results"]
for evaluator in evaluators:
lock = asyncio.Lock()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it's necessary, can remove if wanted

Copy link
Contributor

Choose a reason for hiding this comment

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

if not necessary remove -- is this used only for .extend()? (I believe .extend is atomic)

https://docs.python.org/3/faq/library.html#what-kinds-of-global-value-mutation-are-thread-safe

Comment on lines +496 to +498
manager = await manager.awith_predictions_and_evaluators(
cast(ATARGET_T, target), evaluators, max_concurrency=max_concurrency
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

summary evaluators are still evaluated after all the predictions and evaluations have been made, can change in the future but I think much less of a bottle neck.

@isahers1 isahers1 closed this Dec 19, 2024
@isahers1 isahers1 deleted the isaac/aevaluatechanges branch December 19, 2024 02:47
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.

2 participants