Olive
Copilot instructions2.4k starsChanged 15 months agoMITView on GitHub
Microsoft Olive is a Python-based AI model optimization toolkit for the ONNX Runtime. It provides 40+ built-in optimization components for model compression, optimization, fine-tuning, and compilation. Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
- Installs packages
Trending
Quiet since September.about the whole repository
Who's talking about microsoft/Olive
- A Hacker News story“Microsoft Olive: an easy-to-use hardware-aware model optimization tool”Hacker News · May 26, 2024 · 12 points
- microsoft/onnxruntime-inference-examples“js/ort-whisper example is broken due to missing operator, ai.onnx.contrib:BpeDecoder.”GitHub · May 8, 2025 · 2 reactions
- microsoft/onnxruntime-genai“KeyError for torch.uint8 in make_tensor_proto_from_tensor due to missing dtype mapping”GitHub · Jun 16, 2025 · 1 reactions
- microsoft/onnxruntime-inference-examples“whisper web example fails setup due to missing olive dependency”GitHub · May 23, 2025 · 1 reactions
- microsoft/onnxruntime“[DmlEP] BeamSearch node is not supported for DmlEP?”GitHub · Dec 13, 2023 · 1 reactions
The biggest 5 of 17 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 17
Talked about on GitHub and Hacker News (17 times).
On GitHub · 16
- May 8, 2025js/ort-whisper example is broken due to missing operator, ai.onnx.contrib:BpeDecoder. — microsoft/onnxruntime-inference-examples2 reactions · 1 comment
- Jun 16, 2025KeyError for torch.uint8 in make_tensor_proto_from_tensor due to missing dtype mapping — microsoft/onnxruntime-genai1 reaction
- May 23, 2025whisper web example fails setup due to missing olive dependency — microsoft/onnxruntime-inference-examples1 reaction
- Dec 13, 2023[DmlEP] BeamSearch node is not supported for DmlEP? — microsoft/onnxruntime1 reaction · 6 comments
- Sep 23, 2026docs(js/ort-whisper): add olive installation instructions and fix broken Olive link — microsoft/onnxruntime-inference-examples0 reactions
11 more on GitHub
- Sep 1, 2026revert qnn gpu — microsoft/olive-recipes0 reactions
- Jul 24, 2026Add defensive ndim==2 guard in preprocess_olive_weights to reject Olive moe=True 3D expert checkpoints — onnxruntime/mobius0 reactions · 2 comments
- Jul 14, 2026update amd again - revert previous update — microsoft/olive-recipes0 reactions
- Jun 11, 2026ModelBuilder support use_cache=False and hidden_states_layers — microsoft/onnxruntime-genai0 reactions
- May 29, 2026[AMD] Add RyzenAI token-fusion recipes; Restore legacy VitisAI eager recipes — microsoft/olive-recipes0 reactions · 7 comments
- May 5, 2026Gemma4 ONNX + CUDA support: all PRs tracker — onnxruntime/mobius0 reactions · 6 comments
- Apr 8, 2025Incorrect output shape for logits output returned from get_output("logits") — microsoft/onnxruntime-genai0 reactions · 6 comments
- Dec 8, 2024auto quantization of big arrays on computation — beehive-lab/TornadoVM0 reactions · 1 comment
- Feb 26, 2024【任务】模型量化 — NascentCore/3k0 reactions · 4 comments
- Aug 10, 2023Error Node (BeamSearch_node) has input size 12 not in range [min=5, max=10] — onnxruntime/Whisper-HybridLoop-Onnx-Demo0 reactions · 1 comment
- Jul 2, 2023Add DirectML Support on Windows — painebenjamin/app.enfugue.ai0 reactions
On Hacker News · 1
- May 26, 2024Microsoft Olive: an easy-to-use hardware-aware model optimization tool12 points
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
13 rules. About 0 are common, 7 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does …
- Very specific: line 28
Test CLI functionality: olive optimize --help and olive auto-opt --help
- Distinctive: line 35
When network issues occur, focus on local functionality and offline validation
- Very specific: line 40
ALWAYS run lintrunner before committing changes or the CI (.github/workflows/lint.yml) will fail
- Very specific: line 41
Test basic functionality: python -c "import olive.
- Very specific: line 45
Test package import and version: python -c "import olive.
- Very specific: line 47
Test dry run mode: olive optimize --dry_run --model_name_or_path <model> --precision int4
- Distinctive: line 57
Test dependencies install: FAILS due to network timeouts - expect 20+ minute installs in normal environments
- Distinctive: line 97
Test dependency installation may timeout due to network issues
- Very specific: line 98
Use --dry_run mode for configuration validation without network access
- Distinctive: line 102
When network connectivity is limited:
- Distinctive: line 103
Use local model paths instead of HuggingFace model names
- Distinctive: line 105
Test CLI help commands and basic imports
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Microsoft Olive - AI Model Optimization Toolkit
Microsoft Olive is a Python-based AI model optimization toolkit for the ONNX Runtime. It provides 40+ built-in optimization components for model compression, optimization, fine-tuning, and compilation.
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
Working Effectively
Bootstrap the Development Environment
- Install basic dependencies:
pip install -r requirements.txt-- takes 3 minutes. NEVER CANCEL. Set timeout to 10+ minutes. - Install Olive in development mode:
pip install -e .-- takes 10 seconds. - Install development dependencies:
pip install -r requirements-dev.txt-- takes 20 seconds. - Initialize linting:
lintrunner init-- takes 15 seconds.
Build and Test Commands
- Lint code:
lintrunner-- takes 1-2 seconds for single files, 5+ seconds for entire codebase. NEVER CANCEL. - Lint with auto-fix:
lintrunner --all-files -a - Import test:
python -c "import olive; print('Olive version:', olive.__version__)"
Command Line Interface
- Main CLI entry point:
olive --help - Key commands:
olive optimize-- Comprehensive model optimization with pass schedulingolive auto-opt-- Automatic optimization with minimal configurationolive finetune-- Fine-tune models using PEFTolive quantize-- Quantize modelsolive capture-onnx-graph-- Export models to ONNX format
- Test CLI functionality:
olive optimize --helpandolive auto-opt --help - Dry run mode:
olive optimize --dry_run(validates configuration without execution)
Network Limitations
- CRITICAL: The environment has limited network connectivity
- HuggingFace model downloads may fail with connection errors
- PyPI package installations may timeout - use longer timeouts (10-20 minutes) for ML packages
- When network issues occur, focus on local functionality and offline validation
Validation
Pre-commit Validation
- ALWAYS run
lintrunnerbefore committing changes or the CI (.github/workflows/lint.yml) will fail - Test basic functionality:
python -c "import olive; print(olive.__version__)" - Validate CLI:
olive --help
Manual Testing Scenarios
- Test package import and version:
python -c "import olive; print('Version:', olive.__version__)" - Validate CLI help commands work:
olive --help,olive optimize --help,olive auto-opt --help - Test dry run mode:
olive optimize --dry_run --model_name_or_path <model> --precision int4 - Note: Full model optimization requires network access for HuggingFace downloads
Expected Timing and Timeout Values
- NEVER CANCEL: Basic requirements install: 3 minutes (set timeout to 10+ minutes)
- Development install: 10 seconds (set timeout to 60 seconds)
- Dev dependencies: 20 seconds (set timeout to 300 seconds)
- Lintrunner init: 15 seconds (set timeout to 600 seconds)
- Linting single file: 1-2 seconds
- Linting full codebase: 5-10 seconds (set timeout to 300 seconds)
- Test dependencies install: FAILS due to network timeouts - expect 20+ minute installs in normal environments
Common Tasks
Repository Structure
olive/-- Main package directory with core functionalitytest/-- Test suite with requirements-test*.txt filesdocs/-- Documentation.github/workflows/-- CI/CD pipelines (lint.yml, codeql.yml)olive/passes/onnx-- Directory of ONNX transformations passesolive/passes/pytorch-- Directory of Pytorch passesolive/data-- Data configurations and data containersolive/evaluator-- Evaluator to measure quality and performanceolive/model-- Model handlersolive/search-- Search algorithmsolive/systems-- Host and target systemsolive/engine-- Core engine responsible for executing the workflowolive/cli-- Command line tools to prepare and drive the workflow
Key Configuration Files
pyproject.toml-- Modern Python packaging configuration with ruff, pylint, pytest settingssetup.py-- Package setup and console_scripts entry pointrequirements*.txt-- Dependency specifications.lintrunner.toml-- Linting configurationolive_config.json-- Olive package extras configuration
Python Package Information
- Package name:
olive-ai - Python version: 3.10+ (currently testing on 3.12)
- Entry point:
olivecommand (defined in setup.py console_scripts) - Version location:
olive/__init__.py(version)
Development Workflow
- Code style: Black formatter with 120 character line limit
- Linting: Multiple tools via lintrunner (ruff, pylint, editorconfig-checker, etc.)
- Testing: pytest framework (note: full test suite requires network access)
- Pre-commit hooks: Available via .pre-commit-config.yaml
Known Issues and Workarounds
- Network connectivity may prevent HuggingFace model downloads
- Test dependency installation may timeout due to network issues
- Use
--dry_runmode for configuration validation without network access - Focus on local testing and validation when network is unreliable
Working Offline
When network connectivity is limited:
- Use local model paths instead of HuggingFace model names
- Focus on configuration validation with
--dry_runmode - Test CLI help commands and basic imports
- Validate linting and code formatting
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

