Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
de0b10cf
Unverified
Commit
de0b10cf
authored
Nov 02, 2025
by
yinghui
Committed by
GitHub
Nov 02, 2025
Browse files
fix: move dummy format loader check before quantization checks (#12532)
parent
6e29446e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
python/sglang/srt/model_loader/loader.py
python/sglang/srt/model_loader/loader.py
+7
-3
No files found.
python/sglang/srt/model_loader/loader.py
View file @
de0b10cf
...
@@ -383,6 +383,10 @@ class DefaultModelLoader(BaseModelLoader):
...
@@ -383,6 +383,10 @@ class DefaultModelLoader(BaseModelLoader):
allow_patterns
=
[
"*.pt"
]
allow_patterns
=
[
"*.pt"
]
elif
load_format
==
LoadFormat
.
NPCACHE
:
elif
load_format
==
LoadFormat
.
NPCACHE
:
allow_patterns
=
[
"*.bin"
]
allow_patterns
=
[
"*.bin"
]
elif
load_format
==
LoadFormat
.
DUMMY
:
raise
ValueError
(
f
"DUMMY load_format should use DummyModelLoader and not call _prepare_weights"
)
else
:
else
:
raise
ValueError
(
f
"Unknown load_format:
{
load_format
}
"
)
raise
ValueError
(
f
"Unknown load_format:
{
load_format
}
"
)
...
@@ -2045,6 +2049,9 @@ def get_model_loader(
...
@@ -2045,6 +2049,9 @@ def get_model_loader(
)
->
BaseModelLoader
:
)
->
BaseModelLoader
:
"""Get a model loader based on the load format."""
"""Get a model loader based on the load format."""
if
load_config
.
load_format
==
LoadFormat
.
DUMMY
:
return
DummyModelLoader
(
load_config
)
if
model_config
and
(
if
model_config
and
(
(
hasattr
(
model_config
,
"modelopt_quant"
)
and
model_config
.
modelopt_quant
)
(
hasattr
(
model_config
,
"modelopt_quant"
)
and
model_config
.
modelopt_quant
)
or
model_config
.
quantization
in
[
"modelopt_fp8"
,
"modelopt_fp4"
,
"modelopt"
]
or
model_config
.
quantization
in
[
"modelopt_fp8"
,
"modelopt_fp4"
,
"modelopt"
]
...
@@ -2071,9 +2078,6 @@ def get_model_loader(
...
@@ -2071,9 +2078,6 @@ def get_model_loader(
if
isinstance
(
load_config
.
load_format
,
type
):
if
isinstance
(
load_config
.
load_format
,
type
):
return
load_config
.
load_format
(
load_config
)
return
load_config
.
load_format
(
load_config
)
if
load_config
.
load_format
==
LoadFormat
.
DUMMY
:
return
DummyModelLoader
(
load_config
)
if
load_config
.
load_format
==
LoadFormat
.
SHARDED_STATE
:
if
load_config
.
load_format
==
LoadFormat
.
SHARDED_STATE
:
return
ShardedStateLoader
(
load_config
)
return
ShardedStateLoader
(
load_config
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment