Skip to content

fix: guard fold_constants against 0-node graphs for CLIP's optimize() override too#17

Merged
forkni merged 1 commit into
SDTD_040_beta_releasefrom
fix/onnx-cache-validation-clip-gap
Jul 19, 2026
Merged

fix: guard fold_constants against 0-node graphs for CLIP's optimize() override too#17
forkni merged 1 commit into
SDTD_040_beta_releasefrom
fix/onnx-cache-validation-clip-gap

Conversation

@forkni

@forkni forkni commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Follow-up to #16 -- moves the 0-node guard into Optimizer.fold_constants() itself since CLIP's optimize() override bypasses BaseModel.optimize()'s check. See models.py Optimizer.fold_constants(). 🤖 Generated with Claude Code

… override too

CLIP's optimize() (models.py) overrides BaseModel.optimize() entirely and
calls opt.fold_constants() directly, bypassing the 0-node guard added to
BaseModel.optimize() in the prior fix (#16). Move an equivalent guard into
Optimizer.fold_constants() itself so every optimize() variant -- current and
future -- is covered by a single check at the one call site that actually
crashes on an empty/corrupt source ONNX.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@forkni
forkni merged commit 7687928 into SDTD_040_beta_release Jul 19, 2026
1 check passed
@forkni
forkni deleted the fix/onnx-cache-validation-clip-gap branch July 19, 2026 17:57
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