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

Batch evaluation intervals into a single request and a single evaluation process #554

Merged
merged 25 commits into from
Jul 3, 2024

Conversation

XianzheMa
Copy link
Collaborator

@XianzheMa XianzheMa commented Jun 30, 2024

Per the title, this PR enables batching evaluations on many intervals into a single evaluation request. This resolves #536. The integration test is adjusted to cover this new functionality.

How to review

The best way to review is to first take a look at modyn/protos/evaluator.proto to see on the API level what is changed.

Miscellaneous

After this PR, batching is only enabled on server side, on client side still one interval is passed at a time, as I am confused on the current way to generate EvalRequest.

After this PR, @robinholzi could you make a PR to collect the intervals associated with the same id_model and dataset_id, and pack them in one evaluation round? I think just looking at the function _single_batched_evaluation in this file modyn/supervisor/internal/pipeline_executor/evaluation_executor.py should be enough to understand the change / how to make that PR. It should be a very easy and straightforward PR. I am just confused with the data models there. Thank you so much!

Copy link

Line Coverage: -% ( % to main)
Branch Coverage: -% ( % to main)

Copy link

codecov bot commented Jun 30, 2024

Codecov Report

Attention: Patch coverage is 93.79845% with 8 lines in your changes missing coverage. Please review.

Project coverage is 82.63%. Comparing base (a4f167a) to head (d043e5d).

Files Patch % Lines
modyn/evaluator/internal/pytorch_evaluator.py 90.00% 4 Missing ⚠️
.../internal/pipeline_executor/evaluation_executor.py 92.30% 2 Missing ⚠️
modyn/supervisor/internal/grpc_handler.py 96.66% 1 Missing ⚠️
...or/internal/pipeline_executor/pipeline_executor.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #554      +/-   ##
==========================================
- Coverage   82.98%   82.63%   -0.35%     
==========================================
  Files         221      218       -3     
  Lines       10342    10235     -107     
==========================================
- Hits         8582     8458     -124     
- Misses       1760     1777      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@XianzheMa XianzheMa changed the title Batch evaluation requests Batch evaluation intervals into a single request and a single evaluation process Jun 30, 2024
@XianzheMa XianzheMa marked this pull request as ready for review June 30, 2024 21:06
@MaxiBoether
Copy link
Contributor

Thank you so much! I will go through this tomorrow and also ping @robinholzi to review this since it affects his evaluation stuff

Copy link
Collaborator

@robinholzi robinholzi left a comment

Choose a reason for hiding this comment

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

Thanks so much @XianzheMa for putting some thought into the evaluator side of the evaluation logic! I can surely adjust the batching in supervisor to comply with the new interface! Just a couple of questions before we finalise the grpc interface changes

@MaxiBoether
Copy link
Contributor

Sorry, now I understand your comment. This changes the server interface to support batching but the client does not yet send batched requests :D Now I get it, sorry

Copy link
Contributor

@MaxiBoether MaxiBoether left a comment

Choose a reason for hiding this comment

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

Thank you so much Xianzhe! I hope the changes are not too much work. We can chat with Robin about the status queue thingy, but I think we need a way of e.g. transferring exceptions to the supervisor because we should have those in the logs (I've used them before for debugging, helpful to have it in a single place). I think there are some minor issues in the interface where we need to adjust the evaluation started request, but the overall flow looks nice!

modyn/protos/evaluator.proto Outdated Show resolved Hide resolved
modyn/protos/evaluator.proto Outdated Show resolved Hide resolved
@XianzheMa
Copy link
Collaborator Author

The integration test definitely passed on our server. Will check tomorrow why

@MaxiBoether
Copy link
Contributor

The integration test definitely passed on our server. Will check tomorrow why

I think there probably is some flakyness somewhere. Sorry, I am too tired to review this properly tonight, I will do it tomorrow morning as well. But I don't think it's because of release/debug/... mode, I think this is rather some concurrency issue somewhere

Copy link
Contributor

@MaxiBoether MaxiBoether left a comment

Choose a reason for hiding this comment

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

Thank you! My only big comment besides nitpicky stuff is on the interval_idx. I think we should switch to using the interval boundaries cause looking at the supervisor, it would simplify the logic for the follow up PR if we directly have the interval bounds instead of some idx. I did not immediately find the reason for the integrationtest failure, though :(

XianzheMa and others added 3 commits July 3, 2024 09:49
Co-authored-by: Maximilian Böther <2116466+MaxiBoether@users.noreply.github.com>
@XianzheMa XianzheMa requested a review from MaxiBoether July 3, 2024 09:29
@XianzheMa
Copy link
Collaborator Author

The integration test definitely passed on our server. Will check tomorrow why

I think there probably is some flakyness somewhere. Sorry, I am too tired to review this properly tonight, I will do it tomorrow morning as well. But I don't think it's because of release/debug/... mode, I think this is rather some concurrency issue somewhere

everything should be fixed now. Let's see

Copy link
Contributor

@MaxiBoether MaxiBoether left a comment

Choose a reason for hiding this comment

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

LGTM! Let's wait for @robinholzi's review (and clarification regarding the docstring) and the integration tests, but I do not have further comments. Thank you so much!

@XianzheMa XianzheMa merged commit b6284f8 into main Jul 3, 2024
18 checks passed
@XianzheMa
Copy link
Collaborator Author

The last commit only involves a comment, and before the commit the CI passed. So I just merged without waiting more.

@XianzheMa XianzheMa deleted the XianzheMa/feature/batch-eval-req branch July 3, 2024 12:10
@XianzheMa XianzheMa restored the XianzheMa/feature/batch-eval-req branch July 4, 2024 08:43
@XianzheMa XianzheMa deleted the XianzheMa/feature/batch-eval-req branch July 7, 2024 06:03
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.

Speeding up evaluations
3 participants