-
Notifications
You must be signed in to change notification settings - Fork 6
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
Enable no-copy API in Model API OVMS Adapter to optimize Embedding endpoint #92
Conversation
OVMS_BUFFERTYPE_CPU, | ||
NOT_USED_NUM)); | ||
} | ||
for (const auto& [name, input_tensor] : output) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (const auto& [name, input_tensor] : output) { | |
for (const auto& [name, output_tensor] : output) { |
if (std::find(outputsSet.begin(), outputsSet.end(), outputName) == outputsSet.end()) { | ||
output.emplace(outputName, std::move(makeOvTensor(datatype, shape, dimCount, voutputData, bytesize))); | ||
} else { | ||
//output.emplace(outputName, input.at(outputName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it mean that we only get selected outputs?
@@ -213,6 +324,21 @@ ov::PartialShape OVMSInferenceAdapter::getInputShape(const std::string& inputNam | |||
} | |||
return ovShape; | |||
} | |||
ov::PartialShape OVMSInferenceAdapter::getOutputShape(const std::string& inputName) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ov::PartialShape OVMSInferenceAdapter::getOutputShape(const std::string& inputName) const { | |
ov::PartialShape OVMSInferenceAdapter::getOutputShape(const std::string& outputName) const { |
auto it = outShapesMinMaxes.find(inputName); | ||
if (it == outShapesMinMaxes.end()) { | ||
LOG(INFO) << "Could not find input:" << inputName; | ||
throw std::runtime_error(std::string("Adapter could not find input:") + inputName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw std::runtime_error(std::string("Adapter could not find input:") + inputName); | |
throw std::runtime_error(std::string("Adapter could not find output:") + outputName); |
@@ -213,6 +324,21 @@ ov::PartialShape OVMSInferenceAdapter::getInputShape(const std::string& inputNam | |||
} | |||
return ovShape; | |||
} | |||
ov::PartialShape OVMSInferenceAdapter::getOutputShape(const std::string& inputName) const { | |||
auto it = outShapesMinMaxes.find(inputName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto it = outShapesMinMaxes.find(inputName); | |
auto it = outShapesMinMaxes.find(outputName); |
4de817b
to
d493e4e
Compare
d493e4e
to
f005f1a
Compare
if (std::find(outputsSet.begin(), outputsSet.end(), outputName) == outputsSet.end()) { | ||
output.emplace(outputName, std::move(makeOvTensor(datatype, shape, dimCount, voutputData, bytesize))); | ||
} else { | ||
//output.emplace(outputName, input.at(outputName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should probably be removed
Related changes:
openvinotoolkit/model_server#2763
openvinotoolkit/model_api#212
Ticket: CVS-155477