chore: slim PR to user-facing essentials

Carry only the code, tests, and user-facing docs that matter to end
users; drop the modernization scaffolding accumulated while building it.

- Remove the bench harness, results, and environment captures (bench/).
- Remove internal docs and research spikes (docs/).
- Remove the Makefile; tests run via uv / pytest directly.
- Strip the bench harness and quantization-matrix steps from the Tier 2
  workflow. The golden-image test drives conversion through the Core ML
  Converter node at runtime, so no separate convert step is needed.
- Replace phase/handoff annotations across code, tests, and config with
  neutral docstrings and comments.
This commit is contained in:
aszc-dev
2026-05-25 18:37:04 +02:00
parent 6a0ccbeb60
commit 31774e3324
50 changed files with 85 additions and 2630 deletions
+2 -2
View File
@@ -23,8 +23,8 @@ jobs:
- name: Install Tier 0 deps
run: |
python -m pip install --upgrade pip
# Pins mirror pyproject (Phase 1 baseline). Tier 0 only needs
# torch + numpy + pytest; everything else is Mac-only.
# Tier 0 only needs torch + numpy + pytest; everything else
# is Mac-only.
python -m pip install \
"torch==2.0.1" "numpy<1.25" \
"pytest>=8" "pytest-xdist"
+7 -41
View File
@@ -16,14 +16,14 @@ jobs:
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'run-m2'))
# Self-hosted Mac registered by the maintainer. See docs/ci-m2.md
# for runner setup and the COMFY_DIR / checkpoint prerequisites.
# Self-hosted Apple Silicon runner. Prerequisites: COMFY_DIR pointing at
# a runner-owned ComfyUI clone, plus a cached SD1.5 checkpoint.
runs-on: [self-hosted, macOS, ARM64, coreml]
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
# Hybrid ComfyUI strategy (see docs/ci-m2.md "ComfyUI version under test"):
# Hybrid ComfyUI strategy:
# - schedule (nightly) -> latest origin/master + ComfyUI's own
# requirements.txt (constrained). Canary for upstream API breakage.
# - PR label / dispatch -> the pinned requires-comfyui SHA + the frozen
@@ -46,7 +46,7 @@ jobs:
# git reset --hard and rewrites custom_nodes). Cloned on first run.
run: |
set -euo pipefail
if [ -z "${COMFY_DIR:-}" ]; then echo "COMFY_DIR unset (see docs/ci-m2.md)"; exit 1; fi
if [ -z "${COMFY_DIR:-}" ]; then echo "COMFY_DIR unset"; exit 1; fi
# Init-in-place rather than `git clone`: COMFY_DIR may already hold the
# cached checkpoint (models/checkpoints) or converted .mlmodelc, and
# `git clone` refuses a non-empty target. init + fetch + `checkout -f`
@@ -95,22 +95,6 @@ jobs:
uv sync --group comfy
fi
- name: Convert UNet variants if missing
# Idempotent: converter.convert / compile_model skip when the .mlmodelc
# already exists, so this is a no-op once the runner cache is warm.
run: |
set -euo pipefail
for V in none 8 6 4; do
if [ "$V" = "none" ]; then SUF=""; else SUF="_q$V"; fi
OUT="$COMFY_DIR/models/unet/v1-5-pruned-emaonly_1x512x512_se${SUF}_unet.mlmodelc"
if [ -d "$OUT" ]; then echo "skip nbits=$V (exists)"; continue; fi
echo "converting nbits=$V"
# --no-sync: keep the deps we just installed (latest mode's
# ComfyUI requirements / pinned mode's --group comfy); a bare
# `uv run` would re-sync to the lock and drop them.
QUANT_NBITS="$V" uv run --no-sync python bench/scripts/convert_sd15.py
done
- name: Start ComfyUI server (background)
run: |
cd "$COMFY_DIR"
@@ -126,29 +110,11 @@ jobs:
echo "comfy failed to start"; tail -100 /tmp/comfyui-ci.log; exit 1
- name: Run Tier 2 (m2 marker)
# The golden-image workflow drives the Core ML Converter node, so the
# UNet is converted on demand on the first run and reused from the
# runner-local cache afterwards.
run: uv run --no-sync pytest -m m2 tests/ -v
- name: Run bench harness (baseline UNet)
run: |
uv run --no-sync python bench/run.py \
--model "$COMFY_DIR/models/unet/v1-5-pruned-emaonly_1x512x512_se_unet.mlmodelc" \
--compute-units CPU_AND_NE CPU_AND_GPU \
--repeats 30 --assumed-steps 20
- name: Run quantization tradeoff matrix (Phase 6)
# Benches none/8/6/4 on ANE and records size / ms-step / PSNR-vs-none
# into bench/results/quant_matrix_<sha>.{json,md}.
run: uv run --no-sync python bench/scripts/quant_matrix.py
- name: Upload bench results
uses: actions/upload-artifact@v4
if: always()
with:
name: bench-results
path: |
bench/results/*.json
bench/results/*.md
- name: Stop ComfyUI server
if: always()
run: pkill -f "main.py.*8188" || true