-
-
Notifications
You must be signed in to change notification settings - Fork 11k
[Model][0/N] Improve all pooling task | clean up #25817
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
+197
−188
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
dadd678
+ embedding_size
noooop f2530f5
+ VLLM_CI_ENFORCE_EAGER
noooop c39c160
ner.py -> ner_client.py
noooop b3b88e8
fix gpt2 seq cls & add test_head_dtype.py
noooop ff477af
clean GritLM
noooop 67b4255
fix skip_global_cleanup
noooop 14116f4
fix
noooop 4d2078c
Merge branch 'main' into embed_e2e
noooop 1df48d3
conflicts
noooop 8e6b764
Merge branch 'main' into embed_e2e
noooop 5226617
add back
noooop d565b28
Merge branch 'main' into embed_e2e
noooop 047cf56
fix test_splade_pooler
noooop 4f0021b
- test_bert_splade_sparse_embed_smoke
noooop 2f75506
Merge branch 'main' into embed_e2e
noooop 4ca1f43
fix
noooop 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
File renamed without changes.
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
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
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
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 |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # SPDX-FileCopyrightText: Copyright contributors to the vLLM project | ||
| import pytest | ||
| import torch | ||
| from transformers import AutoModelForSequenceClassification | ||
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| "model", | ||
| ["nie3e/sentiment-polish-gpt2-small"], | ||
| ) | ||
| @pytest.mark.parametrize("dtype", ["half"]) | ||
| def test_classify_models( | ||
| hf_runner, | ||
| vllm_runner, | ||
| example_prompts, | ||
| model: str, | ||
| dtype: str, | ||
| ) -> None: | ||
| with hf_runner( | ||
| model, dtype=dtype, auto_cls=AutoModelForSequenceClassification | ||
| ) as hf_model: | ||
| hf_outputs = hf_model.classify(example_prompts) | ||
|
|
||
| for head_dtype_str in ["float32", "model"]: | ||
| with vllm_runner( | ||
| model, | ||
| max_model_len=512, | ||
| dtype=dtype, | ||
| hf_overrides={"head_dtype": head_dtype_str}, | ||
| ) as vllm_model: | ||
| model_config = vllm_model.llm.llm_engine.model_config | ||
| model_dtype = model_config.dtype | ||
| head_dtype = model_config.head_dtype | ||
|
|
||
| if head_dtype_str == "float32": | ||
| assert head_dtype == torch.float32 | ||
| elif head_dtype_str == "model": | ||
| assert head_dtype == model_dtype | ||
|
|
||
| vllm_outputs = vllm_model.classify(example_prompts) | ||
|
|
||
| for hf_output, vllm_output in zip(hf_outputs, vllm_outputs): | ||
| hf_output = torch.tensor(hf_output).float() | ||
| vllm_output = torch.tensor(vllm_output).float() | ||
|
|
||
| assert torch.allclose(hf_output, vllm_output, atol=1e-2) |
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
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.
Uh oh!
There was an error while loading. Please reload this page.