-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
[Misc] Remove qlora_adapter_name_or_path #17699
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
Changes from 5 commits
8d33530
5e7ec08
77e2a28
20a4683
f934ce8
8b69068
c2b467a
c592156
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
| import json | ||
| import re | ||
| import threading | ||
| import warnings | ||
| from dataclasses import MISSING, dataclass, fields | ||
| from itertools import permutations | ||
| from typing import (Any, Callable, Dict, List, Literal, Optional, Type, | ||
|
|
@@ -394,7 +395,13 @@ def __post_init__(self): | |
| if isinstance(self.compilation_config, (int, dict)): | ||
| self.compilation_config = CompilationConfig.from_cli( | ||
| str(self.compilation_config)) | ||
|
|
||
| if self.qlora_adapter_name_or_path is not None: | ||
| warnings.warn( | ||
| "The `qlora_adapter_name_or_path` is deprecated " | ||
| "and will be removed in v0.10.0. ", | ||
DarkLight1337 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| DeprecationWarning, | ||
| stacklevel=2, | ||
| ) | ||
| # Setup plugins | ||
| from vllm.plugins import load_general_plugins | ||
| load_general_plugins() | ||
|
|
@@ -504,10 +511,13 @@ def add_cli_args(parser: FlexibleArgumentParser) -> FlexibleArgumentParser: | |
| **load_kwargs["ignore_patterns"]) | ||
| load_group.add_argument("--use-tqdm-on-load", | ||
| **load_kwargs["use_tqdm_on_load"]) | ||
| load_group.add_argument('--qlora-adapter-name-or-path', | ||
| type=str, | ||
| default=None, | ||
| help='Name or path of the QLoRA adapter.') | ||
| load_group.add_argument( | ||
| "--qlora-adapter-name-or-path", | ||
| type=str, | ||
| default=None, | ||
| help="The `--qlora-adapter-name-or-path` has no effect, do not set" | ||
| " it, and it will be removed in v0.10.0.", | ||
| ) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could also add
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
| load_group.add_argument('--pt-load-map-location', | ||
| **load_kwargs["pt_load_map_location"]) | ||
|
|
||
|
|
@@ -533,7 +543,7 @@ def add_cli_args(parser: FlexibleArgumentParser) -> FlexibleArgumentParser: | |
| action=argparse.BooleanOptionalAction, | ||
| help="[DEPRECATED] The `--enable-reasoning` flag is deprecated as " | ||
| "of v0.8.6. Use `--reasoning-parser` to specify the reasoning " | ||
| "parser backend insteadThis flag (`--enable-reasoning`) will be " | ||
| "parser backend instead. This flag (`--enable-reasoning`) will be " | ||
| "removed in v0.10.0. When `--reasoning-parser` is specified, " | ||
| "reasoning mode is automatically enabled.") | ||
| guided_decoding_group.add_argument( | ||
|
|
@@ -895,12 +905,6 @@ def create_model_config(self) -> ModelConfig: | |
|
|
||
| def create_load_config(self) -> LoadConfig: | ||
|
|
||
| if(self.qlora_adapter_name_or_path is not None) and \ | ||
| self.quantization != "bitsandbytes": | ||
| raise ValueError( | ||
| "QLoRA adapter only support " | ||
| f"'bitsandbytes' quantization, but got {self.quantization}") | ||
|
|
||
| if self.quantization == "bitsandbytes": | ||
| self.load_format = "bitsandbytes" | ||
|
|
||
|
|
@@ -1097,11 +1101,6 @@ def create_engine_config( | |
| max_cpu_loras=self.max_cpu_loras if self.max_cpu_loras | ||
| and self.max_cpu_loras > 0 else None) if self.enable_lora else None | ||
|
|
||
| if self.qlora_adapter_name_or_path is not None and \ | ||
| self.qlora_adapter_name_or_path != "": | ||
| self.model_loader_extra_config[ | ||
| "qlora_adapter_name_or_path"] = self.qlora_adapter_name_or_path | ||
|
|
||
| # bitsandbytes pre-quantized model need a specific model loader | ||
| if model_config.quantization == "bitsandbytes": | ||
| self.quantization = self.load_format = "bitsandbytes" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -162,17 +162,8 @@ def get_quant_config(model_config: ModelConfig, | |
| None) | ||
| if hf_quant_config is not None: | ||
| return quant_cls.from_config(hf_quant_config) | ||
| # In case of bitsandbytes/QLoRA, get quant config from the adapter model. | ||
| if model_config.quantization == "bitsandbytes": | ||
| if (not load_config.model_loader_extra_config | ||
| or "qlora_adapter_name_or_path" | ||
| not in load_config.model_loader_extra_config): | ||
| return quant_cls.from_config({"adapter_name_or_path": ""}) | ||
| model_name_or_path = load_config.model_loader_extra_config[ | ||
| "qlora_adapter_name_or_path"] | ||
|
|
||
| else: | ||
| model_name_or_path = model_config.model | ||
| model_name_or_path = model_config.model | ||
|
||
| is_local = os.path.isdir(model_name_or_path) | ||
| if not is_local: | ||
| # Download the config files. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.