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

Inference Benchmark: Catch AML error response #869

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions benchmarks/inference/mii/run_aml.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0

# DeepSpeed Team

# Run benchmark against AML endpoint
python ./run_benchmark.py \
--model <model name> \
--deployment_name <aml deployment name> \
--aml_api_url <aml endpoint URL> \
--aml_api_key <aml API key> \
--mean_prompt_length 2600 \
--mean_max_new_tokens 60 \
--num_requests 256 \
--backend aml

### Gernerate the plots
python ./src/plot_th_lat.py
lekurile marked this conversation as resolved.
Show resolved Hide resolved

echo "Find figures in ./plots/ and log outputs in ./results/"
6 changes: 5 additions & 1 deletion benchmarks/inference/mii/src/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ def get_response(response: requests.Response) -> List[str]:
token_gen_time = []
start_time = time.time()
response = requests.post(args.aml_api_url, headers=headers, json=pload)
output = get_response(response)
# Sometimes the AML endpoint will return an error, so we send the request again
try:
output = get_response(response)
except Exception as e:
return call_aml(input_tokens, max_new_tokens, args)

return ResponseDetails(
generated_tokens=output,
Expand Down
Loading