Skip to content

better solution for checking g_idx support #2251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 22, 2025
Merged

Conversation

xin3he
Copy link
Contributor

@xin3he xin3he commented Jul 21, 2025

bug fix: 1.21.2 doesn't support g_idx
1.22.0:
image
1.21.2:
image

@xin3he xin3he requested a review from yiliu30 July 22, 2025 01:50
@yiliu30 yiliu30 requested a review from Copilot July 22, 2025 04:54
Copy link
Contributor

@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 improves the detection of g_idx (group_index) support in Habana PyTorch Extension (HPEX) by replacing version-based checking with runtime schema inspection. The change fixes a bug where version 1.21.2 was incorrectly assumed to support g_idx based solely on version comparison.

  • Replaces version-based g_idx support detection with runtime schema inspection
  • Adds LRU caching to optimize repeated support checks
  • Updates import statements to reflect the new function name

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
neural_compressor/torch/utils/environ.py Replaces get_hpex_version() with is_hpex_support_g_idx() that checks schema instead of version
neural_compressor/torch/algorithms/weight_only/modules.py Updates import and usage to call the new g_idx support detection function

@chensuyue chensuyue added this to the 3.5 milestone Jul 22, 2025
@XuehaoSun XuehaoSun merged commit 1cc864e into master Jul 22, 2025
19 checks passed
@XuehaoSun XuehaoSun deleted the cherry_pick_v1.22.0_next branch July 22, 2025 08:55
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