-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[loader] enable private loader #14620
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -2100,4 +2100,12 @@ def get_model_loader( | |
| if load_config.load_format == LoadFormat.REMOTE_INSTANCE: | ||
| return RemoteInstanceModelLoader(load_config) | ||
|
|
||
| if load_config.load_format == LoadFormat.PRIVATE: | ||
| import importlib | ||
| try: | ||
| module = importlib.import_module("sglang.private.private_model_loader") | ||
|
Contributor
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. use importlib to avoid circular deps lint
Collaborator
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. btw for circular deps lint another way may be use comments
Contributor
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. the lint showed up on the private lib part lol
Collaborator
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. Ah I see |
||
| return module.PrivateModelLoader(load_config) | ||
| except ImportError: | ||
| raise ValueError("Failed to import sglang.private.private_model_loader") | ||
|
|
||
| return DefaultModelLoader(load_config) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -688,7 +688,7 @@ def load_weights(self, weights: Iterable[Tuple[str, torch.Tensor]]): | |
| if name in params_dict.keys(): | ||
| param = params_dict[name] | ||
| else: | ||
| continue | ||
| raise ValueError(f"Weight {name} not found in params_dict") | ||
|
Contributor
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. |
||
| except KeyError: | ||
| print(params_dict.keys()) | ||
| raise | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,6 +80,7 @@ | |
| "layered", | ||
| "remote", | ||
| "remote_instance", | ||
| "private", | ||
| ] | ||
|
|
||
| QUANTIZATION_CHOICES = [ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already enforces that the loader needs to be an
DefaultModelLoaderinstance in L942