跳到主要內容
支援知識庫

當執行多個程序時,OpenVINO™ 推論時間會增加

內容類型: 產品資訊與文件   |   文章 ID: 000058227   |   最近查看日期: 2026 year 03 month 06 day

環境

Ubuntu OpenVINO 2024.0

說明

當執行兩個程序以推論同一模型時,推論時間會加倍。

  • 使用 OpenVINO™ 來推斷模型。
  • 執行單一程序時,推論時間約為 300 毫秒。
  • 使用兩個程序時,兩個程序的推論時間均為 600ms。

解決方法

  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. 建立 示範。
ov::hint::enable_cpu_pinning 屬性自 OpenVINO™ 2024.0 起取代了舊有的 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 個產品。

免責聲明

這個頁面的內容綜合了英文原始內容的人工翻譯譯文與機器翻譯譯文。本內容是基於一般資訊目的,方便您參考而提供,不應視同完整或準確的內容。如果這個頁面的英文版與譯文之間發生任何牴觸,將受英文版規範及管轄。 查看這個頁面的英文版。