Skip to content

Conversation

rahul-tuli
Copy link
Member

Summary

  • Remove conditional skip for g_idx saving in BaseQuantizationCompressor
  • Always save g_idx when present since it's only initialized when needed
  • Removes TODO comment about whether uninitialized case actually occurs

Rationale

The g_idx parameter is only initialized when it's needed for the quantization scheme. Since the initialization logic already handles when it should be created, there's no need to conditionally skip saving it based on uninitialized values. This simplifies the compression logic and ensures all necessary quantization parameters are preserved.

Changes

  • Removed 8-line conditional block that skipped g_idx saving when values were <= -1
  • Removed associated TODO comment

Signed-off-by: Rahul Tuli [email protected]

Remove conditional skip for g_idx saving in compression. Since g_idx is only
initialized when needed, we should always save it when present rather than
checking for uninitialized values.

Signed-off-by: Rahul Tuli <[email protected]>
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR simplifies the quantization compression logic by removing a conditional check that prevented saving g_idx parameters when they contained uninitialized values. Since g_idx is only initialized when needed for specific quantization schemes, the existing initialization logic already handles when it should be created, making the conditional skip unnecessary.

  • Removes 8-line conditional block that skipped g_idx saving when values were <= -1
  • Removes associated TODO comment questioning whether the uninitialized case occurs
  • Ensures all necessary quantization parameters are preserved during compression

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@rahul-tuli rahul-tuli self-assigned this Sep 12, 2025
Copy link
Collaborator

@dsikka dsikka left a comment

Choose a reason for hiding this comment

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

how was this tested? for new models?

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.

This makes sense to me based on your rationale, given the value never gets initialized earlier in the lifecycle. I have a similar concern with my #432 PR, how confident are we that the tests cover all these life cycle edge cases?

@dsikka dsikka merged commit 3e4d7fa into main Sep 23, 2025
2 checks passed
@dsikka dsikka deleted the fix/always-save-initialized-g-idx branch September 23, 2025 20:23
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.

4 participants