Skip to content

Fix schedule_all chunking for small ranges#2120

Open
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix-schedule-all-small-ranges
Open

Fix schedule_all chunking for small ranges#2120
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix-schedule-all-small-ranges

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

Fix exec::schedule_all on static_thread_pool for small non-empty ranges where the range size is less than the pool thread count.

The previous chunk-size calculation could produce 0, which meant the batching loop never advanced. Giving non-empty work a minimum chunk size of 1 avoids that hard hang. While testing that path, I also found that chunk flushes moved the staged task queue without resetting tasks_size_, so the next flush could try to drain more tasks than were actually queued. The patch resets the staged count after each flush.

Testing

  • cmake --build build --target test.exec
  • ./build/test/exec/test.exec "schedule_all on static_thread_pool handles fewer items than threads"
  • ./build/test/exec/test.exec "[types][static_thread_pool]"
  • ASAN_OPTIONS=abort_on_error=0:symbolize=1 ./build-asan/test/exec/test.exec "schedule_all on static_thread_pool handles fewer items than threads"
  • ./build/test/exec/test.exec

@copy-pr-bot

copy-pr-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

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