Skip to content

environment.yml installs PyPI onnxruntime-directml (1.24.x) but EP links pinned ORT (1.25.1) — version mismatch breaks Python EP use #355

Description

@chizamd

Summary

environment.yml installs an unpinned onnxruntime-directml (→ PyPI's latest, currently 1.24.4), but the EP links the ORT version pinned in cmake/deps.txt / CI ONNXRUNTIME_VERSION (currently 1.25.1). PyPI lags the pinned tag, so a fresh conda env create leaves the Python env with an ORT whose C-API version (v24) does not match the EP (v25). Any Python-driven EP use then fails EP registration (The requested API version [25] is not available, only [1, 24] supported) and segfaults (Windows access violation on session create).

Where it bites

  • Pure-ORT Python tests (e.g. test/python/whisper/test_whisper.py, the test/python/test_*.py model suite) import onnxruntime. With the env's 1.24.4 they can't register the EP.
  • The main docs/quick_start.md marks ORT build (§1) and wheel install (§4) as Optional — correct for the C++ tools (model_benchmark.exe / hip-onnx-runner.exe), which don't use the Python onnxruntime at all, but misleading for any Python usage, where a matching wheel is mandatory. Nothing in the main guide flags that distinction.
  • environment.yml's unpinned line actively installs the wrong version, so even a user who later builds the correct wheel started from a mismatched env (and a user who never reaches the wheel step is silently broken for Python EP use).

Why CI doesn't catch it

CI never pip installs PyPI's onnxruntime-directml. It builds ORT 1.25.1 from source (windows-build.yml: checkout v$ONNXRUNTIME_VERSION, apply ONNXRUNTIME_PR_PATCHES, build.bat ... --build_wheel), installs that wheel on the GPU runner, and caches it. So the source-built wheel always matches the EP. The PyPI path is exercised only by humans following environment.yml + the "optional" doc steps.

Already handled (scoped to Whisper)

PR #283 / the Whisper quick-start (docs/whisper_quick_start.md §1b) now documents the mandatory source-built ORT wheel and adds a MORPHIZEN_EP_BIN override; the "ORT version must match pip" CLAUDE.md gotcha was corrected. That covers Whisper readers but not the main-flow inconsistency below.

Proposed fix (main flow — needs a maintainer decision)

  1. environment.yml: either drop the unpinned onnxruntime-directml (and note that the correct ORT is installed via the source-built wheel — see quick_start §1/§4), or pin/comment it so it's clearly a placeholder that the wheel step overrides. Leaving it unpinned guarantees a wrong version on every fresh env.
  2. docs/quick_start.md: keep §1/§4 "optional" for the C++-tools-only path, but add an explicit callout that for any Python EP usage the source-built ORT wheel is required and must match cmake/deps.txt (PyPI lags). Cross-link the recipe.
  3. Optionally, have a single source of truth for the pinned ORT version (today it's duplicated in cmake/deps.txt and windows-build.yml); environment.yml / docs should reference it rather than hardcode.

Repro

conda env create -f environment.yml && conda activate hipdnn-ep
python -c "import onnxruntime as ort; print(ort.__version__)"   # 1.24.4 (PyPI), EP needs 1.25.1
# build EP, then run any Python EP test -> EP registration fails / access violation

Context: surfaced while running the Whisper quick-start from a freshly-cleaned workspace (PR #283 / #266).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions