Skip to content

v1.1.0+v1.2.0: complete 14 schedulers + Karras, SD v2.1/SDXL support, release-chain repair - #3

Open
Windsander wants to merge 17 commits into
mainfrom
dev/v1.2.0
Open

v1.1.0+v1.2.0: complete 14 schedulers + Karras, SD v2.1/SDXL support, release-chain repair#3
Windsander wants to merge 17 commits into
mainfrom
dev/v1.2.0

Conversation

@Windsander

Copy link
Copy Markdown
Owner

Summary

Two release windows in one review (baseline: v1.0.1, 17 commits, +2048/−199):

  • v1.1.0 — Samplers & sigma strategy (all 14 schedulers usable)

    • Complete the empty-stub UniPC (was a segfault on selection); full predictor-corrector math in λ-space with Lagrange interpolation, validated to 1e-11 against synthetic fields
    • Karras sigma schedule (ρ=7, --sigma): value-identical to diffusers use_karras_sigmas
    • DPM++ family: dpm_m (2M), dpm_s (2S), dpm_sde (2nd-order midpoint), ported from diffusers 0.39 into the framework's EDM sample space (max deviation 2.4e-07)
    • Legacy trio: pndm (prk+plms), ipndm (paper-form AB4+DDIM update — diffusers' ADM-grid variant verified unusable for SD), deis_m (log-rho Lagrange integrator, order 1→3)
  • v1.2.0 — Model generation expansion

    • SD v2.x (tested v2.1-768): v-prediction + 768px pipeline end-to-end; fixed silent pure-noise failures caused by input-signature mismatches (UNet timestep float scalar, CLIP input_ids int64) — inputs now adapt to each model's declared dtype/rank
    • SDXL (tested SDXL-turbo): dual text-encoder conditioning — penultimate hidden_states[-2] per encoder, feature-dim concat (768+1280→2048), pooled embedding + time_ids micro-conditioning; new --clip2; single ABI extension (IOrtSDConfig.onnx_clip_2_path) concentrated in this window
  • CI / release chain repair

    • Add missing CHANGELOG.md (referenced by auto-publish)
    • Replace retired actions: create-release@v1/upload-release-asset@v1 → gh CLI + softprops/action-gh-release@v2; upload/download-artifact@v2 → v4 (v2 hard-retired by GitHub)
    • deploy_linux formally disabled per decision 0.4; fix missing artifact download in update_homebrew_formula
    • Add sd/io-test/run_smoke_matrix.sh (19/24-case smoke matrix with ORT-exception, size, and flat-pixel gates) and extend auto_prepare_sd_models.sh to v2.x/SDXL conversion channels

Validation

  • Numerics: numpy replicas of each new scheduler cross-checked against diffusers 0.39 trajectories (pndm 2.7e-06, dpm family 2.4e-07, deis_m 3.1e-05)
  • Inference matrix (macOS arm64, ORT 1.18.0): sd-turbo × 8 schedulers × 4 steps, Karras combos, sd-v1.5 × 20 steps CFG7.5, SD v2.1 768px v-prediction, SDXL-turbo dual-encoder, plus regression on legacy paths — smoke matrix 19/19 green, zero ORT exceptions
  • Reference images cross-validated against real diffusers pipelines (PNDM stripe artifacts confirmed as upstream-inherent, not a port bug)

Notes for reviewers

  • ABI: include/adi.h — append-only enum additions + one struct field append (onnx_clip_2_path); both releases deliberately share one ABI window
  • Untested variants (models not downloaded, architecture identical): SD v2.0, SDXL-base — marked as such in README
  • ModelBase::execute still swallows ORT exceptions after logging; signature adaptation removes the known triggers, and the smoke matrix gates on exception count (CI gate candidate)
  • Model weights are not in git; acquisition/conversion channels documented in PLAN-supplement.md and sd/auto_prepare_sd_models.sh

Follow-ups after merge

  • Push tags release-v1.1.0/release-v1.2.0 and branch release/release-v1.2.0 (triggers the public release pipeline — verify ADI_DEPLOY_TOKEN first)
  • Wire run_smoke_matrix.sh into test-native as a runtime gate (currently compile-only)
  • ORT upgrade + Linux .deb/.rpm repair remain scheduled for the v2.0.0 window

… mapping

- unipc: implement full predictor-corrector math (lambda-space exponential
  integrator + Lagrange interpolation, EDM sample-space convention),
  replacing the segfaulting empty stub (returned {} vectors)
- unipc: add SD_LAMBDA_JUMP_CAP order-reduction guard for huge final
  lambda jumps (generalizes diffusers lower_order_final)
- unipc: verified on turbo t2i 1/4/8 steps, i2i, CFG 7.5, v15 20 steps
- build: fix auto_build.sh mapping macOS arm64 to aarch64 (toolchain
  expects arm64, caused FATAL_ERROR on Apple Silicon)
- cli: correct help text to list all 8 schedulers & both tokenizers
- docs: tick uni_pc in README checklist, add PLAN-supplement.md
- new AvailableSigmaType (public) / SigmaType (internal) enums,
  appended to scheduler config structs (additive, v1.1.0 ABI window)
- SchedulerBase::init karras branch: rho=7 sigma ramp between
  training-schedule sigma_min/sigma_max, sigma->timestep inversion
  via bisection on the same generate_sigma_at curve
- CLI --sigma [default/karras] option + help/params/summary output
- verified: sigma sequence matches diffusers use_karras_sigmas exactly;
  turbo 4-step inference green with euler_a/unipc + default control
- ported from diffusers 0.39 DPMSolverMultistepScheduler source and
  translated to EDM sample space (x_vp = alpha * x_edm equivalence
  verified numerically to float32 precision)
- final zero-sigma step uses order-1 (x0-prediction), matching
  diffusers lower_order_final + final_sigmas_type=zero behavior
- registered as SCHEDULER_DPM_M=8 / CLI 'dpm_m'; verified on turbo
  4-step, v15 20-step, and the canonical DPM++ 2M Karras combo
- two-eval-per-step structure reusing the Heun correction_steps trick,
  but with TRUE midpoint sigmas/timesteps at odd indices so base
  scale/time/x0-conversion stays self-consistent
- shared ancestral update with euler_a-style in-class RandomGenerator,
  noise scaled by random_intensity (diffusers s_noise)
- final zero-sigma phase degenerates to x0-prediction
- verified: turbo 4-step (notably clean), v15 20-step + karras
- two-eval-per-step structure with true midpoint sigmas/timesteps at
  odd indices: order-1 deterministic half-step (even) + full-interval
  2S correction driven by both x0 predictions (odd)
- EDM translation of diffusers DPMSolverSinglestepScheduler dpmsolver++
  midpoint update; final zero-sigma phase returns x0-prediction
- completes the DPM++ family (dpm_m / dpm_sde / dpm_s);
  verified on turbo 4-step and v15 20-step + karras
….x support)

- UNet timestep: query declared element type/rank (legacy int64 {1} vs
  newer float scalar) and feed accordingly; clone call sites honor it
- CLIP input_ids: tokenizer emits int32; cast to int64 when the text
  encoder declares it
- ModelBase::execute swallows ORT exceptions - with mismatched tensors
  the models silently returned zeros and output decoded to pure noise
- add TensorHelper::cast and ModelBase::model_input_element_type
  (keep TypeInfo alive while reading its unowned view)
…I window)

- IOrtSDConfig: append onnx_clip_2_path (ABI extension, v1.2.0)
- Clip: use_penultimate option (hidden_states[-2] by output name),
  pooled output capture (pooler_output/text_embeds), ORT-allocated
  execution path for variable-arity encoder exports
- Context: dual text encoders, last-dim hidden concat (768+1280=2048),
  pooled conditioning from text_encoder_2
- UNet: SDXL 5-input binding (text_embeds + time_ids [h,w,0,0,h,w])
- TensorHelper::concat_last_dim; CLI --clip2
- add CHANGELOG.md (referenced by auto-publish body_path and asset copies)
- auto-publish: checkout@v4, setup-python@v5, gh CLI release creation,
  softprops/action-gh-release@v2 asset upload (create-release@v1 and
  upload-release-asset@v1 are node12-retired)
- auto-deploy: checkout/upload-artifact/download-artifact@v2 -> v4
  (v2 hard-retired by GitHub); deploy_linux job formally disabled per
  decision 0.4; fix missing artifact download in update_homebrew_formula
- create local branch release/release-v1.2.0 at tag for the publish flow
- sd/io-test/run_smoke_matrix.sh: 19-case quick / 24-case full matrix
  with hard gates (ORT exception count, output size, flat-pixel check);
  quick matrix verified 19/19 green locally
- auto_prepare_sd_models.sh: auto_convert_sd_next for onnx-sd-v21-768
  (sd2-community mirror, HF stabilityai repos now gated) and
  onnx-sdxl-turbo (from local safetensors checkout)
…cklist truthfulness)

- fix example command: bpe needs vocab.json + --merges (was vocab.txt, no merges)
- add verified v2.1/SDXL/karras examples + per-model parameter table
- check parent Strategy/Sampling boxes; mark v2.0 & SDXL-base untested
- note published packages are v1.0.1 pending release chain; wp -> word_piece
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant