Skip to content

fix: fix quant config read logic in model loading#1119

Merged
valarLip merged 2 commits into
ROCm:mainfrom
Phi-C:fix_qwen_config
Jun 8, 2026
Merged

fix: fix quant config read logic in model loading#1119
valarLip merged 2 commits into
ROCm:mainfrom
Phi-C:fix_qwen_config

Conversation

@Phi-C
Copy link
Copy Markdown
Contributor

@Phi-C Phi-C commented Jun 7, 2026

Motivation

Fix quant config read procedure in #958. Without this modification, ATOM SGLang benchmark will fail (e.g. https://github.com/ROCm/ATOM/actions/runs/27054539290/job/79856431418).

Technical Details

Test Plan

Test Result

Submission Checklist

Signed-off-by: Phi-C <chenxjhit@163.com>
@Phi-C Phi-C requested a review from ZLkanyo009 June 8, 2026 02:16
ZLkanyo009
ZLkanyo009 previously approved these changes Jun 8, 2026
@Phi-C Phi-C requested a review from valarLip June 8, 2026 02:20
module_prefix = matching_name.split("shared_expert", 1)[0]
shared_expert_prefix = layer_prefix + matching_name.rstrip(".")
routed_expert_prefix = layer_prefix + f"{module_prefix}experts"
model_quant_config = getattr(getattr(model, "args", None), "quant_config", None)
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.

maybe let's force all models have "quant_config"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It seems not easy to unify the read logic in one path, since 1) for plugins, "model.quant_config" means vllm/sglang's quant_config, which is different from "model.atom_config.quant_config"; 2) for dsv4, it uses "model.args.quant_config".

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.

how about unified to "model.atom_config.quant_config", you can feel free to change dsv4's code for this target

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

how about unified to "model.atom_config.quant_config", you can feel free to change dsv4's code for this target

For models in ATOM/atom/models, we use "self.config" for atom config, if we want to unified to "model.atom_config.quant_config", it means we have to change all these into "self.atom_config". Maybe we can keep "model.atom_config.quant_config" and "model.quant_config" in this PR to avoid too many modifications, and change all models's "config" to "atom_config" in another PR to unify the read path if necessary?

Signed-off-by: Phi-C <chenxjhit@163.com>
@valarLip valarLip merged commit a8862d5 into ROCm:main Jun 8, 2026
20 of 31 checks passed
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.

3 participants