Skip to content

model: Support Janus-pro#3203

Merged
zhyncs merged 3 commits into
sgl-project:mainfrom
mickqian:janus-pro
Mar 12, 2025
Merged

model: Support Janus-pro#3203
zhyncs merged 3 commits into
sgl-project:mainfrom
mickqian:janus-pro

Conversation

@mickqian

@mickqian mickqian commented Jan 29, 2025

Copy link
Copy Markdown
Collaborator

Motivation

Support deepseek-ai/Janus-Pro models, #3195

Modifications

  1. Janus model files
  2. related tests

Checklist

@zhyncs

zhyncs commented Jan 29, 2025

Copy link
Copy Markdown
Contributor

Coooooool!

@mickqian
mickqian force-pushed the janus-pro branch 8 times, most recently from b6542eb to a29f545 Compare January 31, 2025 13:10
@FocusAware

FocusAware commented Jan 31, 2025

Copy link
Copy Markdown

Forgive my noobishness, but how to test the PR?
I run:

python -m sglang.launch_server --model-path deepseek-ai/Janus-Pro-7B --trust-remote-code --chat-template
 janus --port 30000 --host 0.0.0.0 

And it aborts with the error below:

  File "/home/user/tools/sglang/python/sglang/srt/models/registry.py", line 65, in resolve_model_cls
    return self._raise_for_unsupported(architectures)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/tools/sglang/python/sglang/srt/models/registry.py", line 32, in _raise_for_unsupported
    raise ValueError(ValueError: Model architectures ['MultiModalityCausalLM'] are not supported for now. Supported architectures: dict_keys(['BaichuanForCausalLM', 'ChatGLMModel', 'CohereForCausalLM', 'Cohere2ForCausalLM', 'DbrxForCausalLM', 'DeepseekForCausalLM', 'DeepseekV2ForCausalLM', 'DeepseekV3ForCausalLM', 'ExaoneForCausalLM', 'GemmaForCausalLM', 'Gemma2ForCausalLM', 'Gemma2ForSequenceClassification', 'GPT2LMHeadModel', 'GPTBigCodeForCausalLM', 'GraniteForCausalLM', 'Grok1ForCausalLM', 'Grok1ModelForCausalLM', 'InternLM2ForCausalLM', 'InternLM2ForRewardModel', 'LlamaForCausalLM', 'Phi3ForCausalLM', 'InternLM3ForCausalLM', 'LlamaForClassification', 'LlamaForCausalLMEagle', 'LlamaEmbeddingModel', 'MistralModel', 'LlamaForSequenceClassification', 'LlamaForSequenceClassificationWithNormal_Weights', 'LlavaLlamaForCausalLM', 'LlavaQwenForCausalLM', 'LlavaMistralForCausalLM', 'LlavaVidForCausalLM', 'MiniCPMForCausalLM', 'MiniCPM3ForCausalLM', 'MiniCPMV', 'MistralForCausalLM', 'MixtralForCausalLM', 'QuantMixtralForCausalLM', 'MllamaForConditionalGeneration', 'OlmoForCausalLM', 'Olmo2ForCausalLM', 'OlmoeForCausalLM', 'Phi3SmallForCausalLM', 'QWenLMHeadModel', 'Qwen2ForCausalLM', 'Qwen2ForCausalLMEagle', 'Qwen2MoeForCausalLM', 'Qwen2VLForConditionalGeneration', 'StableLmForCausalLM', 'TorchNativeLlamaForCausalLM', 'TorchNativePhi3ForCausalLM', 'XverseForCausalLM', 'XverseMoeForCausalLM', 'YiVLForCausalLM'])

[2025-01-31 13:12:23] Received sigquit from a child proces. It usually means the child failed.
Killed

@mickqian

mickqian commented Feb 1, 2025

Copy link
Copy Markdown
Collaborator Author

Forgive my noobishness, but how to test the PR? I run:

python -m sglang.launch_server --model-path deepseek-ai/Janus-Pro-7B --trust-remote-code --chat-template
 janus --port 30000 --host 0.0.0.0 

And it aborts with the error below:

  File "/home/user/tools/sglang/python/sglang/srt/models/registry.py", line 65, in resolve_model_cls
    return self._raise_for_unsupported(architectures)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/tools/sglang/python/sglang/srt/models/registry.py", line 32, in _raise_for_unsupported
    raise ValueError(ValueError: Model architectures ['MultiModalityCausalLM'] are not supported for now. Supported architectures: dict_keys(['BaichuanForCausalLM', 'ChatGLMModel', 'CohereForCausalLM', 'Cohere2ForCausalLM', 'DbrxForCausalLM', 'DeepseekForCausalLM', 'DeepseekV2ForCausalLM', 'DeepseekV3ForCausalLM', 'ExaoneForCausalLM', 'GemmaForCausalLM', 'Gemma2ForCausalLM', 'Gemma2ForSequenceClassification', 'GPT2LMHeadModel', 'GPTBigCodeForCausalLM', 'GraniteForCausalLM', 'Grok1ForCausalLM', 'Grok1ModelForCausalLM', 'InternLM2ForCausalLM', 'InternLM2ForRewardModel', 'LlamaForCausalLM', 'Phi3ForCausalLM', 'InternLM3ForCausalLM', 'LlamaForClassification', 'LlamaForCausalLMEagle', 'LlamaEmbeddingModel', 'MistralModel', 'LlamaForSequenceClassification', 'LlamaForSequenceClassificationWithNormal_Weights', 'LlavaLlamaForCausalLM', 'LlavaQwenForCausalLM', 'LlavaMistralForCausalLM', 'LlavaVidForCausalLM', 'MiniCPMForCausalLM', 'MiniCPM3ForCausalLM', 'MiniCPMV', 'MistralForCausalLM', 'MixtralForCausalLM', 'QuantMixtralForCausalLM', 'MllamaForConditionalGeneration', 'OlmoForCausalLM', 'Olmo2ForCausalLM', 'OlmoeForCausalLM', 'Phi3SmallForCausalLM', 'QWenLMHeadModel', 'Qwen2ForCausalLM', 'Qwen2ForCausalLMEagle', 'Qwen2MoeForCausalLM', 'Qwen2VLForConditionalGeneration', 'StableLmForCausalLM', 'TorchNativeLlamaForCausalLM', 'TorchNativePhi3ForCausalLM', 'XverseForCausalLM', 'XverseMoeForCausalLM', 'YiVLForCausalLM'])

[2025-01-31 13:12:23] Received sigquit from a child proces. It usually means the child failed.
Killed

Could you make sure the local repo has been updated, and python has chosen the correct sglang version? BTW, this PR will be unstable until merged.

@FocusAware

Copy link
Copy Markdown

Forgive my noobishness, but how to test the PR? I run:

python -m sglang.launch_server --model-path deepseek-ai/Janus-Pro-7B --trust-remote-code --chat-template
 janus --port 30000 --host 0.0.0.0 

And it aborts with the error below:

  File "/home/user/tools/sglang/python/sglang/srt/models/registry.py", line 65, in resolve_model_cls
    return self._raise_for_unsupported(architectures)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/tools/sglang/python/sglang/srt/models/registry.py", line 32, in _raise_for_unsupported
    raise ValueError(ValueError: Model architectures ['MultiModalityCausalLM'] are not supported for now. Supported architectures: dict_keys(['BaichuanForCausalLM', 'ChatGLMModel', 'CohereForCausalLM', 'Cohere2ForCausalLM', 'DbrxForCausalLM', 'DeepseekForCausalLM', 'DeepseekV2ForCausalLM', 'DeepseekV3ForCausalLM', 'ExaoneForCausalLM', 'GemmaForCausalLM', 'Gemma2ForCausalLM', 'Gemma2ForSequenceClassification', 'GPT2LMHeadModel', 'GPTBigCodeForCausalLM', 'GraniteForCausalLM', 'Grok1ForCausalLM', 'Grok1ModelForCausalLM', 'InternLM2ForCausalLM', 'InternLM2ForRewardModel', 'LlamaForCausalLM', 'Phi3ForCausalLM', 'InternLM3ForCausalLM', 'LlamaForClassification', 'LlamaForCausalLMEagle', 'LlamaEmbeddingModel', 'MistralModel', 'LlamaForSequenceClassification', 'LlamaForSequenceClassificationWithNormal_Weights', 'LlavaLlamaForCausalLM', 'LlavaQwenForCausalLM', 'LlavaMistralForCausalLM', 'LlavaVidForCausalLM', 'MiniCPMForCausalLM', 'MiniCPM3ForCausalLM', 'MiniCPMV', 'MistralForCausalLM', 'MixtralForCausalLM', 'QuantMixtralForCausalLM', 'MllamaForConditionalGeneration', 'OlmoForCausalLM', 'Olmo2ForCausalLM', 'OlmoeForCausalLM', 'Phi3SmallForCausalLM', 'QWenLMHeadModel', 'Qwen2ForCausalLM', 'Qwen2ForCausalLMEagle', 'Qwen2MoeForCausalLM', 'Qwen2VLForConditionalGeneration', 'StableLmForCausalLM', 'TorchNativeLlamaForCausalLM', 'TorchNativePhi3ForCausalLM', 'XverseForCausalLM', 'XverseMoeForCausalLM', 'YiVLForCausalLM'])

[2025-01-31 13:12:23] Received sigquit from a child proces. It usually means the child failed.
Killed

Could you make sure the local repo has been updated, and python has chosen the correct sglang version? BTW, this PR will be unstable until merged.

The issue was caused by a missing dependency. Managed to get it working after running "pip install addict".

@FocusAware

Copy link
Copy Markdown

Any plans to add text to image?

@mickqian mickqian mentioned this pull request Feb 6, 2025
5 tasks

@yizhang2077 yizhang2077 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for late review, I take a basic review through it and leave some comments here, I'll take a closer look these days.

Comment thread python/sglang/test/test_utils.py Outdated
Comment thread test/srt/test_vision_openai_server.py Outdated
Comment thread python/sglang/srt/hf_transformers_utils.py Outdated
Comment thread python/sglang/srt/hf_transformers_utils.py Outdated
Comment thread python/sglang/srt/managers/schedule_batch.py Outdated
@mickqian
mickqian force-pushed the janus-pro branch 2 times, most recently from 8e6765d to 931c250 Compare March 4, 2025 02:20
@zhaochenyang20

Copy link
Copy Markdown
Collaborator

@mickqian Mick. Could you decouple this PR into two or more?

At least one for refactor, second for the model?

@mickqian
mickqian force-pushed the janus-pro branch 3 times, most recently from 0c5771e to ae2529c Compare March 12, 2025 01:26
@zhaochenyang20

zhaochenyang20 commented Mar 12, 2025

Copy link
Copy Markdown
Collaborator

@mickqian rebase with the main?

@zhaochenyang20

Copy link
Copy Markdown
Collaborator

@mickqian @yizhang2077 why after refactor the codes and merged a small PR, this PR is still huge? 3000+ lines

@mickqian
mickqian force-pushed the janus-pro branch 2 times, most recently from 104e497 to 6336345 Compare March 12, 2025 04:35
@mickqian

mickqian commented Mar 12, 2025

Copy link
Copy Markdown
Collaborator Author

@zhyncs All the model class/config class/processor classes takes up to 2000+ lines. The model class alone is 2000+ lines

@zhaochenyang20

Copy link
Copy Markdown
Collaborator

@yizhang2077 if you approve and pass the CI, I can merge it

@yizhang2077 yizhang2077 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we update deepgeem here?

@mickqian

Copy link
Copy Markdown
Collaborator Author

Why we update deepgeem here?

updated

@mickqian
mickqian requested a review from yizhang2077 March 12, 2025 15:36
@zhyncs
zhyncs merged commit 01090e8 into sgl-project:main Mar 12, 2025
@zhaochenyang20

Copy link
Copy Markdown
Collaborator

congrats

hebiao064 pushed a commit to hebiao064/sglang that referenced this pull request Mar 13, 2025
@m0g1cian m0g1cian mentioned this pull request Mar 18, 2025
5 tasks
0826joyce pushed a commit to 0826joyce/sglang-perf-opt that referenced this pull request May 19, 2026
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.

6 participants