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

Apply new Python API features from OpenVINO 2023.0 release #265

Merged
merged 13 commits into from
Jun 1, 2023

Conversation

jiwaszki
Copy link
Contributor

This PR tests features from main branch of OpenVINO including:

  • Shared memory mode for inference calls
  • New return type OVDict that is able to address elements with string values
  • New CompiledModel.__call__ with automatic request creation

This PR can be tested against openvinotoolkit/openvino#16665

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Mar 30, 2023

The documentation is not available anymore as the PR was closed or merged.

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.

It looks much clearer thanks ! Could you update the openvino version in the setup so that we can merge it soon ?

@@ -447,9 +447,8 @@ def __init__(

def _create_inference_request(self):
if self.request is None:
logger.info("Compiling the encoder and creating the inference request ...")
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be great to rename the _create_inference_request method to _compile for stable diffusion models as well to keep uniformity

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed


# Check if inputs are c-like, if not - convert them
input_ids = _contiguous_helper(np.array(input_ids))
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks much clearer now ! Could this also be integrated for OVModelForCausalLM from modeling_decoder.py as well ? happy to do it it in a following PR if not

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I edited it as much as I could. Hopefully it's better now!:)

I am sorry for the late response here. However, now OV is bumped in setup.py and features can be used from the official release.

@jiwaszki jiwaszki changed the title Prepare to OpenVINO 2023.0 release Apply new Python API features from OpenVINO 2023.0 release Jun 1, 2023
@jiwaszki jiwaszki requested a review from echarlaix June 1, 2023 07:45
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.

LGTM, thanks for updating it !

optimum/intel/openvino/modeling_diffusion.py Outdated Show resolved Hide resolved
Co-authored-by: Ella Charlaix <80481427+echarlaix@users.noreply.github.com>
@echarlaix echarlaix merged commit 3ccbb1b into huggingface:main Jun 1, 2023
10 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.

None yet

3 participants