Skip to content

Conversation

@sky-2002
Copy link

@sky-2002 sky-2002 commented Oct 18, 2025

Description

This PR adds the GANQ quantizer.

Related Issue

Fixes #391

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

I have locally tested that the GANQ quantization works, however a lot of things need to be discussed with the team to write more formal tests. Will add.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional Notes

This quantizer is not fully ready yet, I am creating a PR to get early feedback.
I will be fixing the issues I am getting with the pre-commit(like variable names, docstrings etc) soon. Some of those are failing and I had to use --no-verify

lower_cutoff_idx = round(self.n * (1 - ratio) + 0.5) + 1
lower_cutoff_values = sorted_W[:, lower_cutoff_idx + 1].unsqueeze(1)

outliers = (cutoff_values <= self.W) | (lower_cutoff_values >= self.W)
Copy link

Choose a reason for hiding this comment

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

Bug: Outlier Split Index Error

The outlier_split method risks an IndexError. The lower_cutoff_idx calculation can produce an index such that lower_cutoff_idx + 1 exceeds self.n - 1, leading to out-of-bounds access on sorted_W for small self.n or certain ratio values.

Fix in Cursor Fix in Web

# pre_process=smash_config["pre_process"],
# full_rows=smash_config["full_rows"],
)
gpt.free()
Copy link

Choose a reason for hiding this comment

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

Bug: Quantizer Configuration System Broken

The gpt.fasterquant() method uses hardcoded default values for quantization parameters like weight_bits, max_epoch, and pre_process. The lines meant to pass these user-configured hyperparameters from smash_config are commented out, which makes the quantizer's configuration system non-functional.

Fix in Cursor Fix in Web

@github-actions
Copy link

This PR has been inactive for 10 days and is now marked as stale.

@github-actions github-actions bot added the stale label Oct 29, 2025
@github-actions github-actions bot closed this Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Integrate GANQ as a Quantizer

1 participant