Skip to content

Conversation

comaniac
Copy link
Contributor

This PR attempts to make the model loading process more systematic and self-contained. Currently when addinga new model, we have to explicitly import the model entry class in model_runnter.load_model function. This introduces two drawbacks:

  1. model_runner.py cannot focus on the changes of "model runner".
  2. Developers have to change 2 files when adding a new model. The change inmodel_runner.py is easy to be missed and may result in conflicts.

sglang.srt does not follow the standard Python package structure (i.e., leveraging __init__.py to construct module hierarchy), so it's not straightforward to use a model registry with decorator. In this PR, I tried to dynamically scan all model files under models, and load their entry classes. The major drawback of this approach is that every model file has to have EntryClass alias to be scanned. IMHO it should be relatively easy for developers to follow.

Please share your thoughts.

@comaniac comaniac requested a review from merrymercy January 25, 2024 21:25
@merrymercy merrymercy merged commit 3a581e9 into main Jan 25, 2024
@merrymercy merrymercy deleted the cody/model branch January 25, 2024 23:29
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
NorthmanPKU pushed a commit to NorthmanPKU/sglang that referenced this pull request May 16, 2025
…d input/output strides for kernel graphs. (sgl-project#98)

* initial docs

* update path

* add doxygen files

* add more

* update docs

* add more files

* fix typo

* link update

* add gated mlp

* add more tutorials

* format

* add transpiler docs

* .

* .

* .

* .

* .

* update RMSNorm example

* adjust image width

* Update LoRA tutorial

* update files

* fix typo

* transpiler doc fix (sgl-project#89)

* transpiler doc fix

* fmt

* .

* checkpoint

* Add files via upload

* Update README.md

* add file

* add demo

* update demo

* minor changes

* add input_strides into KNInputOp

* support output_strides

* transpiler add input/output stride (sgl-project#101)

---------

Co-authored-by: Xinhao Cheng <99570243+xinhaoc@users.noreply.github.com>
Co-authored-by: Zhihao Jia <zhihao@cmu.edu>
zhuyijie88 pushed a commit to zhuyijie88/sglang that referenced this pull request Sep 4, 2025
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