Skip to content

[Misc] add error log in w4a4_flatquant.py#9539

Closed
earthmanylf wants to merge 1 commit into
vllm-project:mainfrom
earthmanylf:log_0525
Closed

[Misc] add error log in w4a4_flatquant.py#9539
earthmanylf wants to merge 1 commit into
vllm-project:mainfrom
earthmanylf:log_0525

Conversation

@earthmanylf

@earthmanylf earthmanylf commented May 25, 2026

Copy link
Copy Markdown

What this PR does / why we need it?

Improve logging coverage and quality across quantization module fo w4a4_flatquant.py. Add error log before an error is raised.

Does this PR introduce any user-facing change?

No, log-only change.

How was this patch tested?

vLLM version: v0.20.2
vLLM main: vllm-project/vllm@1ac10f1

@earthmanylf earthmanylf requested a review from wangxiyuan as a code owner May 25, 2026 12:52
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves the observability of the quantization module by ensuring that validation errors are logged before they are raised. By capturing specific error messages in the logs, developers can more effectively diagnose configuration or input issues during the execution of w4a4_flatquant operations.

Highlights

  • Enhanced Error Logging: Added explicit error logging using the vLLM logger before raising ValueErrors in the w4a4_flatquant module.
  • Improved Debuggability: Ensured that critical validation failures regarding input sizes and transformation matrix dimensions are captured in the logs for easier troubleshooting.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:‌‌

  • A PR should do only one thing, smaller PRs enable faster reviews.
  • Every PR should include unit tests and end-to-end tests ‌to ensure it works and is not broken by other future PRs.
  • Write the commit message by fulfilling the PR description to help reviewer and future developers understand.

If CI fails, you can run linting and testing checks locally according Contributing and Testing.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces logging for error conditions in the w4a4_flatquant.py quantization method. Specifically, it imports the vLLM logger and ensures that ValueError exceptions are logged before being raised in the get_weight and apply methods. The reviewer provided a suggestion to update the PR title and summary to align with the repository's style guide.

import torch
import torch_npu

from vllm.logger import logger

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Suggested PR Title:

[Ops][Misc] add error log in w4a4_flatquant.py

Suggested PR Summary:

### What this PR does / why we need it?

Improve logging coverage and quality across quantization module for w4a4_flatquant.py by adding error logs before exceptions are raised.

Fixes #

### Does this PR introduce _any_ user-facing change?

No, log-only change.

### How was this patch tested?

vLLM version: v0.20.2
vLLM main: https://github.com/vllm-project/vllm/commit/1ac10f159a09897baada01b14b6a0dd6442aefd6
References
  1. The PR title and summary must follow the specified format, including the [Module] tag in the title and the 'Fixes #' line in the summary. (link)

xuchi-0808 added a commit to xuchi-0808/vllm-ascend that referenced this pull request May 26, 2026
…s in MiniMax M2

Ported from upstream PRs:
- vllm-project#9539 (余林峰): w4a4_flatquant — log error before raise ValueError
- vllm-project#9561 (宗浩鑫): patch_minimax_m2_config — warning→info/debug for non-warning paths
xuchi-0808 added a commit to xuchi-0808/vllm-ascend that referenced this pull request May 26, 2026
…s in MiniMax M2

Ported from upstream PRs:
- vllm-project#9539 (余林峰): w4a4_flatquant — log error before raise ValueError
- vllm-project#9561 (宗浩鑫): patch_minimax_m2_config — warning→info/debug for non-warning paths
xuchi-0808 added a commit to xuchi-0808/vllm-ascend that referenced this pull request May 26, 2026
…s in MiniMax M2

Ported from upstream PRs:
- vllm-project#9539 (余林峰): w4a4_flatquant — log error before raise ValueError
- vllm-project#9561 (宗浩鑫): patch_minimax_m2_config — warning→info/debug for non-warning paths
xuchi-0808 added a commit to xuchi-0808/vllm-ascend that referenced this pull request May 26, 2026
…s in MiniMax M2

Ported from upstream PRs:
- vllm-project#9539 (余林峰): w4a4_flatquant — log error before raise ValueError
- vllm-project#9561 (宗浩鑫): patch_minimax_m2_config — warning→info/debug for non-warning paths

Signed-off-by: xuchi <xuchicolson@163.com>
xuchi-0808 added a commit to xuchi-0808/vllm-ascend that referenced this pull request May 27, 2026
…s in MiniMax M2

Ported from upstream PRs:
- vllm-project#9539 (余林峰): w4a4_flatquant — log error before raise ValueError
- vllm-project#9561 (宗浩鑫): patch_minimax_m2_config — warning→info/debug for non-warning paths

Signed-off-by: xuchi <xuchicolson@163.com>
@earthmanylf earthmanylf closed this Jun 3, 2026
@earthmanylf earthmanylf deleted the log_0525 branch June 3, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant