openvinotoolkit / openvino

本文为原文前 6,000 字符的节选翻译,完整内容请查看原文。

Open-source software toolkit for optimizing and deploying deep learning models. Documentation • Blog • Key Features • Tutorials • Integrations • Benchmarks • Generative AI Inference Optimization: Boost deep learning performance in computer vision, automatic speech recognition, generative AI, natural language processing with large and small language models, and many other common tasks.

用于优化和部署深度学习模型的开源软件工具包。文档 • 博客 • 关键特性 • 教程 • 集成 • 基准测试 • 生成式 AI 推理优化:提升计算机视觉、自动语音识别、生成式 AI、自然语言处理(包括大语言模型和小语言模型)以及许多其他常见任务中的深度学习性能。

Flexible Model Support: Use models trained with popular frameworks such as PyTorch, TensorFlow, ONNX, Keras, PaddlePaddle, and JAX/Flax. Directly integrate models built with transformers and diffusers from the Hugging Face Hub using Optimum Intel. Convert and deploy models without original frameworks.

灵活的模型支持:使用通过 PyTorch、TensorFlow、ONNX、Keras、PaddlePaddle 和 JAX/Flax 等主流框架训练的模型。通过 Optimum Intel 直接集成来自 Hugging Face Hub 的 transformers 和 diffusers 模型。无需原始框架即可转换和部署模型。

Broad Platform Compatibility: Reduce resource demands and efficiently deploy on a range of platforms from edge to cloud. OpenVINO™ supports inference on CPU (x86, ARM), GPU (Intel integrated & discrete GPU) and AI accelerators (Intel NPU).

广泛的平台兼容性:降低资源需求,并在从边缘到云端的各种平台上高效部署。OpenVINO™ 支持在 CPU(x86、ARM)、GPU(英特尔集成显卡和独立显卡)以及 AI 加速器(英特尔 NPU)上进行推理。

Community and Ecosystem: Join an active community contributing to the enhancement of deep learning performance across various domains. Check out the OpenVINO Cheat Sheet and Key Features for a quick reference.

社区与生态系统:加入一个活跃的社区,为提升各领域的深度学习性能做出贡献。查看 OpenVINO 速查表和关键特性以获取快速参考。

Installation: Get your preferred distribution of OpenVINO or use this command for quick installation: pip install -U openvino. Verify Installation: After installation, you can verify OpenVINO is installed correctly by running: import openvino as ov; print(ov.version). Check system requirements and supported devices for detailed information.

安装:获取您首选的 OpenVINO 发行版,或使用此命令进行快速安装:pip install -U openvino。验证安装:安装完成后,您可以通过运行以下代码验证 OpenVINO 是否安装正确:import openvino as ov; print(ov.version)。请查看系统要求和支持的设备以获取详细信息。

Tutorials and Examples: OpenVINO Quickstart example will walk you through the basics of deploying your first model. Learn how to optimize and deploy popular models with the OpenVINO Notebooks 📚: Create an LLM-powered Chatbot using OpenVINO, YOLOv11 Optimization, Text-to-Image Generation, Multimodal assistant with LLaVa and OpenVINO, Automatic speech recognition using Whisper and OpenVINO. Discover more examples in the OpenVINO Samples (Python & C++) and Notebooks (Python).

教程与示例:OpenVINO 快速入门示例将引导您了解部署第一个模型的基础知识。通过 OpenVINO Notebooks 📚 学习如何优化和部署热门模型:使用 OpenVINO 创建基于大语言模型的聊天机器人、YOLOv11 优化、文生图生成、结合 LLaVa 和 OpenVINO 的多模态助手、使用 Whisper 和 OpenVINO 进行自动语音识别。在 OpenVINO 示例(Python 和 C++)和 Notebooks(Python)中探索更多案例。

Here are easy-to-follow code examples demonstrating how to run PyTorch and TensorFlow model inference using OpenVINO: PyTorch Model: import openvino as ov; import torch; import torchvision; # load PyTorch model into memory; model = torch.hub.load(“pytorch/vision”, “shufflenet_v2_x1_0”, weights=“DEFAULT”); # convert the model into OpenVINO model; example = torch.randn(1, 3, 224, 224); ov_model = ov.convert_model(model, example_input=(example,)); # compile the model for CPU device; core = ov.Core(); compiled_model = core.compile_model(ov_model, ‘CPU’); # infer the model on random data; output = compiled_model({0: example.numpy()}).

以下是演示如何使用 OpenVINO 运行 PyTorch 和 TensorFlow 模型推理的易于遵循的代码示例:PyTorch 模型:import openvino as ov; import torch; import torchvision; # 将 PyTorch 模型加载到内存中; model = torch.hub.load(“pytorch/vision”, “shufflenet_v2_x1_0”, weights=“DEFAULT”); # 将模型转换为 OpenVINO 模型; example = torch.randn(1, 3, 224, 224); ov_model = ov.convert_model(model, example_input=(example,)); # 为 CPU 设备编译模型; core = ov.Core(); compiled_model = core.compile_model(ov_model, ‘CPU’); # 在随机数据上进行模型推理; output = compiled_model({0: example.numpy()})。

TensorFlow Model: import numpy as np; import openvino as ov; import tensorflow as tf; # load TensorFlow model into memory; model = tf.keras.applications.MobileNetV2(weights=‘imagenet’); # convert the model into OpenVINO model; ov_model = ov.convert_model(model); # compile the model for CPU device; core = ov.Core(); compiled_model = core.compile_model(ov_model, ‘CPU’); # infer the model on random data; data = np.random.rand(1, 224, 224, 3); output = compiled_model({0: data}).

TensorFlow 模型:import numpy as np; import openvino as ov; import tensorflow as tf; # 将 TensorFlow 模型加载到内存中; model = tf.keras.applications.MobileNetV2(weights=‘imagenet’); # 将模型转换为 OpenVINO 模型; ov_model = ov.convert_model(model); # 为 CPU 设备编译模型; core = ov.Core(); compiled_model = core.compile_model(ov_model, ‘CPU’); # 在随机数据上进行模型推理; data = np.random.rand(1, 224, 224, 3); output = compiled_model({0: data})。

OpenVINO supports the CPU, GPU, and NPU devices and works with models from PyTorch, TensorFlow, ONNX, TensorFlow Lite, PaddlePaddle, and JAX/Flax frameworks. It includes APIs in C++, Python, C, NodeJS, and offers the GenAI API for optimized model pipelines and performance.

OpenVINO 支持 CPU、GPU 和 NPU 设备,并适用于来自 PyTorch、TensorFlow、ONNX、TensorFlow Lite、PaddlePaddle 和 JAX/Flax 框架的模型。它包含 C++、Python、C 和 NodeJS 的 API,并提供用于优化模型流水线和性能的 GenAI API。

Generative AI with OpenVINO: Get started with the OpenVINO GenAI installation and refer to the detailed guide to explore the capabilities of Generative AI using OpenVINO. Learn how to run LLMs and GenAI with Samples in the OpenVINO™ GenAI repo. See GenAI in action with Jupyter notebooks: LLM-powered Chatbot and LLM Instruction-following pipeline.

使用 OpenVINO 进行生成式 AI:开始安装 OpenVINO GenAI,并参考详细指南以探索使用 OpenVINO 的生成式 AI 功能。通过 OpenVINO™ GenAI 仓库中的示例学习如何运行大语言模型和生成式 AI。通过 Jupyter Notebook 查看生成式 AI 的实际应用:基于大语言模型的聊天机器人和大语言模型指令遵循流水线。

Documentation: User documentation contains detailed information about OpenVINO and guides you from installation through optimizing and deploying models for your AI applications. Developer documentation focuses on the OpenVINO architecture and describes building and contributing processes.

文档:用户文档包含有关 OpenVINO 的详细信息,指导您完成从安装到为 AI 应用优化和部署模型的全过程。开发者文档侧重于 OpenVINO 架构,并描述了构建和贡献流程。

OpenVINO Ecosystem: OpenVINO Tools: Neural Network Compression Framework (NNCF) - advanced model optimization techniques including quantization, and sparsity. GenAI Repository and OpenVINO Tokenizers - resources and tools for developing and optimizing Generative AI applications. OpenVINO™ Model Server (OVMS) - a scalable, high-performance solution for serving models optimized for Intel architectures. Intel® Geti™ - an interactive video and image annotation tool for computer vision use cases.

OpenVINO 生态系统:OpenVINO 工具:神经网络压缩框架 (NNCF) - 包括量化和稀疏化在内的高级模型优化技术。GenAI 仓库和 OpenVINO Tokenizers - 用于开发和优化生成式 AI 应用的资源和工具。OpenVINO™ 模型服务器 (OVMS) - 一种可扩展的高性能解决方案,用于服务针对英特尔架构优化的模型。Intel® Geti™ - 一种用于计算机视觉用例的交互式视频和图像标注工具。

Integrations: 🤗Optimum Intel - grab and use models leveraging OpenVINO within the Hugging Face API. Torch.compile - use OpenVINO for Python-native applications by JIT-compiling code into optimized kernels. ExecuTorch - use ExecuTorch with OpenVINO to optimize and run AI models efficiently. OpenVINO LLMs inference and serving with vLLM - enhance vLLM’s fast and easy model serving with the OpenVINO backend.

集成:🤗Optimum Intel - 在 Hugging Face API 中获取并使用利用 OpenVINO 的模型。Torch.compile - 通过将代码即时编译 (JIT) 为优化内核,将 OpenVINO 用于 Python 原生应用。ExecuTorch - 将 ExecuTorch 与 OpenVINO 结合使用,以高效优化和运行 AI 模型。使用 vLLM 进行 OpenVINO 大语言模型推理和服务 - 通过 OpenVINO 后端增强 vLLM 快速且简便的模型服务能力。

OpenVINO Execution Provider for ONNX Runtime - use OpenVINO as a backend with your existing ONNX Runtime code. LLMWare - seamlessly build enterprise AI apps, agentic workflows, RAG pipelines, multimodal use cases, and more, using 100+ inference-ready OpenVINO-optimized SLMs. LlamaIndex - build context-augmented GenAI applications with the LlamaIndex framework and enhance runtime performance with OpenVINO. LangChain - integrate OpenVINO with the LangChain framework to enhance runtime performance for GenAI applications. Keras 3 - Keras 3 is a multi-backend deep learning framework. Users can switch model inference to the OpenVINO backend using the Keras API. Check out the Awesome OpenVINO repository to discover a collection of community-made AI projects based on OpenVINO!

ONNX Runtime 的 OpenVINO 执行提供程序 - 将 OpenVINO 作为后端与您现有的 ONNX Runtime 代码一起使用。LLMWare - 使用 100 多个可直接推理且经过 OpenVINO 优化的 SLM(小语言模型),无缝构建企业级 AI 应用、智能体工作流、RAG 流水线、多模态用例等。LlamaIndex - 使用 LlamaIndex 框架构建上下文增强的生成式 AI 应用,并利用 OpenVINO 提升运行时性能。LangChain - 将 OpenVINO 与 LangChain 框架集成,以提升生成式 AI 应用的运行时性能。Keras 3 - Keras 3 是一个多后端深度学习框架。用户可以使用 Keras API 将模型推理切换到 OpenVINO 后端。查看 Awesome OpenVINO 仓库,探索基于 OpenVINO 的社区 AI 项目合集!

Performance: Explore OpenVINO Performance Benchmarks to discover the optimal hardware configurations and plan your AI deployment based on verified data. Contribution and Support: Check out Contribution Guidelines for more details. Read the Good First Issues section, if you’re looking for a place to start contributing. We welcome contributions of all kinds!

性能:探索 OpenVINO 性能基准测试,以发现最佳硬件配置,并根据验证过的数据规划您的 AI 部署。贡献与支持:查看贡献指南以获取更多详细信息。如果您正在寻找贡献的切入点,请阅读“Good First Issues”部分。我们欢迎各种形式的贡献!