Skip to content

Instantly share code, notes, and snippets.

@mshr-h
Created May 5, 2026 14:53
Show Gist options
  • Select an option

  • Save mshr-h/3bc5492890dc04465a71ce03cbc94e02 to your computer and use it in GitHub Desktop.

Select an option

Save mshr-h/3bc5492890dc04465a71ce03cbc94e02 to your computer and use it in GitHub Desktop.
AGENTS.md for ONNX Development Workspace

ONNX Development Workspace

Environment

  • Venv: ./.venv
  • Python: .venv/bin/python (3.13)
  • ONNX source: ./onnx/

Build

cd onnx
pip install -e . -v                        # Development install
ONNX_BUILD_TESTS=1 pip install -e . -v     # With C++ tests

Linting

lintrunner is configured but may fail in this environment. Use ruff directly:

cd onnx
.venv/bin/python -m ruff format <file>
.venv/bin/python -m ruff check --fix <file>

For C++ files, use clang-format.

Testing

cd onnx
.venv/bin/pytest onnx/test/<test_file>.py -k "<filter>" -v

Common test commands:

# Shape inference tests for FlexAttention
.venv/bin/pytest onnx/test/shape_inference_test.py -k "flex" -v

# Reference evaluator tests
.venv/bin/pytest onnx/test/reference_evaluator_test.py -k "flex" -v

# All tests
.venv/bin/pytest

Auto-Generated Files

When changing operator schemas in onnx/defs/, regenerate docs:

python onnx/defs/gen_doc.py
python onnx/backend/test/stat_coverage.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment