Skip to content
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

[Feature]: Support loading lora adapters from HuggingFace in runtime #6233

Closed
Jeffwan opened this issue Jul 8, 2024 · 1 comment
Closed

Comments

@Jeffwan
Copy link
Contributor

Jeffwan commented Jul 8, 2024

🚀 The feature, motivation and pitch

Background

Based on the lora documentation here, user has to specific the local lora path when they starts the engine. This introduces operation overhead and we want to improve the lora experience to the same level as base model. From the UX perspective, user should be able to pass in either remote lora models and local lora models. If it's a remote path, engine should be able to download it in runtime and then serve the request.

Workflow

Starts with lora model yard1/llama-2-7b-sql-lora-test

python -m vllm.entrypoints.openai.api_server \
    --model meta-llama/Llama-2-7b-hf \
    --enable-lora \
    --lora-modules sql-lora=yard1/llama-2-7b-sql-lora-test

Current results

image

Expected results

Lora should be downloaded and be loaded by engine.

Proposed changes

  1. implement get_lora_absolute_path. it should hide the lora location complexity, if that's relative path, it should resolve and get an absolute path. If that's remote path, it should download the artifacts via from huggingface_hub import snapshot_download and get the snapshot path.
  2. Update the workflow here
    expected_lora_modules.append(module)
    lora = self._lora_model_cls.from_local_checkpoint(
    to leverage the get_lora_absolute_path before it tries to load the local path
  3. Rename lora_local_path to lora_path to indicate it supports both local and remote path now.

Future work

Support other remote storage like S3 in future. This is not in the current scope.

Alternatives

No response

Additional context

Related issue #6231. relative path doesn't work

@Jeffwan
Copy link
Contributor Author

Jeffwan commented Jul 22, 2024

As #6234 is merged, we can close this story.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant