-
Notifications
You must be signed in to change notification settings - Fork 77
feat: support Qwen3-VL model on npu device. #295
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
Conversation
39f3227 to
d08f719
Compare
| const ParallelArgs& parallel_args) { | ||
| param.hasSharedExpert = (args.n_shared_experts() > 0); | ||
| param.hasSharedExpertGate = true; | ||
| param.hasSharedExpertGate = false; |
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.
other qwen models will be effected by this modification.
| const int local_index = expert_index % num_experts_per_partition_; | ||
| const bool is_sharded = shard_map.count(index); | ||
|
|
||
| std::lock_guard<std::mutex> lock(experts_mutex_); |
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.
as above
|
|
||
| void load_model(std::unique_ptr<ModelLoader> loader, | ||
| std::string prefix = "" /*llm model weight prefix*/) { | ||
| std::string prefix = "model." /*llm model weight prefix*/) { |
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.
nit: all models has the prefix model. ?
It seems that the llm_head does not have this prefix.
lm_head_->load_state_dict(
state_dict->get_dict_with_prefix(prefix + "lm_head."));
| return embed_tokens_(input_ids, 0); | ||
| #elif defined(USE_MLU) | ||
| return embed_tokens_(input_ids); | ||
| #endif |
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.
nit: Defensive programming is needed here.
#else
LOG(FATAL) << "...."
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.
ok
feat:
1.support Qwen3-VL.
2.Qwen3-VL-MOE is currently not supported.