Skip to content

perf: cache MiniMax H3 text conditioning - #1966

Open
xledx wants to merge 1 commit into
leejet:masterfrom
xledx:minimax-h3-conditioning-cache
Open

xledx wants to merge 1 commit into
leejet:masterfrom
xledx:minimax-h3-conditioning-cache

Conversation

@xledx

@xledx xledx commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Cache MiniMax H3 text-only conditioning results so repeated requests with the same prompt can reuse the previously computed SDCondition.

The cache is intentionally conservative and is only enabled when:

  • the model is MiniMax H3
  • there are no effective LoRAs
  • unconditional conditioning is not requested
  • there are no image or MiniMax H3 presentation references

Non-cacheable H3 requests invalidate the cached condition.

Related Issue / Discussion

None.

Additional Information

Validated with MiniMax H3 on an Intel Mac, CPU-only, using sd-server so consecutive requests shared the same model context.

On a repeated identical text-only request, the runtime log reported:

H3 conditioning cache hit
get_learned_condition completed, taking 0.00s

@xledx

xledx commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Retested on the latest master.

  • Confirmed the conditioning cache hit on an Intel Mac, CPU-only.
  • get_learned_condition: 199.97s → 0.00s
  • Wall-clock generation time: 6m36s → 2m59s
  • Same prompt, seed, and generation settings were used for both runs.

The patch also cherry-picks cleanly onto the latest master, and both sd-cli and sd-server build successfully.

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