Skip to content

Conversation

alexandruenache1111
Copy link
Contributor

Details:

  • Moving serializeIR, serializeIOInfo, serializeConfig, checkedMemcpy, ovPrecisionToLegacyPrecisionString, and rankToLegacyLayoutString from driver_compiler_adapter to ir_serializer.
  • Having these standalone functions allows us to call them in other places in a simpler manner.

Tickets:

  • C-174108

@alexandruenache1111 alexandruenache1111 requested review from a team as code owners September 29, 2025 08:50
@alexandruenache1111 alexandruenache1111 self-assigned this Sep 29, 2025
@github-actions github-actions bot added the category: NPU OpenVINO NPU plugin label Sep 29, 2025
* before copying.
* @details This is meant as a replacement for the legacy "ie_memcpy" function coming from the OpenVINO API.
*/
void checkedMemcpy(void* destination, size_t destinationSize, const void* source, size_t numberOfBytes);
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this part of the header as well?

#include "custom_stream_buffer.hpp"
#include "intel_npu/utils/logger/logger.hpp"
#include "openvino/pass/manager.hpp"
#include "ze_graph_ext_wrappers.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this really needed here?

* API, the layout fields shall be filled with default values in order to assure the backward compatibility
* with the driver.
*/
SerializedIR serializeIR(const std::shared_ptr<const ov::Model>& model,
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this a global function and not part of the IRSerializer?

* @brief For driver backward compatibility reasons, the given value shall be converted to a string corresponding to the
* adequate legacy precision.
*/
std::string ovPrecisionToLegacyPrecisionString(const ov::element::Type& precision);
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this needed in the .hpp?

* the default one may lead either to error or to accuracy failures since unwanted transposition layers may be
* introduced.
*/
std::string rankToLegacyLayoutString(const size_t rank);
Copy link
Contributor

Choose a reason for hiding this comment

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

same question

*/
std::string rankToLegacyLayoutString(const size_t rank);

std::string serializeIOInfo(const std::shared_ptr<const ov::Model>& model, const bool useIndices);
Copy link
Contributor

Choose a reason for hiding this comment

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

why isn't this part of the IRSerializer class?


std::string serializeIOInfo(const std::shared_ptr<const ov::Model>& model, const bool useIndices);

std::string serializeConfig(const Config& config,
Copy link
Contributor

Choose a reason for hiding this comment

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

same question.

Copy link
Contributor

@XinWangIntel XinWangIntel left a comment

Choose a reason for hiding this comment

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

LGTM, we use dedicated function to support flex version control in driver compiler adapter before. Since #32121 removed support for some old ext versions, refactor also work for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: NPU OpenVINO NPU plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants