Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
text-generation-inference
Commits
5cddc055
"docs/source/vscode:/vscode.git/clone" did not exist on "311bd88a040d42619f5eccd5a3f53852ec2be3e1"
Unverified
Commit
5cddc055
authored
Apr 09, 2023
by
OlivierDehaene
Committed by
GitHub
Apr 09, 2023
Browse files
fix(rust-client): use join_all instead of select_all to hopefully fix nccl issues (#162)
parent
e63a21eb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
router/client/src/sharded_client.rs
router/client/src/sharded_client.rs
+4
-7
No files found.
router/client/src/sharded_client.rs
View file @
5cddc055
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
use
crate
::
Result
;
use
crate
::
Result
;
use
crate
::{
Batch
,
Client
,
Generation
};
use
crate
::{
Batch
,
Client
,
Generation
};
use
futures
::
future
::
join_all
;
use
futures
::
future
::
join_all
;
use
futures
::
future
::
select_all
;
use
tonic
::
transport
::
Uri
;
use
tonic
::
transport
::
Uri
;
use
tracing
::
instrument
;
use
tracing
::
instrument
;
...
@@ -60,9 +59,8 @@ impl ShardedClient {
...
@@ -60,9 +59,8 @@ impl ShardedClient {
.iter_mut
()
.iter_mut
()
.map
(|
client
|
Box
::
pin
(
client
.prefill
(
batch
.clone
())))
.map
(|
client
|
Box
::
pin
(
client
.prefill
(
batch
.clone
())))
.collect
();
.collect
();
// As soon as we receive one response, we can return as all shards will return the same
// all shards return the same message
let
(
result
,
_
,
_
)
=
select_all
(
futures
)
.await
;
join_all
(
futures
)
.await
.pop
()
.unwrap
()
result
}
}
/// Generate one token for each request in the given cached batches
/// Generate one token for each request in the given cached batches
...
@@ -79,8 +77,7 @@ impl ShardedClient {
...
@@ -79,8 +77,7 @@ impl ShardedClient {
.iter_mut
()
.iter_mut
()
.map
(|
client
|
Box
::
pin
(
client
.decode
(
batches
.clone
())))
.map
(|
client
|
Box
::
pin
(
client
.decode
(
batches
.clone
())))
.collect
();
.collect
();
// As soon as we receive one response, we can return as all shards will return the same
// all shards return the same message
let
(
result
,
_
,
_
)
=
select_all
(
futures
)
.await
;
join_all
(
futures
)
.await
.pop
()
.unwrap
()
result
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment