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

Lower payload size threshold for stream handlers #251

Merged
merged 2 commits into from
Feb 6, 2023

Conversation

borzunov
Copy link
Collaborator

@borzunov borzunov commented Feb 5, 2023

Hotfix: we add "// 2" since hivemind==1.1.5 serializes bfloat16 tensors in float32, so they take 2x more space.

@@ -108,7 +108,7 @@ async def run_remote_forward(

# call RPC on remote server
size = sum(t.element_size() * t.nelement() for t in inputs)
forward_fn = _forward_stream if size > MAX_UNARY_PAYLOAD_SIZE else _forward_unary
forward_fn = _forward_stream if size > MAX_UNARY_PAYLOAD_SIZE // 2 else _forward_unary
Copy link
Collaborator

Choose a reason for hiding this comment

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

[nit] please check how MAX_UNARY_PAYLOAD_SIZE is defined - perhaps it's best to use MAX_MESSAGE_SIZE//4?

@borzunov borzunov changed the title [experiment] Hotfix payload size check Lower payload size threshold for stream handlers Feb 6, 2023
@borzunov borzunov marked this pull request as ready for review February 6, 2023 20:49
@borzunov borzunov merged commit 4091db1 into main Feb 6, 2023
@borzunov borzunov deleted the hotfix-payload-size-check branch February 6, 2023 20:57
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