Skip to content

Conversation

@yinghai
Copy link
Contributor

@yinghai yinghai commented Dec 8, 2025

Motivation

Add a choice to enable private loader for flexibility.

Modifications

Accuracy Tests

Benchmarking and Profiling

Checklist

@gemini-code-assist
Copy link
Contributor

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)
Copy link
Contributor Author

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")
Copy link
Contributor Author

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

Copy link
Collaborator

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

Copy link
Contributor Author

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

Copy link
Collaborator

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")
Copy link
Contributor Author

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")
Copy link
Collaborator

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

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.

2 participants