-
Notifications
You must be signed in to change notification settings - Fork 26
🐛 fix a bug in tests, add DISABLE_ASSERTS #375
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
eeb87f0
🧪 add failing test for batch requests
prashantgupta24 867fce5
🐛 fix bug
prashantgupta24 d689080
🐛 fix failing condition
prashantgupta24 5002ca9
🎨 add DISABLE_ASSERTS
prashantgupta24 3f3bcb6
🎨 fmt
prashantgupta24 a7776a2
⏪ revert to main
prashantgupta24 1563359
Merge remote-tracking branch 'upstream/main' into cb-batch-failing
prashantgupta24 15d1388
🚧 some scheduler tests
prashantgupta24 91b6b86
🔥 keep only tp 4
prashantgupta24 ab4d822
🎨 fmt
prashantgupta24 cf14702
🔥 remove staggered tests
prashantgupta24 f79aee6
⏪ revert DISABLE_ASSERTS to False
prashantgupta24 01fe49d
🎨 change comment
prashantgupta24 b72f54e
Merge branch 'main' into cb-batch-failing
prashantgupta24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,18 @@ | |
| from spyre_util import get_spyre_backend_list, get_spyre_model_list | ||
|
|
||
|
|
||
| def _check_result(client, model, max_tokens=8, temperature=0.0, n=1) -> None: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🌶️ ! |
||
| completion = client.completions.create( | ||
| model=model, | ||
| prompt="Hello World!", | ||
| max_tokens=max_tokens, | ||
| temperature=temperature, | ||
| n=n, | ||
| ) | ||
| assert len(completion.choices) == n | ||
| assert len(completion.choices[0].text) > 0 | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("model", get_spyre_model_list()) | ||
| @pytest.mark.parametrize( | ||
| "tp_size", | ||
|
|
@@ -40,20 +52,9 @@ def test_openai_serving( | |
| """Test online serving using the `vllm serve` CLI""" | ||
|
|
||
| client = remote_openai_server.get_client() | ||
| completion = client.completions.create(model=model, | ||
| prompt="Hello World!", | ||
| max_tokens=5, | ||
| temperature=0.0) | ||
| assert len(completion.choices) == 1 | ||
| assert len(completion.choices[0].text) > 0 | ||
|
|
||
| completion = client.completions.create(model=model, | ||
| prompt="Hello World!", | ||
| max_tokens=5, | ||
| temperature=1.0, | ||
| n=2) | ||
| assert len(completion.choices) == 2 | ||
| assert len(completion.choices[0].text) > 0 | ||
| _check_result(client, model, n=1) | ||
| _check_result(client, model, temperature=1.0, n=2) | ||
|
|
||
| # rest are SB tests | ||
| if cb: | ||
|
|
@@ -73,8 +74,8 @@ def test_openai_serving( | |
| # Short prompt under context length but requesting too many tokens for | ||
| # the warmup shape should return an empty result | ||
| try: | ||
| completion = client.completions.create(model=model, | ||
| prompt="Hello World!", | ||
| max_tokens=25) | ||
| client.completions.create(model=model, | ||
| prompt="Hello World!", | ||
| max_tokens=25) | ||
| except openai.BadRequestError as e: | ||
| assert "warmup" in str(e) | ||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
found a 🐛 !