Skip to content

[weight loader] add dtype equality validation between parameter and weight - #51792

Merged
simon-mo merged 6 commits into
vllm-project:mainfrom
andyxning:add_dtype_equal_validation_between_parameter_and_weight
Oct 1, 2026
Merged

simon-mo merged 6 commits into
vllm-project:mainfrom
andyxning:add_dtype_equal_validation_between_parameter_and_weight

Conversation

@andyxning

@andyxning andyxning commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

Purpose

Add weight and model parameter tensor dtype mismatch warning log.

For example, with https://huggingface.co/Qwen/Qwen3.5-27B/tree/main?show_file_info=model.safetensors.index.json, layers.9.linear_attn.norm.weight is using F32 but the qwen 3.5 model definition used in vllm declare the norm parameter as qwen 3.5 config.json default dtype bfloat16 in:

self.norm = RMSNormGated(
self.head_v_dim,
eps=self.layer_norm_epsilon,
group_size=None,
norm_before_gate=True,
activation=output_gate_type,
device=current_platform.current_device(),
)

This mismatch may cause effect problem.

Us warning instead of warning_once because in case pipeline parallelism is used, difference layers are placed in difference rank in pp group. We can not gurantee only first rank in pp group has mismatch layers.

Test Plan

Tested with Qwen3.5-27B, before the pr the loading log shows nothing about the mismatch.

After the pr the loading log shows that:

(Worker_PP2 pid=1831) WARNING 08-12 13:14:29 [model_executor/models/utils.py:281] Attempted to load weight layers.46.linear_attn.A_log with dtype torch.bfloat16 into parameter with dtype torch.float32

This PR share same background with #51836.

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@andyxning andyxning changed the title [weight loader] add dtype equal validation between parameter and weight [weight loader] add dtype equality validation between parameter and weight Aug 11, 2026
Signed-off-by: Andy Xie <andy.xning@gmail.com>
@andyxning
andyxning force-pushed the add_dtype_equal_validation_between_parameter_and_weight branch from 7be6321 to 73bfada Compare August 12, 2026 10:19
@andyxning

Copy link
Copy Markdown
Member Author

@simon-mo

@simon-mo simon-mo 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.

AI-assisted review performed on behalf of Simon Mo. Reviewed commit 4ddf99c90af13954bae4c8fd9523127583f1375c.

No blocking findings. The warning is diagnostic only and preserves the existing weight loader, casts, and yielded loaded names. Focused CPU probes executed the unchanged _load_param method and default_weight_loader with real torch parameters for equal and differing dtypes; values and loader behavior were preserved. Non-blocking: intentional checkpoint-to-runtime casts (for example an explicit --dtype choice) also warn once per weight, so consider aggregation or debug-level diagnostics if this becomes noisy. Full model/GPU execution was not run locally; normal CI remains required.

@simon-mo
simon-mo enabled auto-merge (squash) September 30, 2026 18:42
@github-actions github-actions Bot added the ready ONLY add when PR is ready to merge/full CI is needed label Sep 30, 2026

@simon-mo simon-mo 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.

AI-assisted re-review on behalf of Simon Mo at 7ea7766404a2115d5bdbdf6e8738ebe3d02e0ef3. Compared the current diff with the previously reviewed change: identical. Re-ran the focused CPU timing/weight-loader probes against these current-head files (3 passed). Approval remains valid; required upstream CI must pass before merge.

@simon-mo

Copy link
Copy Markdown
Collaborator

/ci run

@github-actions

Copy link
Copy Markdown

❌ This PR is 10 commits behind upstream main. Your branch must contain every commit currently on upstream main. No new CI build was started. Merge or rebase onto the latest main, then rerun /ci run. To test this branch at your own risk, use /ci run --allow-stale.

@simon-mo simon-mo 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.

AI-assisted review on behalf of Simon Mo after updating the branch against main. Reviewed 6d130b63997d43499807e823b0ac572e2848bef8; the PR diff is byte-for-byte identical to the change already reviewed and CPU-tested. No new blocking findings. Required CI remains the merge gate.

@simon-mo

Copy link
Copy Markdown
Collaborator

/ci run

@github-actions

Copy link
Copy Markdown

✅ Triggered Buildkite CI #92264 for commit 6d130b63997d.

@simon-mo

Copy link
Copy Markdown
Collaborator

AI-assisted CI follow-up from Simon’s agent: both this PR and #52141 are blocked by the same existing-main test-fixture mismatch, not by the logging change. Buildkite 92264 fails all five MiniMax PP cases in tests/v1/worker/test_eagle3_aux_hidden_states_pp.py on both AMD and NVIDIA with AttributeError: ... use_v2_model_runner.

I checked base/main 8fb16ea5a66f0ef362e728f0ff025f2845927fd5: the fixture passes a SimpleNamespace without use_v2_model_runner or speculative_config, while MiniMaxM3Model.__init__ reads the former and spec_decode_needs_target_embed reads the latter. For these non-speculative PP fixtures, the proposed fix is to supply both:

vllm_config=SimpleNamespace(
    model_config=SimpleNamespace(hf_text_config=config),
    quant_config=None,
    use_v2_model_runner=False,
    speculative_config=None,
)

@andyxning could you add this fixture correction (preferably once upstream, then update both branches), and run the five existing PP tests? I’ll re-review the resulting heads, restart CI, and merge once required checks pass. A blind retry won’t resolve these deterministic failures.

Executor/worker log.

@simon-mo simon-mo 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.

AI-assisted re-review for Simon: refreshed against current main including the MiniMax PP fixture correction (#59508). The PR diff is byte-identical to the previously reviewed logging change. Focused CPU review probes pass; required hosted CI remains the merge gate.

@simon-mo

simon-mo commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

/ci run

@simon-mo

simon-mo commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

@andyxning the shared MiniMax PP fixture mismatch is now fixed upstream by #59508. I updated this branch to main, verified the PR diff is unchanged, reran the three focused logging probes, refreshed approval on the new head, and requested a new CI build. No separate fixture fix is needed from you now. I will handle the merge once required CI passes. (AI-assisted follow-up for Simon.)

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #92307 for commit 18f880f58041.

@simon-mo
simon-mo merged commit a37c402 into vllm-project:main Oct 1, 2026
154 checks passed
@andyxning
andyxning deleted the add_dtype_equal_validation_between_parameter_and_weight branch October 7, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants