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
38c00ed7
Unverified
Commit
38c00ed7
authored
Sep 22, 2025
by
Lianmin Zheng
Committed by
GitHub
Sep 22, 2025
Browse files
Fix multimodal registry and code sync scripts (#10759)
Co-authored-by:
cctry
<
shiyang@x.ai
>
parent
d4041a5e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
15 deletions
+38
-15
python/sglang/srt/managers/multimodal_processor.py
python/sglang/srt/managers/multimodal_processor.py
+1
-2
python/sglang/srt/managers/tokenizer_manager.py
python/sglang/srt/managers/tokenizer_manager.py
+1
-1
python/sglang/srt/models/torch_native_llama.py
python/sglang/srt/models/torch_native_llama.py
+9
-2
python/sglang/utils.py
python/sglang/utils.py
+10
-1
scripts/ci/ci_install_dependency.sh
scripts/ci/ci_install_dependency.sh
+1
-2
scripts/code_sync/copy_from_oss.py
scripts/code_sync/copy_from_oss.py
+6
-2
scripts/code_sync/copy_to_oss.py
scripts/code_sync/copy_to_oss.py
+10
-5
No files found.
python/sglang/srt/managers/multimodal_processor.py
View file @
38c00ed7
...
@@ -12,8 +12,7 @@ logger = logging.getLogger(__name__)
...
@@ -12,8 +12,7 @@ logger = logging.getLogger(__name__)
PROCESSOR_MAPPING
=
{}
PROCESSOR_MAPPING
=
{}
def
import_processors
():
def
import_processors
(
package_name
:
str
):
package_name
=
"sglang.srt.multimodal.processors"
package
=
importlib
.
import_module
(
package_name
)
package
=
importlib
.
import_module
(
package_name
)
for
_
,
name
,
ispkg
in
pkgutil
.
iter_modules
(
package
.
__path__
,
package_name
+
"."
):
for
_
,
name
,
ispkg
in
pkgutil
.
iter_modules
(
package
.
__path__
,
package_name
+
"."
):
if
not
ispkg
:
if
not
ispkg
:
...
...
python/sglang/srt/managers/tokenizer_manager.py
View file @
38c00ed7
...
@@ -185,7 +185,7 @@ class TokenizerManager(TokenizerCommunicatorMixin):
...
@@ -185,7 +185,7 @@ class TokenizerManager(TokenizerCommunicatorMixin):
)
)
if
self
.
model_config
.
is_multimodal
:
if
self
.
model_config
.
is_multimodal
:
import_processors
()
import_processors
(
"sglang.srt.multimodal.processors"
)
try
:
try
:
_processor
=
get_processor
(
_processor
=
get_processor
(
server_args
.
tokenizer_path
,
server_args
.
tokenizer_path
,
...
...
python/sglang/srt/models/torch_native_llama.py
View file @
38c00ed7
...
@@ -66,8 +66,8 @@ from sglang.srt.model_executor.forward_batch_info import ForwardBatch
...
@@ -66,8 +66,8 @@ from sglang.srt.model_executor.forward_batch_info import ForwardBatch
from
sglang.srt.model_loader.weight_utils
import
default_weight_loader
from
sglang.srt.model_loader.weight_utils
import
default_weight_loader
from
sglang.srt.utils
import
add_prefix
from
sglang.srt.utils
import
add_prefix
tp_size
=
get_tensor_model_parallel_world_size
()
tp_size
:
Optional
[
int
]
=
None
tp_rank
=
get_tensor_model_parallel_rank
()
tp_rank
:
Optional
[
int
]
=
None
def
gate_up_proj_weight_loader
(
def
gate_up_proj_weight_loader
(
...
@@ -341,6 +341,13 @@ class LlamaModel(nn.Module):
...
@@ -341,6 +341,13 @@ class LlamaModel(nn.Module):
quant_config
:
Optional
[
QuantizationConfig
]
=
None
,
quant_config
:
Optional
[
QuantizationConfig
]
=
None
,
)
->
None
:
)
->
None
:
super
().
__init__
()
super
().
__init__
()
global
tp_size
,
tp_rank
if
tp_size
is
None
:
tp_size
=
get_tensor_model_parallel_world_size
()
if
tp_rank
is
None
:
tp_rank
=
get_tensor_model_parallel_rank
()
self
.
config
=
config
self
.
config
=
config
self
.
padding_idx
=
config
.
pad_token_id
self
.
padding_idx
=
config
.
pad_token_id
self
.
vocab_size
=
config
.
vocab_size
self
.
vocab_size
=
config
.
vocab_size
...
...
python/sglang/utils.py
View file @
38c00ed7
...
@@ -8,6 +8,7 @@ import logging
...
@@ -8,6 +8,7 @@ import logging
import
os
import
os
import
random
import
random
import
socket
import
socket
import
ssl
import
subprocess
import
subprocess
import
sys
import
sys
import
time
import
time
...
@@ -158,7 +159,15 @@ def http_request(
...
@@ -158,7 +159,15 @@ def http_request(
data
=
bytes
(
dumps
(
json
),
encoding
=
"utf-8"
)
data
=
bytes
(
dumps
(
json
),
encoding
=
"utf-8"
)
try
:
try
:
resp
=
urllib
.
request
.
urlopen
(
req
,
data
=
data
,
cafile
=
verify
)
if
sys
.
version_info
>=
(
3
,
13
):
# Python 3.13+: Use SSL context (cafile removed)
if
verify
and
isinstance
(
verify
,
str
):
context
=
ssl
.
create_default_context
(
cafile
=
verify
)
else
:
context
=
ssl
.
create_default_context
()
resp
=
urllib
.
request
.
urlopen
(
req
,
data
=
data
,
context
=
context
)
else
:
resp
=
urllib
.
request
.
urlopen
(
req
,
data
=
data
,
cafile
=
verify
)
return
HttpResponse
(
resp
)
return
HttpResponse
(
resp
)
except
urllib
.
error
.
HTTPError
as
e
:
except
urllib
.
error
.
HTTPError
as
e
:
return
HttpResponse
(
e
)
return
HttpResponse
(
e
)
...
...
scripts/ci/ci_install_dependency.sh
View file @
38c00ed7
...
@@ -16,6 +16,7 @@ python3 -c 'import os, shutil, tempfile, getpass; cache_dir = os.environ.get("TO
...
@@ -16,6 +16,7 @@ python3 -c 'import os, shutil, tempfile, getpass; cache_dir = os.environ.get("TO
# Kill existing processes
# Kill existing processes
SCRIPT_DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
SCRIPT_DIR
=
"
$(
cd
"
$(
dirname
"
${
BASH_SOURCE
[0]
}
"
)
"
&&
pwd
)
"
bash
"
${
SCRIPT_DIR
}
/../killall_sglang.sh"
bash
"
${
SCRIPT_DIR
}
/../killall_sglang.sh"
echo
"CUDA_VISIBLE_DEVICES=
${
CUDA_VISIBLE_DEVICES
:-}
"
# Install apt packages
# Install apt packages
apt
install
-y
git libnuma-dev
apt
install
-y
git libnuma-dev
...
@@ -90,5 +91,3 @@ fi
...
@@ -90,5 +91,3 @@ fi
# Show current packages
# Show current packages
$PIP_CMD
list
$PIP_CMD
list
echo
"CUDA_VISIBLE_DEVICES=
${
CUDA_VISIBLE_DEVICES
:-}
"
scripts/code_sync/copy_from_oss.py
View file @
38c00ed7
...
@@ -43,13 +43,17 @@ folder_names = [
...
@@ -43,13 +43,17 @@ folder_names = [
"docker"
,
"docker"
,
"docs"
,
"docs"
,
"examples"
,
"examples"
,
"sgl-kernel"
,
"README.md"
,
"python/sglang/lang"
,
"python/sglang/lang"
,
"python/sglang/srt"
,
"python/sglang/srt"
,
"python/sglang/test"
,
"python/sglang/test"
,
"python/sglang/__init__.py"
,
"python/sglang/utils.py"
,
"python/sglang/README.md"
,
"sgl-kernel"
,
"test/lang"
,
"test/lang"
,
"test/srt"
,
"test/srt"
,
"test/README.md"
,
"README.md"
,
]
]
private_repo
=
"your-org/sglang-private-repo"
private_repo
=
"your-org/sglang-private-repo"
...
...
scripts/code_sync/copy_to_oss.py
View file @
38c00ed7
...
@@ -43,13 +43,17 @@ folder_names = [
...
@@ -43,13 +43,17 @@ folder_names = [
"docker"
,
"docker"
,
"docs"
,
"docs"
,
"examples"
,
"examples"
,
"sgl-kernel"
,
"README.md"
,
"python/sglang/lang"
,
"python/sglang/lang"
,
"python/sglang/srt"
,
"python/sglang/srt"
,
"python/sglang/test"
,
"python/sglang/test"
,
"python/sglang/__init__.py"
,
"python/sglang/utils.py"
,
"python/sglang/README.md"
,
"sgl-kernel"
,
"test/lang"
,
"test/lang"
,
"test/srt"
,
"test/srt"
,
"test/README.md"
,
"README.md"
,
]
]
# --- Configuration End ---
# --- Configuration End ---
...
@@ -395,9 +399,10 @@ def main():
...
@@ -395,9 +399,10 @@ def main():
pr_title
=
f
"[Auto Sync] Update
{
filename_list_str
}
(
{
current_date
}
)"
pr_title
=
f
"[Auto Sync] Update
{
filename_list_str
}
(
{
current_date
}
)"
pr_body
=
(
pr_body
=
(
f
"Sync changes from commit `
{
short_hash
}
`.
\n\n
"
f
"Sync changes from commit `
{
short_hash
}
`.
\n\n
"
f
"**Relevant Files Changed:**
\n
{
file_list_str
}
"
f
"**Files Changed:**
\n
{
file_list_str
}
\n\n
"
"
\n\n
---
\n\n
"
f
"Author:
{
author_name
}
<
{
author_email
}
>"
"*This is an automated PR created by a script.*"
f
"
\n\n
---
\n\n
"
f
"*This is an automated PR created by scripts/copy_from_oss.py.*"
)
)
# 5. Create branch, apply patch, and push
# 5. Create branch, apply patch, and push
...
...
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