Skip to content

Commit fa03587

Browse files
authored
Re-enable the yolo26 portable CI job by installing its requirements (pytorch#23449)
Fixes pytorch#21621. The yolo26 portable job in the periodic model matrix was red from the day it was added, so pytorch#21618 stopped gathering it. The cause turned out to be simple: `.ci/scripts/test_model.sh` never installs the model's Python requirements. The yolo26 wrapper imports `ultralytics`, so the export stopped while loading the model, before the portable runner started: ``` ModuleNotFoundError: No module named 'ultralytics' ``` Every scheduled run on main whose log is still available and that reached the export step failed this way. The dim order error quoted in pytorch#21621 came from a different job in the same run (`ds_cnn`). pytorch#21619 fixed that one the same day, and `ds_cnn` has passed on main since August 7. This change: - installs `examples/models/yolo26/requirements.txt` before the export, with the same command that `test_yolo26.sh` and the yolo26 README use - adds a comment above the `ultralytics` pin, because the job now depends on it - removes the yolo26 skip from `gather_test_models.py`, so the job runs again The install step is the same as in pytorch#20841, which was approved in July but never merged. In that PR's Linux run, the same command kept the torch that CI already had and only added `ultralytics` and a few of its dependencies. The job only passes with the pinned `ultralytics==8.4.14`. Releases 8.4.133 to 8.4.139 switch the model to channels last on x86 Linux and Windows, and the portable convolution kernel then rejects it. From 8.4.140, strict export fails. pytorch#23453 tracks both, so raising the pin is left for a separate change. ### Test plan - Ran `PYTHON_EXECUTABLE=python bash .ci/scripts/test_model.sh yolo26 cmake portable` on current main with this change, on macOS arm64 with Python 3.10 and torch 2.14.0. It installed `ultralytics` 8.4.14, exported `yolo26.pte`, and the portable `executor_runner` ran it successfully. - `gather_test_models.py` now emits `yolo26` on `portable` for the scheduled matrix (59 to 60 records) and the push matrix used by release branches (53 to 54). No other record changes. - The yolo26 portable job passed on this PR on Linux x86, in both the scheduled and the push matrix, through the `ciflow/periodic` label. It installed `ultralytics` 8.4.14, kept the torch that CI already had, exported the model, and the portable runner ran it. - With `ultralytics` 8.4.140 and 8.4.173, the export fails as described in pytorch#23453.
1 parent c77d0ee commit fa03587

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎.ci/scripts/gather_test_models.py‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,6 @@ def model_should_run_on_target_os(model: str, target_os: str) -> bool:
113113
A helper function to decide whether a model should be tested on a target os (linux/macos).
114114
For example, a big model can be disabled in macos due to the limited macos resources.
115115
"""
116-
# yolo26 was contributed as an OpenVINO/XNNPACK example and has never passed on
117-
# the portable backend, so gathering it only ever produces a permanently red job.
118-
# TODO(#21621): drop this skip once yolo26 exports cleanly on portable.
119-
if model == "yolo26":
120-
return False
121116
if target_os == "macos":
122117
# Disabled in macos due to limited resources, and should stay that way even if
123118
# we otherwise re-enable.

‎.ci/scripts/test_model.sh‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ test_model() {
108108
bash examples/models/llava/install_requirements.sh
109109
STRICT="--no-strict"
110110
fi
111+
if [[ "${MODEL_NAME}" == "yolo26" ]]; then
112+
"${PYTHON_EXECUTABLE}" -m pip install --upgrade-strategy only-if-needed \
113+
--extra-index-url https://download.pytorch.org/whl/cpu \
114+
-r examples/models/yolo26/requirements.txt
115+
fi
111116
if [[ "${MODEL_NAME}" == "qwen2_5_1_5b" ]]; then
112117
# Install requirements for export_llama
113118
bash examples/models/llama/install_requirements.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
# Newer releases break the portable export of this model, see #23453.
12
ultralytics==8.4.14
23
opencv-python

0 commit comments

Comments
 (0)