Skip to content

Add semaphore-aware Sequence evalAsync overloads#463

Open
cone-forest wants to merge 2 commits intoKomputeProject:masterfrom
cone-forest:feature/evalasync-semaphore-overload
Open

Add semaphore-aware Sequence evalAsync overloads#463
cone-forest wants to merge 2 commits intoKomputeProject:masterfrom
cone-forest:feature/evalasync-semaphore-overload

Conversation

@cone-forest
Copy link
Copy Markdown

@cone-forest cone-forest commented Apr 26, 2026

Summary

  • add Sequence::evalAsync overloads that accept wait/signal semaphores for submit-level GPU synchronization
  • keep existing evalAsync() behavior by routing to the new overload with empty semaphore lists
  • validate wait semaphore/stage-mask count pairing and add focused tests for the new overload path

Test plan

  • cmake -S . -B build -DKOMPUTE_OPT_BUILD_TESTS=ON
  • cmake --build build -j
  • ./build/bin/kompute_tests --gtest_filter=TestSequence.EvalAsyncSemaphoreOverloadSupportsEmptySyncLists:TestSequence.EvalAsyncSemaphoreOverloadValidatesWaitMaskCount

Allow submit-level GPU synchronization by letting Sequence submissions
wait on and signal Vulkan semaphores without CPU-side waits.
This keeps existing evalAsync behavior while adding validation and
coverage for the new overload path.
@cone-forest cone-forest force-pushed the feature/evalasync-semaphore-overload branch from 206a63a to 570453d Compare April 26, 2026 23:39
@axsaucedo
Copy link
Copy Markdown
Member

This looks interesting; but why are we looking to pass this on every Eval? Woudln't it make sense to hvae this at class initialisation? Can you provide more details on your usecase with a few examples so we can asses? Thanks

@cone-forest
Copy link
Copy Markdown
Author

This makes sense actually. I should also add this to the sequence method for the manager, right?

I still have doubts about forcing every submission of a command buffer to a fixed sync objects though. Extending the API to support timeline semaphores would be difficult. But that might not be necessary

I will think about this for today as I am still figuring the exact sync mechanism I want to use. Currently it uses a single semaphore between all compute and all graphics. Not sure that's my final design

@axsaucedo
Copy link
Copy Markdown
Member

Ok thank you for sharing a few extra thoughts - in that case I'd say it would be worth thinking about it form the potentail api on how users are expected to use it (ie what are some usecases). This would also help decide whether indeed it's an initialisation function item which would be passed by the manager, or something that is run / overridden by on the execution itself.

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.

2 participants