Skip to content

Conversation

max410011
Copy link
Contributor

@max410011 max410011 commented Jul 14, 2025

Summary

This PR fixes the activation quantization issue described in Issue #394, where the input scale shape was incorrect when using the Dynamic TOKEN strategy.

Fix

  • Corrected the reduction dimensions to ensure only the hidden dimension is reduced.
  • This ensures the input scale shape is (batch_size, seq_len, 1) instead of (1, seq_len, hidden_dim).

@brian-dellabetta
Copy link
Contributor

brian-dellabetta commented Jul 15, 2025

Hi @max410011 , appreciate the thorough detail in the issue! I tried your PR, and both original main and your branch seem to work, the resultant models can be loaded up and run in vllm, which surprises me. This is some old code, and per-token/per-channel always slips me up. I will ask around to see if your reasoning in the issue description is correct.

Copy link
Contributor

@brian-dellabetta brian-dellabetta left a comment

Choose a reason for hiding this comment

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

i validated that this gives the shape described in #394 , and after internal conversations this is correct. This is only an issue when running outside of vllm

Copy link
Contributor

@kylesayrs kylesayrs left a comment

Choose a reason for hiding this comment

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

Could you add a test to demonstrate and verify that these changes are correct? Awesome catch and resolution, thanks!

@dsikka
Copy link
Collaborator

dsikka commented Oct 2, 2025

@kylesayrs

@kylesayrs kylesayrs enabled auto-merge (squash) October 3, 2025 19:57
@kylesayrs kylesayrs merged commit 2dd1b62 into neuralmagic:main Oct 3, 2025
1 check 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.

5 participants