-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[Core] Logprobs support in Multi-step #7652
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
simon-mo
merged 49 commits into
vllm-project:main
from
neuralmagic:afeldman-nm/logprobs
Aug 30, 2024
Merged
Changes from 10 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
f97e0ae
added example
afeldman-nm f969241
wip:
afeldman-nm 642d31b
first working attempt at logprobs
afeldman-nm a0ca262
merge; format
afeldman-nm ed97288
passing test; dataclass
afeldman-nm 861e1b9
refactoring
afeldman-nm 8bc0765
Merge branch 'main' into logprobs_merge
afeldman-nm a34d1ac
refactoring
afeldman-nm 4cda5c0
Merge branch 'logprobs' into logprobs_merge
afeldman-nm ac8a39a
Merge branch 'main' into logprobs_merge
afeldman-nm 1284327
removing example
afeldman-nm a6c1207
removed example from build pipeline
afeldman-nm fe42995
fixed one docstring; embedded NUM_LOGPROBS
afeldman-nm 9fb5bbe
test refactor
afeldman-nm 046a8b1
incremental refactors
afeldman-nm fa86efd
remove unnecessary conftest change
afeldman-nm 1c0ffb6
Update vllm/model_executor/layers/sampler.py
afeldman-nm 3babadb
refactor
afeldman-nm f502029
Merge branch 'afeldman-nm/logprobs' of https://github.com/neuralmagic…
afeldman-nm 1875b37
test_multi_step comment
afeldman-nm 3760a95
utils function docstrings
afeldman-nm d43308c
docstring refactors
afeldman-nm 54db498
merge
afeldman-nm dfbbaf0
passing tests & formatted
afeldman-nm 5eebfca
Merge branch 'main' into logprobs_merge
afeldman-nm 5e23d9a
Merge branch 'main' into logprobs_merge
afeldman-nm 717efa3
merge; format
afeldman-nm e0d59ce
removed incorrect SamplerOutput imports
afeldman-nm 102fd92
formatting
afeldman-nm 948f4ef
Update tests/multi_step/test_correctness.py
afeldman-nm 6e6711f
fixed comment
afeldman-nm f61163e
merge; format
afeldman-nm 1cc93dd
rename
afeldman-nm 4995204
Merge branch 'logprobs' into logprobs_merge
afeldman-nm da5826b
test modification
afeldman-nm d4fb430
merge; format
afeldman-nm b6752e0
merge
afeldman-nm 1e42656
formatting
afeldman-nm cd0fdf9
disabled logprobs pythonization when logprobs are disabled
afeldman-nm 3fecbc4
wip
afeldman-nm 67bd035
skip logprobs processing entirely when logprobs are not enabled; form…
afeldman-nm 419659d
multi-step output processing; formatting
afeldman-nm 55eaab9
wip
afeldman-nm bae1fb9
small fixes
afeldman-nm fbb75b7
reverting to no prompt-logprobs support; merged in main
afeldman-nm 63c5582
timeout increase
afeldman-nm 8191571
refactoring
afeldman-nm 9a708f8
Merge branch 'main' into logprobs_no_prompt
afeldman-nm e54606d
upstream merge
afeldman-nm 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 |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| ''' | ||
| Example of setting up LLM with multi-step enabled. | ||
| In actuality, async engine would be a more sensible choice | ||
| from a performance perspective. However this example is useful | ||
| for demonstration & debugging of multi-step code. | ||
| ''' | ||
|
|
||
| from vllm import LLM, SamplingParams | ||
|
|
||
| # Sample prompts. | ||
| prompts = [ | ||
| "Hello, my name is", | ||
| "The president of the United States is", | ||
| "The capital of France is", | ||
| "The future of AI is", | ||
| ] | ||
| # Create a sampling params object. | ||
| sampling_params = SamplingParams(temperature=0.8, top_p=0.95) | ||
|
|
||
| # Create an LLM. | ||
| llm = LLM(model="JackFram/llama-160m", | ||
| swap_space=16, | ||
| tensor_parallel_size=1, | ||
| gpu_memory_utilization=0.9, | ||
| num_scheduler_steps=8, | ||
| use_v2_block_manager=True, | ||
| enforce_eager=True) | ||
| # Generate texts from the prompts. The output is a list of RequestOutput objects | ||
| # that contain the prompt, generated text, and other information. | ||
| outputs = llm.generate(prompts, sampling_params) | ||
| # Print the outputs. | ||
| for output in outputs: | ||
| prompt = output.prompt | ||
| generated_text = output.outputs[0].text | ||
| print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}") |
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
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
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.