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

Update imports in examples/notebooks #687

Merged

Conversation

helena-intel
Copy link
Collaborator

Update examples/notebooks to use from optimum.intel import ... instead of from optimum.intel.openvino import .... This is best practice, and it prevents difficult to debug errors. For example, if accelerate is not installed and you import OVTrainer, you get a friendly error with the new import but not with the old version.

Also

  • added accelerate to example requirements
  • updated Ubuntu/Python versions in the workflow files.
  • fixed running example tests on changing example files

@AlexKoff88 unrelated to this PR, the audio classification example fails with this error:

FAILED examples/openvino/test_examples.py::TestExamples::test_audio_classification - nncf.errors.ValidationError: No match has been found among the model operations for the following ignored/target scope definitions:
 - ignored_scope: ['{re}.*__truediv__.*', '{re}.*matmul_1']
Refer to the original_graph.dot to discover the operations in the model currently visible to NNCF and specify the ignored/target scopes in terms of the names there.

`from optimum.intel.openvino import ...` -> `from optimum.intel import ...`
@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.

@helena-intel helena-intel force-pushed the helena/update-examples-imports branch from ba106c2 to 42d8a8a Compare April 24, 2024 18:22
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 good, thanks @helena-intel !!

@echarlaix
Copy link
Collaborator

Can you take a look at the failing test_audio_classification examples before we can merge @helena-intel ?

@helena-intel
Copy link
Collaborator Author

Can you take a look at the failing test_audio_classification examples before we can merge @helena-intel ?

It looks like the issue is caused by the nncf_compression_config not being used. In https://github.com/huggingface/optimum-intel/blob/main/optimum/intel/openvino/configuration.py#L313 compression is set to None. I changed it to kwargs.get("compression", None).

@echarlaix
Copy link
Collaborator

thanks a lot for the fix @helena-intel

@echarlaix echarlaix merged commit 33fc7b7 into huggingface:main Apr 25, 2024
12 of 15 checks passed
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