Skip to content
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

Clean and clear CI #975

Merged
merged 22 commits into from
Nov 5, 2024
Merged

Clean and clear CI #975

merged 22 commits into from
Nov 5, 2024

Conversation

IlyasMoutawwakil
Copy link
Member

@IlyasMoutawwakil IlyasMoutawwakil commented Oct 27, 2024

What does this PR do?

  • Testing IPEX with torch from 2.2.0 to 2.4.*.
  • Adding assertions for the tested versions of torch, IPEX and transformers.
  • Distribute OpenVINO tests based on test file patterns to accelerate the CI.
  • Use "latest" transformers version to avoid pinning a specific version in the CI that needs to be updated with each release.
  • Reducing verbosity to use transformers testing utility whenever possible (nice reports):
============================= test session starts ==============================
platform linux -- Python 3.9.20, pytest-7.4.4, pluggy-1.5.0
rootdir: /home/runner/work/optimum-intel/optimum-intel
configfile: pyproject.toml
plugins: timeout-2.3.1, xdist-3.6.1
collected 37 items

tests/openvino/test_training.py sssssssssssssssssssssssssssssss          [ 83%]
tests/openvino/test_training_examples.py ssssss                          [100%]

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@IlyasMoutawwakil IlyasMoutawwakil added the openvino-test Trigger OpenVINO slow tests label Oct 27, 2024
Comment on lines 21 to 29
test_pattern:
[
"*modeling.py",
"*modeling_diffusion.py",
"*modeling_sentence_transformers.py",
"*quantization*",
"*training*",
"*export*",
]
Copy link
Member Author

Choose a reason for hiding this comment

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

this one gives a maximum test time of 20 minutes, the alternative:

        test_pattern:
          [
            "test_modeling*",
            "test_quantization*",
            "test_training*",
            "test_export*",
          ]

takes 40 minutes, and the original tests/openvino/* takes 1 hour 10 minutes

@IlyasMoutawwakil IlyasMoutawwakil marked this pull request as ready for review October 28, 2024 10:49
Copy link
Collaborator

@echarlaix echarlaix left a comment

Choose a reason for hiding this comment

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

Looks great thanks @IlyasMoutawwakil !

.github/workflows/build_pr_documentation.yml Show resolved Hide resolved
.github/workflows/test_generation.yml Outdated Show resolved Hide resolved
.github/workflows/test_openvino.yml Show resolved Hide resolved
Comment on lines +421 to +424
if hasattr(pipelines, module_name):
module = getattr(pipelines, module_name)
else:
module = importlib.import_module(module_name)
Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -55,18 +55,15 @@
"tiktoken",
"sentence-transformers",
"open_clip_torch>=2.26.1",
"peft",
Copy link
Member Author

Choose a reason for hiding this comment

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

added at test time to see if it breaks any diffusion related stuff.

Copy link
Collaborator

Choose a reason for hiding this comment

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

probably good to align lowerbound with diffusers
https://github.com/huggingface/diffusers/blob/main/setup.py#L118

"nncf": ["nncf>=2.11.0"],
"openvino": ["nncf>=2.11.0", "openvino==2024.4.1.dev20240926", "openvino-tokenizers==2024.4.1.0.dev20240926"],
Copy link
Member Author

Choose a reason for hiding this comment

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

is there a reason why these versions are pinned ?

Copy link
Collaborator

@eaidova eaidova Nov 4, 2024

Choose a reason for hiding this comment

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

yes, it is done because issues with openvino 2024.4.0, 2024.4.1 contains fixing for it, but this package is not released yet, prerelease packages can not be installed in pip without --pre (this approach does not work with setup.py, the only solution to use strict version). We have AR to unpin it when release package will be released

- if: ${{ matrix.test-pattern == '*modeling*' }}
name: Uninstall NNCF
run: |
pip uninstall -y nncf
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any reason we uninstall NNCF here? We can help to resolve if there are any issues caused by the NNCF presence.

Copy link
Member Author

@IlyasMoutawwakil IlyasMoutawwakil Nov 4, 2024

Choose a reason for hiding this comment

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

No issue, just to make sure NNCF is not a dep for OV modeling, I guess this was the case at some point then nncf was added to ov extras. Also #975 (comment)

run: |
pip install transformers==${{ matrix.transformers-version }} accelerate==0.*

- if: ${{ matrix.test-pattern == '*modeling*' }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

@IlyasMoutawwakil, could you please tell a little bit more about idea behind precommit changes? I correctly understand that you split precommit on several independent workflow?

I'm wondering is there really need to remove nncf during modeling testing here and can be some cases when both modeling and quantization runs in the same time

Copy link
Member Author

@IlyasMoutawwakil IlyasMoutawwakil Nov 4, 2024

Choose a reason for hiding this comment

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

could you please tell a little bit more about idea behind precommit changes? I correctly understand that you split precommit on several independent workflow?

Yes, the number of tests results in ~1h20min wait time for openvino per-commit tests. So the idea is to distribute it.

I'm wondering is there really need to remove nncf during modeling testing here

My understanding from https://github.com/huggingface/optimum-intel/pull/975/files#r1822437311 is that modeling tests should pass without nncf (they do), by uninstalling it, we're making sure that's the case.

Copy link
Collaborator

@nikita-savelyevv nikita-savelyevv left a comment

Choose a reason for hiding this comment

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

These are useful changes, thank you!

.github/workflows/test_openvino_basic.yml Show resolved Hide resolved
.github/workflows/test_openvino_slow.yml Outdated Show resolved Hide resolved
Comment on lines +27 to +30
os: ["ubuntu-22.04", "windows-2019"]
openvino-version: ["stable", "nightly"]
transformers-version: ["4.36.0", "latest"]
nncf: ["nncf", "git+https://github.com/openvinotoolkit/nncf.git"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

To be honest, I don't think all these 16 combinations are strictly necessary.

It also so happens that I've just started working on introducing a separate OV workflow to run not only slow OV tests, but all OV tests: #985. This is because during slow tests almost none quantization-related tests are actually run which is especially critical for ensuring nncf develop compatibility.

So after this PR is merged, if there are no objections I would remove ov-nightly and nncf-develop from slow tests in my PR and introduce a separate workflow to test ov-nightly and nncf-develop versions on full OV scope on a single OS and transformers version.

@IlyasMoutawwakil IlyasMoutawwakil merged commit d357376 into main Nov 5, 2024
43 of 46 checks passed
@IlyasMoutawwakil IlyasMoutawwakil deleted the optimize-ci branch November 5, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openvino-test Trigger OpenVINO slow tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants