跳转至主要内容
支持知识库

OpenVINO™ 运行多个进程时,推理时间会增加

内容类型: 产品信息和文档   |   文章 ID: 000058227   |   上次审核日期: 2026 年 03 月 06 日

环境

Ubuntu OpenVINO 2024.0

说明

当运行两个进程来推理同一模型时,推理时间会加倍。

  • 使用OpenVINO™推理模型。
  • 运行单个进程时,推理时间约为 300ms。
  • 当使用两个进程时,两个进程的推理时间都变为 600 毫秒。

解决方法

  1. 在应用程序中添加以下配置。
    Python*: core.set_property("CPU", {ov.properties.hint.enable_cpu_pinning(False)})
    C++ : core.set_property("CPU", ov::hint::enable_cpu_pinning(false));
  2. 构建 演示。
注意从 2024.0 OpenVINO™开始, ov::hint::enable_cpu_pinning 属性替换了旧版 CONFIG_KEY(CPU_BIND_THREAD) 参数。

其他信息

  • 默认值 enable_cpu_pinning property is enabled (true or YES) on Linux* and disabled (false or NO) on Windows* and macOS*.
  • Linux 上,默认设置为 enable_cpu_pinning is enabled, which in some scenarios can cause multiple processes to bind to the same CPU core, potentially doubling inference time.
  • 将属性设置为 false unbinds inferencing threads from specific CPU cores, allowing the operating system to schedule threads, which may be beneficial in applications with several parallel workloads.

请参阅 性能提示和线程调度 以了解更多信息。

相关产品

本文适用于 1 产品。

免责声明

本页面上的内容是原始英文内容的人工翻译与计算机翻译的组合。我们提供此内容是为了您的便利并且仅供参考,未必完整或准确。如果本页面的英文版与翻译版之间存在任何冲突,应以英文版为准。 查看此页面的英语版本。