Skip to content

Conversation

mickqian
Copy link
Collaborator

@mickqian mickqian commented Jan 29, 2025

Motivation

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

Modifications

  1. Janus model files
  2. related tests

Checklist

@zhyncs
Copy link
Member

zhyncs commented Jan 29, 2025

Coooooool!

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

FocusAware commented Jan 31, 2025

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
Copy link
Collaborator Author

mickqian commented Feb 1, 2025

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

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

Any plans to add text to image?

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

@yizhang2077 yizhang2077 left a comment

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.

@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
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
Copy link
Collaborator

zhaochenyang20 commented Mar 12, 2025

@mickqian rebase with the main?

@zhaochenyang20
Copy link
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
Copy link
Collaborator Author

mickqian commented Mar 12, 2025

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

@zhaochenyang20
Copy link
Collaborator

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

Copy link
Collaborator

@yizhang2077 yizhang2077 left a comment

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
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
50 of 53 checks passed
@zhaochenyang20
Copy link
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
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