Repository navigation
fix: Return the local result of a streaming serving from a distributed batched_run - #1902
Closed
georgeguimaraes wants to merge 1 commit into
Closed
georgeguimaraes wants to merge 1 commit into
georgeguimaraes wants to merge 1 commit into
Conversation
…ched_run A distributed call of a streaming serving always returned a stream of the elements of the client postprocessing result. When the postprocessing returned a map, the caller got a keyword list. A local call returns the map. Now the remote node streams the result only when the client postprocessing returns a stream. Otherwise it sends the result as one value.
Member
Author
|
I close this PR. The docs of |
Member
Author
|
sorry, this should not be opened =/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A distributed
batched_runof a streaming serving always returns a stream. The remote node enumerates the result ofclient_postprocessingand sends each element. Whenclient_postprocessingcollects the stream into a map, a local call returns the map, but a distributed call returns a stream that enumerates to a keyword list.Example: a serving uses
Nx.Serving.streaming/1because the outputs of its batches have different shapes, and itsclient_postprocessingreturns%{results: [...]}. On another node,batched_runreturns a stream of{:results, [...]}.This change streams the result only when
client_postprocessingreturns a stream or a function. Other results go to the caller as one value, as in:executemode. The behavior of:executemode does not change.The test fails on main: the caller gets a
Stream.resource/3function instead of the map.