Skip to content

Implement get_dummy_lora_warmup_rank#702

Open
sstamenk wants to merge 1 commit into
unslothai:mainfrom
sstamenk:main
Open

Implement get_dummy_lora_warmup_rank#702
sstamenk wants to merge 1 commit into
unslothai:mainfrom
sstamenk:main

Conversation

@sstamenk

Copy link
Copy Markdown

vLLM v1's LoRAModelRunnerMixin.maybe_setup_dummy_loras calls self.lora_manager.get_dummy_lora_warmup_rank(...) during KV-cache profiling / cudagraph warmup. Unsloth replaces vLLM's LoRA manager with unsloth_zoo.vllm_lora_worker_manager.LRUCacheWorkerLoRAManager, which does not implement this method. This results in the following error:

AttributeError: 'LRUCacheWorkerLoRAManager' object has no attribute 'get_dummy_lora_warmup_rank'

get_dummy_lora_warmup_rank implementation picked up from #608

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds the get_dummy_lora_warmup_rank method to vllm_lora_worker_manager.py to support vLLM v1's dummy LoRA warmup. The review feedback recommends defensively checking for the existence of _adapter_manager before accessing it to avoid potential AttributeError exceptions due to lazy initialization.

Comment on lines +230 to +232
manager_fn = getattr(
self._adapter_manager, "get_dummy_lora_warmup_rank", None
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Directly accessing self._adapter_manager can raise an AttributeError if get_dummy_lora_warmup_rank is called before create_lora_manager has initialized it (since it is lazily initialized and only annotated in __init__). It is safer to use getattr(self, '_adapter_manager', None) to defensively guard against this.

        manager = getattr(self, "_adapter_manager", None)
        manager_fn = getattr(
            manager, "get_dummy_lora_warmup_rank", None
        ) if manager is not None else None

@sstamenk

sstamenk commented Jun 1, 2026

Copy link
Copy Markdown
Author

@danielhanchen can you take a look at this? I've picked this up from #608 in hopes of getting it merged sooner since its a genuine bug and the original PR has been open for some time. Thanks

@sstamenk

sstamenk commented Jun 9, 2026

Copy link
Copy Markdown
Author

Created an issue to track this fix unslothai/unsloth#6114

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant