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

fix deprecated arg shared_memory #499

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion optimum/intel/openvino/modeling_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def forward(
inputs["position_ids"] = position_ids

# Run inference
self.request.start_async(inputs, shared_memory=True)
self.request.start_async(inputs, share_inputs=True)
self.request.wait()
logits = torch.from_numpy(self.request.get_tensor("logits").data).to(self.device)

Expand Down
8 changes: 4 additions & 4 deletions optimum/intel/openvino/modeling_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ def __call__(self, input_ids: np.ndarray):
inputs = {
"input_ids": input_ids,
}
outputs = self.request(inputs, shared_memory=True)
outputs = self.request(inputs, share_inputs=True)
return list(outputs.values())


Expand Down Expand Up @@ -604,7 +604,7 @@ def __call__(
if timestep_cond is not None:
inputs["timestep_cond"] = timestep_cond

outputs = self.request(inputs, shared_memory=True)
outputs = self.request(inputs, share_inputs=True)
return list(outputs.values())


Expand All @@ -620,7 +620,7 @@ def __call__(self, latent_sample: np.ndarray):
inputs = {
"latent_sample": latent_sample,
}
outputs = self.request(inputs, shared_memory=True)
outputs = self.request(inputs, share_inputs=True)
return list(outputs.values())

def _compile(self):
Expand All @@ -641,7 +641,7 @@ def __call__(self, sample: np.ndarray):
inputs = {
"sample": sample,
}
outputs = self.request(inputs, shared_memory=True)
outputs = self.request(inputs, share_inputs=True)
return list(outputs.values())

def _compile(self):
Expand Down
8 changes: 4 additions & 4 deletions optimum/intel/openvino/quantization.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,18 +304,18 @@ def __call__(self, *args, **kwargs):
data_cache.append(*args)
return self.request(*args, *kwargs)

def infer(self, inputs: Any = None, shared_memory: bool = False):
def infer(self, inputs: Any = None, share_inputs: bool = False):
data_cache.append(inputs)
return self.request.infer(inputs, shared_memory)
return self.request.infer(inputs, share_inputs)

def start_async(
self,
inputs: Any = None,
userdata: Any = None,
shared_memory: bool = False,
share_inputs: bool = False,
):
data_cache.append(inputs)
self.request.infer(inputs, shared_memory)
self.request.infer(inputs, share_inputs)

def wait(self):
pass
Expand Down
Loading