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

Add remove adapters for LLMpipeline #1852

Open
wants to merge 49 commits into
base: master
Choose a base branch
from

Conversation

wenyi5608
Copy link
Contributor

@wenyi5608 wenyi5608 commented Mar 6, 2025

tickets: CVS-160984

@github-actions github-actions bot added category: continuous batching Continuous batching category: LLM LLM pipeline (stateful, static) category: speculative decoding Speculative decoding category: LoRA Low rank adapters category: GenAI C++ API Changes in GenAI C++ public headers no-match-files category: prompt lookup labels Mar 6, 2025
@ilya-lavrenov ilya-lavrenov requested review from Wovchena and removed request for Wovchena March 6, 2025 07:19
@wenyi5608
Copy link
Contributor Author

Will using mmap for adapter content be helpful in your use case and eliminate the need for remove_adapters?

I had used mmap for adapter content and eliminate 'romove_adapters'. The user need to encrypt the lora adapter, so I added new API to read the lora adapter from the buffer.

Comment on lines 142 to 137
"Tensor shape ", ov::shape_size(shape), " for tensor \"", name, "\" from Safetensors file \"", filename, "\" doesn't match the expected tensor size ",
"Tensor shape ", ov::shape_size(shape), " for tensor \"", name, "\" from Safetensors file \"", "safetensor", "\" doesn't match the expected tensor size ",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't lose a better diagnostics for a file due to the code unification. Most users will still use adapters from files, so this message becomes less useful for them.

}

// Reads a safetensor and creates a constantmap from the memory.
ConstantMap read_safetensors(const ov::Tensor& safetensor) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this function? It it whole duplication of safetensors_init(safetensor). We can move second one to public section in this case

@ilya-lavrenov ilya-lavrenov added this to the 2025.2 milestone Mar 17, 2025
@github-actions github-actions bot added the category: Python API Python API for GenAI label Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: GenAI C++ API Changes in GenAI C++ public headers category: LLM LLM pipeline (stateful, static) category: LoRA Low rank adapters category: prompt lookup category: Python API Python API for GenAI category: speculative decoding Speculative decoding no-match-files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants