Files
ml-models/.github/workflows/export.yaml
T
Mert df0ea33c8a feat: usable as library, model optimizations (#56)
* feat: torch-free export core, shared graph/IR helpers, and CLI scaffolding

* feat: fused InsightFace face exporter

* feat: RKNN export path with per-SoC compilation

* feat: single-partition CoreML CLIP export and runtime rewrite API

* feat: refactor to passes, ep-specific fixes and optimizations

* feat: check command diffing committed graph renderings, wired into CI

* chore: graph and rewrite-plan renderings for the catalog

* use pokedex large
2026-08-04 17:46:25 -04:00

99 lines
3.4 KiB
YAML

on:
workflow_call:
secrets:
HF_TOKEN:
required: true
inputs:
model-name:
required: true
type: string
model-source:
required: true
type: string
runner:
required: true
type: string
hf-name:
required: false
type: string
upload:
type: boolean
default: false
jobs:
export:
runs-on: ${{ inputs.runner }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: true
cache-dependency-glob: uv.lock
- run: uv run --frozen --extra export immich-model onnx export "$MODEL_NAME" "$MODEL_SOURCE" --hf-model-name "$HF_MODEL_NAME"
env:
MODEL_NAME: ${{ inputs.model-name }}
MODEL_SOURCE: ${{ inputs.model-source }}
HF_MODEL_NAME: ${{ inputs.hf-name || inputs.model-name }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
# Here rather than in its own job because this is where an exported model exists
- id: check
run: uv run --frozen --extra export immich-model check --models models
# An exporter change stales every rendering at once; hand back this run's rather than making the
# author re-export the catalog
- if: ${{ failure() && steps.check.outcome == 'failure' }}
run: uv run --frozen --extra export immich-model check --models models --bless
- if: ${{ failure() && steps.check.outcome == 'failure' }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: renderings-${{ inputs.model-name }}
path: |
ci/graphs/${{ inputs.model-name }}
ci/rewrites/${{ inputs.model-name }}
# RKNN binaries are built from the same fused ONNX every other backend uses
- run: uv run --frozen --extra rknn immich-model rknn compile "$MODEL_NAME"
env:
MODEL_NAME: ${{ inputs.model-name }}
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ${{ inputs.model-name }}
path: models/
# When doing benchmarking, that goes here
# Download the exported artifact, and upload an artifact with the benchmark result to be used below
upload:
if: ${{ inputs.upload }}
runs-on: ${{ inputs.runner }}
needs: export
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: true
cache-dependency-glob: uv.lock
- run: uv sync --frozen --extra export
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ inputs.model-name }}
merge-multiple: 'true' # We don't actually have multiple, but this also sets the subfolder naming behaviour
path: models/
- run: |
uv run --frozen --extra export immich-model upload "$MODEL_NAME" \
--hf-model-name "$HF_MODEL_NAME" --hf-organization immich-testing --hf-branch v2
env:
MODEL_NAME: ${{ inputs.model-name }}
HF_MODEL_NAME: ${{ inputs.hf-name || inputs.model-name }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}