Skip to content

Commit

Permalink
Fix fail on macos (#3215)
Browse files Browse the repository at this point in the history
### Changes

- Skip `test_non_convertable_division` on MacOS
- Cut values to 1e-10, more digits after zero dont change a result
- Use onle line `pip install` in gha 

### Reason for changes


https://github.com/openvinotoolkit/nncf/actions/runs/12969549430/job/36208496733

```
FAILED tests/openvino/native/test_node_utils.py::test_non_convertable_division[0.058599039912223816-15-True-0.003906603] - AssertionError: 
Not equal to tolerance rtol=0, atol=0

Mismatched elements: 1 / 1 (100%)
Max absolute difference among violations: 3.5297126e-07
Max relative difference among violations: 9.035248e-05
 ACTUAL: array([0.003906], dtype=float32)
 DESIRED: array([0.003907], dtype=float32)
FAILED tests/openvino/native/test_node_utils.py::test_non_convertable_division[0.058599039912223816-15-False-0.003906602505594492] - AssertionError: 
Not equal to tolerance rtol=0, atol=0

Mismatched elements: 1 / 1 (100%)
Max absolute difference among violations: 3.525056e-07
Max relative difference among violations: 9.023329e-05
 ACTUAL: array([0.003906], dtype=float32)
 DESIRED: array([0.003907], dtype=float32)
```

### Tests


https://github.com/openvinotoolkit/nncf/actions/runs/12991342528/job/36228616650

---------

Co-authored-by: Nikita Savelyev <[email protected]>
  • Loading branch information
AlexanderDokuchaev and nikita-savelyevv authored Jan 27, 2025
1 parent 6f0e3e3 commit 281149b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ jobs:
python-version: "3.10"
- name: Install dependencies
run: |
pip install .
pip install -r tests/common/requirements.txt
pip install . -r tests/common/requirements.txt
- name: Print installed modules
run: pip list
- name: Run pre-commit
Expand All @@ -53,8 +52,7 @@ jobs:
python-version: "3.10"
- name: Install dependencies
run: |
pip install .
pip install -r tests/openvino/requirements.txt
pip install . -r tests/openvino/requirements.txt
- name: Print installed modules
run: pip list
- name: Run pre-commit
Expand Down
6 changes: 4 additions & 2 deletions tests/openvino/native/test_node_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from openvino.runtime import opset13 as opset

from nncf.common.graph.graph import NNCFNode
from nncf.common.utils.os import is_macos
from nncf.openvino.graph.layer_attributes import OVLayerAttributes
from nncf.openvino.graph.metatypes.openvino_metatypes import OVMatMulMetatype
from nncf.openvino.graph.nncf_graph_builder import GraphConverter
Expand Down Expand Up @@ -153,10 +154,11 @@ def test_get_weight_channel_axes_for_matmul(weights_port_id, transpose, shape, d
@pytest.mark.parametrize(
"a,b,convertable,ref_result",
[
(0.058599039912223816, 15, True, 0.003906603),
(0.058599039912223816, 15, False, 0.003906602505594492),
(0.0585990399, 15, True, 0.003906603),
(0.0585990399, 15, False, 0.0039066025),
],
)
@pytest.mark.skipif(is_macos(), reason="Not relevant for MacOS, returns 0.0039062500 in both cases.")
def test_non_convertable_division(a, b, convertable, ref_result):
a, b, ref_result = tuple(map(lambda x: np.array([x], np.float32), [a, b, ref_result]))
a_param = opset.parameter((-1,), ov.Type.f32)
Expand Down

0 comments on commit 281149b

Please sign in to comment.