Skip to content

Conversation

@Kaihui-intel
Copy link
Contributor

@Kaihui-intel Kaihui-intel commented Dec 5, 2025

User description

Type of Change

feature or bug fix or documentation or validation or others
API changed or not

Description

skip ipex ut

Expected Behavior & Potential Risk

the expected behavior that triggered by this PR

How has this PR been tested?

how to reproduce the test (including hardware information)

Dependency Change?

any library dependency introduced or removed


PR Type

Enhancement


Description

  • Skip IPEX CI for torch versions >= 2.9.0

  • Import Version from packaging.version for version comparison


Diagram Walkthrough

flowchart LR
  A["Import Version"] -- "for version comparison" --> B["Skip IPEX CI"]
  B -- "if torch version >= 2.9.0" --> C["Test Skipped"]
Loading

File Walkthrough

Relevant files
Enhancement
test_smooth_quant.py
Skip IPEX CI for torch >= 2.9.0                                                   

test/3x/torch/quantization/test_smooth_quant.py

  • Import Version from packaging.version
  • Add @pytest.mark.skipif decorator to skip tests for torch >= 2.9.0
+2/-2     
test_static_quant.py
Skip IPEX CI for torch >= 2.9.0                                                   

test/3x/torch/quantization/test_static_quant.py

  • Import Version from packaging.version
  • Add @pytest.mark.skipif decorator to skip tests for torch >= 2.9.0
+2/-1     
test_transformers.py
Skip IPEX CI for torch >= 2.9.0                                                   

test/3x/torch/quantization/weight_only/test_transformers.py

  • Import Version from packaging.version
  • Add @pytest.mark.skipif decorator to skip tests for torch >= 2.9.0
+2/-0     

Signed-off-by: Kaihui-intel <kaihui.tang@intel.com>
@PRAgent4INC
Copy link
Collaborator

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Incorrect Condition

The condition in the @pytest.mark.skipif decorator seems incorrect. It currently skips the test if the torch version is less than 2.9.0, which is the opposite of the intended behavior.

@pytest.mark.skipif(not Version(torch.__version__) < Version("2.9.0"), reason="only for torch<2.9.0 [ipex]")
Incorrect Condition

The condition in the @pytest.mark.skipif decorator seems incorrect. It currently skips the test if the torch version is less than 2.9.0, which is the opposite of the intended behavior.

@pytest.mark.skipif(not Version(torch.__version__) < Version("2.9.0"), reason="only for torch<2.9.0 [ipex]")
Incorrect Condition

The condition in the @pytest.mark.skipif decorator seems incorrect. It currently skips the test if the torch version is less than 2.9.0, which is the opposite of the intended behavior.

@pytest.mark.skipif(not Version(torch.__version__) < Version("2.9.0"), reason="only for torch<2.9.0 [ipex]")

@PRAgent4INC
Copy link
Collaborator

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Fix incorrect version comparison

The condition in the skipif decorator is incorrect. It should skip the test if the
torch version is 2.9.0 or higher.

test/3x/torch/quantization/test_smooth_quant.py [37]

-@pytest.mark.skipif(not Version(torch.__version__) < Version("2.9.0"), reason="only for torch<2.9.0 [ipex]")
+@pytest.mark.skipif(Version(torch.__version__) >= Version("2.9.0"), reason="only for torch<2.9.0 [ipex]")
Suggestion importance[1-10]: 8

__

Why: The condition in the skipif decorator is incorrect and should be changed to skip the test if the torch version is 2.9.0 or higher.

Medium

@Kaihui-intel
Copy link
Contributor Author

@chensuyue How to update the torch version and trigger CI?

Signed-off-by: chensuyue <suyue.chen@intel.com>
@chensuyue chensuyue force-pushed the kaihui/disable_ipex branch from 2711f18 to 4fea831 Compare December 5, 2025 11:32
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.

4 participants