-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Reduce time it takes to import SGLang #12510
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
a68aa2d
7d1ba9c
26748d6
9bc7959
fa8d495
d78a858
22995d5
54eb029
09e7781
04d56ef
b963ca9
6a3f73f
461f70e
0ee47f6
ae9ef65
6750d12
0620446
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 |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| from sglang.srt.layers.moe.moe_runner import MoeRunner, MoeRunnerConfig | ||
| from sglang.srt.layers.moe.utils import ( | ||
| DeepEPMode, | ||
| MoeA2ABackend, | ||
|
|
@@ -12,6 +11,10 @@ | |
| is_tbo_enabled, | ||
| should_use_flashinfer_cutlass_moe_fp4_allgather, | ||
| ) | ||
| from sglang.utils import LazyImport | ||
|
|
||
| MoeRunner = LazyImport("sglang.srt.layers.moe.moe_runner.runner", "MoeRunner") | ||
|
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. I think this (
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. not sure. @merrymercy @fzyzcjy What are your opinions? |
||
| MoeRunnerConfig = LazyImport("sglang.srt.layers.moe.moe_runner.base", "MoeRunnerConfig") | ||
|
|
||
| __all__ = [ | ||
| "DeepEPMode", | ||
|
|
||
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.
You shouldn't do this... You imported
ScheduleBatchtwice here.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.
iiuc, this is because we import it at the top for the type checking, and then here we use it (
ScheduleBatch.init_new, only function in this file that doesn't use it as a type) so we need to import it for use in this function. But I can leave it at top-level import if you think that's better and remove from type checking.