Skip to content

Implementation of Positional Interpolation (PI) Feature #690

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

Closed
wants to merge 8 commits into from

Conversation

andy-yang-1
Copy link

This Pull Request aims to introduce the Positional Interpolation (PI) feature to the vllm library. Positional Interpolation is a novel encoding technique that enhances the effects of Rotary Position Encoding (RoPE) by providing more precise positional information. The code now supports long-context models.

Try with:

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="lmsys/vicuna-7b-v1.5-16k")
# 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}")

@zhuohan123
Copy link
Member

@andy-yang-1 Does this PR have overlaps with #555? Can you take a look at that as well?

@andy-yang-1
Copy link
Author

@zhuohan123 Yes, it overlaps with #555

@WoosukKwon
Copy link
Collaborator

HI @andy-yang-1, we recently merged #555. This feature is now supported. Thanks for the contribution!

@WoosukKwon WoosukKwon closed this Sep 28, 2023
kzawora-intel pushed a commit to kzawora-intel/vllm-fork that referenced this pull request Jan 20, 2025
1. This PR updates habana_main README_GAUDI to the Technical Writer
reviewed version as seen in v1.19.0.
(habana_main README_GAUDI and v1.19.0 README_GAUDI had diverged. )
2. It also fixes broken urls due to recent restructuring in upstream
vllm examples folder.
3. Adds notes in examples folder for new users and redirects them to see
the Gaudi specific examples in README_GAUDI.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-model Requests to new models
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants