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

Require TaskPoolBase to implement load_batch_to_runtime #506

Merged
merged 6 commits into from
Sep 7, 2022

Conversation

justheuristic
Copy link
Member

@justheuristic justheuristic commented Sep 7, 2022

The TaskPoolBase interface currently requires iterate_minibatches to be implemented. However, this method is not called by anything except TaskPool (internally). Runtime actually calls load_batch_to_runtime. This PR changes the interface to reflect that.

While we're at it, i've also changed prefetch generator so that it actually does not prefetch batches when prefetch_batches = 0
Previously, 0 would silently mean "unlimited",

@justheuristic justheuristic requested a review from mryab September 7, 2022 00:29
@codecov
Copy link

codecov bot commented Sep 7, 2022

Codecov Report

Merging #506 (1ae4fd2) into master (b02bdad) will decrease coverage by 0.19%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #506      +/-   ##
==========================================
- Coverage   86.28%   86.09%   -0.20%     
==========================================
  Files          81       81              
  Lines        7884     7887       +3     
==========================================
- Hits         6803     6790      -13     
- Misses       1081     1097      +16     
Impacted Files Coverage Δ
hivemind/moe/server/runtime.py 75.00% <100.00%> (+0.64%) ⬆️
hivemind/moe/server/task_pool.py 41.33% <100.00%> (ø)
hivemind/averaging/matchmaking.py 83.88% <0.00%> (-3.59%) ⬇️
hivemind/averaging/averager.py 88.27% <0.00%> (-1.20%) ⬇️
hivemind/utils/asyncio.py 99.21% <0.00%> (-0.79%) ⬇️
hivemind/utils/mpfuture.py 95.02% <0.00%> (+0.90%) ⬆️

@justheuristic justheuristic merged commit 41587e4 into master Sep 7, 2022
@justheuristic justheuristic deleted the justheuristic-patch-2 branch September 7, 2022 14:17
mryab pushed a commit that referenced this pull request Sep 13, 2022
The TaskPoolBase interface currently requires iterate_minibatches to be implemented. However, this method is not called by anything except TaskPool (internally). Runtime actually calls load_batch_to_runtime. This PR changes the interface to reflect that.

While we're at it, i've also changed prefetch generator so that it actually does not prefetch batches when prefetch_batches = 0. Previously, 0 would silently mean "unlimited",

Co-authored-by: Max Ryabinin <[email protected]>
(cherry picked from commit 41587e4)
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