Skip to content

Add optimum Intel® pass for converting a Huggingface Model to an OpenVINO Model#1759

Merged
jambayk merged 16 commits intomicrosoft:mainfrom
kaunain-98:user/aswamin2/optimum_intel
Apr 18, 2025
Merged

Add optimum Intel® pass for converting a Huggingface Model to an OpenVINO Model#1759
jambayk merged 16 commits intomicrosoft:mainfrom
kaunain-98:user/aswamin2/optimum_intel

Conversation

@Anirudh-Swaminathan
Copy link
Contributor

Describe your changes

The changes in this PR are for creating an optimum Intel® pass for converting a Huggingface Model to an OpenVINO model, along with the ability to perform weight compression or quantization if necessary.
The aim is to add in the functionality offered by the optimum-cli export openvino command within Olive.

The changes include the addition of a new pass, unit tests for the pass, a few updates to the other OpenVINO passes, and updates to the documentation files as well.

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.
  • Is this PR including examples changes? If yes, please remember to update example documentation in a follow-up PR.

(Optional) Issue link

Add OpenVINO Optimum Conversion support and update dependencies
Improve warning messages for library name specification and dataset requirement in OpenVINO conversion pass
Improve warning messages for library name specification and dataset requirement in OpenVINO conversion pass
Improve warning message for unspecified library in OpenVINOOptimumConversion
Add documentation for OpenVINO Optimum Conversion and update version requirements.
Also update pass.rst to add in the new pass.
Update test requirements and add unit test for OpenVINO Optimum Conversion pass
Enhance OpenVINOOptimumConversion to handle tokenizer output and improve unit tests
Links now point to pass.rst and to the correct subsection.
…INO passes

Also fix device mapping in Quantization for GPU, which had incorrectly been mapped to CPU so far.
Refactor file handling for GenAI models in OpenVINO passes and update tokenizer model paths
@jambayk
Copy link
Contributor

jambayk commented Apr 17, 2025

Please rebase or merge main to fix the conflicts that came after #1754 was merged. thanks!

@Anirudh-Swaminathan Anirudh-Swaminathan force-pushed the user/aswamin2/optimum_intel branch from caa4688 to 0a2b14b Compare April 17, 2025 18:07
@Anirudh-Swaminathan
Copy link
Contributor Author

Please rebase or merge main to fix the conflicts that came after #1754 was merged. thanks!

Thanks for the heads up! Rebased on top of latest main.

Update formatting in pass.rst for OpenVINOOptimumConversion section
Update OpenVINO documentation links to point to the latest reference URLs and improve error handling in OpenVINOOptimumConversion for missing Diffusers package.
Add enumerations for OpenVINO quantization modes, libraries, frameworks, and weight formats
@xiaoyu-work
Copy link
Collaborator

Good to :shipit: thanks for your change!

Move nncf import to validate_config() to avoid doc build errors.
Add try-except blocks for nncf and optimum imports in OpenVINO conversion.
@xiaoyu-work
Copy link
Collaborator

Format check failed. Can you format the code?

Fix an if condition check for quantization parameters provided without providing quant_mode.
Avoid access using _value2member_map_ protected member for enum. Instead use list comprehension to iterate through all enum values.
@Anirudh-Swaminathan
Copy link
Contributor Author

Format check failed. Can you format the code?

Thanks! The linter warned about _value2member_map_ being a protected member, so had to refactor the enum access via a list comprehension instead now in my latest commit.

@jambayk jambayk merged commit 69e3de5 into microsoft:main Apr 18, 2025
24 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.

3 participants