Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Benchmark Fix : Fix JSON decode error #142

Merged
merged 6 commits into from
Mar 26, 2024

Conversation

varun-sundar-rabindranath
Copy link

@varun-sundar-rabindranath varun-sundar-rabindranath commented Mar 22, 2024

Summary:

Bug : In benchmark_serving.py we use aiohttp's iter_any() function for reading responses from the server.
Sometimes, the data received from this function contains more than one JSON in it. This leads to a JSON decode error.

Fix : These JSONs essentially contain the generated text and the last of the JSONs has the entire generated text. The
fix is to identify the last JSON in the response data. The response data simply puts the JSONs next to each other. We identify occurrences of the string {"text": in the body and use the JSON decoder to identify the last JSON.

Test:
Manual testing

raise ValueError(f"Cannot decode json body \n {body}")

@staticmethod
async def async_request_vllm(

Choose a reason for hiding this comment

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

no functional change this function except storing the response directly in the RequestFuncOutput

@varun-sundar-rabindranath varun-sundar-rabindranath merged commit 045352b into main Mar 26, 2024
2 checks passed
@varun-sundar-rabindranath varun-sundar-rabindranath deleted the varun/fix-json-decode-error branch March 26, 2024 18:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants