Microsoft Olive Documentation

repository·main·Indexed 25 days ago

https://github.com/microsoft/olive

Olive (Onnx LIVE) is an AI Model Optimization Toolkit for the ONNX Runtime. It provides tools to compose optimal optimization techniques for specific models and target hardware to produce efficient ONNX models for cloud or edge inference. The toolkit includes an automatic optimizer, a Model Context Protocol (MCP) server for AI assistants, and capabilities for quantization (RTN, GPTQ, AWQ, HQQ), LoRA/QLoRA fine-tuning, and benchmarking.

Tokens
98.3K
Snippets
257
Records
478
Agent score
78%

What's inside Olive

  1. Key features and capabilities of Olive

    main

    Olive provides several high-level capabilities for model deployment and optimization:

    • Automated Optimization: Reduces manual trial-and-error for graph optimization, compression, and quantization by automatically finding the best parameters for a defined target and precision.
    • Extensive Component Library: Includes over 40 built-in optimization components for quantization, compression, graph optimization, and finetuning.
    • Orchestration: Users can use an easy-to-use CLI for common tasks or construct complex workflows using YAML/JSON files to orchestrate model transformations.
    • Deployment Support: Built-in model packaging, deployment, and support for Multi LoRA serving.
    • Integrations: Native support for Hugging Face and Azure AI.
    • Productivity: Includes a built-in caching mechanism to speed up optimization workflows.
  2. What is Olive and how does it work?

    main

    Olive (ONNX LIVE) is a model optimization toolkit and CLI designed to optimize models (typically PyTorch or Hugging Face) for the ONNX runtime. It targets specific deployment hardware (NPUs, GPUs, CPUs) from vendors like Qualcomm, AMD, Nvidia, or Intel.

    Core Concepts

    • Workflow: An ordered sequence of optimization tasks.
    • Passes: Individual optimization tasks within a workflow, such as model compression, graph capture, quantization, and graph optimization.
    • Evaluator: A component that measures metrics like accuracy and latency to determine the quality of a pass.
    • Search Strategy & Sampler: Mechanisms used to auto-tune pass parameters to find the optimal balance of performance and quality.
    • Deployment Target: The specific AI accelerator (NPU, GPU, CPU) for which the model is being optimized.