core: widen the cancel callback into an AceProgress report+cancel callback - #111
Open
erichchampion wants to merge 1 commit into
Open
core: widen the cancel callback into an AceProgress report+cancel callback#111erichchampion wants to merge 1 commit into
erichchampion wants to merge 1 commit into
Conversation
…lback
The pipelines took `bool (*cancel)(void *)` + `void * cancel_data`. The same
callback now also reports where the run is: AceProgress carries a
fn(data, stage, step, total) that every pipeline poll calls with the current
stage and loop position, and returning true still cancels -- so a UI gets a
real progress bar over the exact hook it already had to implement anyway (the
HTTP server's poll-with-cancel is the visible case).
AceProgress is passed by value, defaulted to {} (no callback = no progress and
never cancel), so every existing caller that passed nothing is unchanged, and
callers that passed a cancel pair keep identical cancellation semantics with
one extra argument they can ignore. Stage enum covers LM, DiT, VAE encode and
decode, and MP3; step is 0-based with a step-0 report before a loop's first
unit of work, so a segmented bar can be sized even for empty loops. MP3 encode
is fork-join, so fn may be called concurrently there -- documented, and safe
for the flag-reading implementations that are the common case.
Ported onto current master's heterogeneous LM batching (9761469) and the
dropped DiT padding-mask plumbing (da5bc90). test-progress.cpp exercises the
report/cancel contract.
Contributor
|
Warning Review limit reachedNext included review available in 59 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (19)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Third of four small embedder patches from Cadenza (independent of the others; ported onto current master's heterogeneous LM batching from #9761469 and the dropped DiT padding-mask plumbing from #da5bc90).
What it does
The pipelines took
bool (*cancel)(void *)+void * cancel_data. The same callback now also reports where the run is:Every pipeline poll calls
fnwith the current stage and loop position, and returning true still cancels -- so a UI gets a real progress bar over the exact hook it already had to implement anyway. The HTTP server's/progresspoll-with-cancel is the visible beneficiary: today a client can cancel but cannot know whether the run is in LM, DiT or VAE, or how far along.{}(no callback = no progress and never cancel), so every existing caller that passed nothing is unchanged, and callers that passed a cancel pair keep identical cancellation semantics.stepis 0-based, and a step-0 report fires before a loop's first unit of work, so a segmented bar can be sized even for empty loops.Testing
tests/test-progress.cppexercises the report/cancel contract: report sequence, cancel mid-loop, and the step-0-before-first-work guarantee. Built and run on macOS/arm64/Metal.