-
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?
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
|
||
| def model_load_weights(model, iter): | ||
| DefaultModelLoader.load_weights_and_postprocess(model, iter, target_device) | ||
| loader.load_weights_and_postprocess(model, iter, target_device) |
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 DefaultModelLoader instance in L942
| if load_config.load_format == LoadFormat.PRIVATE: | ||
| import importlib | ||
| try: | ||
| module = importlib.import_module("sglang.private.private_model_loader") |
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.
use importlib to avoid circular deps lint
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.
btw for circular deps lint another way may be use comments # noqa: ... etc to ignore it
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.
the lint showed up on the private lib part lol
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.
Ah I see
| param = params_dict[name] | ||
| else: | ||
| continue | ||
| raise ValueError(f"Weight {name} not found in params_dict") |
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.
| if load_config.load_format == LoadFormat.PRIVATE: | ||
| import importlib | ||
| try: | ||
| module = importlib.import_module("sglang.private.private_model_loader") |
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.
btw for circular deps lint another way may be use comments # noqa: ... etc to ignore it
Motivation
Add a choice to enable private loader for flexibility.
Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist