Skip to content

Commit 3f70ab6

Browse files
committed
Try 5% fails
1 parent 82a97d6 commit 3f70ab6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/petals/client/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ClientConfig:
2727

2828
max_retries: Optional[int] = DEFAULT_MAX_RETRIES # max number of retries before an exception (default: inf)
2929
min_backoff: float = 1 # after a repeated failure, sleep for this many seconds times 2 ** (num_failures - 1)
30-
max_backoff: float = 60 # limit maximal sleep time between retries to this value
30+
max_backoff: float = 5 # limit maximal sleep time between retries to this value
3131
ban_timeout: float = 15 # when a remote peer fails to respond, prevent routing to that peer for this many seconds
3232
active_adapter: Optional[str] = None # name of active LoRA adapter (usually, Hugging Face repo)
3333

src/petals/client/inference_session.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ def step(
144144
)
145145
)
146146
)
147+
148+
import random
149+
if random.random() < 0.05:
150+
raise Exception("fail")
151+
147152
outputs = list(map(deserialize_torch_tensor, outputs_serialized.tensors))
148153
assert (
149154
outputs[0].shape == inputs.shape

0 commit comments

Comments
 (0)