Fix: skip local ready buffer on PENDING dispatch to reduce same-thread re-claim#623
Open
zhusy54 wants to merge 1 commit intohw-native-sys:mainfrom
Open
Fix: skip local ready buffer on PENDING dispatch to reduce same-thread re-claim#623zhusy54 wants to merge 1 commit intohw-native-sys:mainfrom
zhusy54 wants to merge 1 commit intohw-native-sys:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a skip_local parameter to the task scheduler to improve task distribution across threads by allowing a window for local tasks to be flushed. It also refactors the pop_ready_tasks_batch function to accept profiling counters as references. A critical issue was identified in the profiling logic where the pop_hit counter is incremented by one per batch instead of the actual number of tasks popped, which will result in incorrect performance metrics.
7f844b0 to
d04ca1b
Compare
…d re-claim Add skip_local parameter to get_ready_tasks_batch (and pop_ready_tasks_batch) so that when a thread is dispatching PENDING tasks, it does not immediately re-consume tasks it just released into its local ready buffer. This gives downstream tasks a window to be picked up by other threads rather than being greedily re-claimed by the same thread's PENDING slots.
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.
Summary
skip_localparameter toPTO2SchedulerState::get_ready_tasks_batch()andAicpuExecutor::pop_ready_tasks_batch()is_pending == true), it now passesskip_local=trueto avoid immediately re-consuming tasks it just released into the local ready bufferTesting
tensormap_and_ringbufferL3 hardware tests passed (test_l3_child_memory, test_l3_group, test_l3_dependency)