Skip to content

Change split functions to work on box instead of chunk#323

Merged
PeterTh merged 3 commits intomasterfrom
split-boxes
Jun 3, 2025
Merged

Change split functions to work on box instead of chunk#323
PeterTh merged 3 commits intomasterfrom
split-boxes

Conversation

@psalz
Copy link
Copy Markdown
Member

@psalz psalz commented Dec 20, 2024

chunk is a purely user-facing type (and of questionable usefulness at that), and since all of our internal tracking is built around box, splitting should follow suit.

@github-actions
Copy link
Copy Markdown

Check-perf-impact results: (000e2892abb21ddd1ae413a5c86d7d95)

❓ No new benchmark data submitted. ❓
Please re-run the microbenchmarks and include the results if your commit could potentially affect performance.

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (1/1)

@coveralls
Copy link
Copy Markdown

coveralls commented Dec 20, 2024

Pull Request Test Coverage Report for Build 15258506201

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 58 of 58 (100.0%) changed or added relevant lines in 3 files are covered.
  • 19 unchanged lines in 7 files lost coverage.
  • Overall coverage increased (+0.01%) to 95.061%

Files with Coverage Reduction New Missed Lines %
src/config.cc 1 80.72%
src/runtime.cc 1 92.29%
src/scheduler.cc 1 98.78%
include/utils.h 3 86.11%
src/live_executor.cc 3 95.33%
src/receive_arbiter.cc 4 96.09%
src/backend/sycl_backend.cc 6 89.86%
Totals Coverage Status
Change from base Build 12390656669: 0.01%
Covered Lines: 7146
Relevant Lines: 7251

💛 - Coveralls

Copy link
Copy Markdown
Contributor

@GagaLP GagaLP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Copy link
Copy Markdown
Contributor

@fknorr fknorr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it!

If I'm not mistaken you could also define command_graph_generator::assigned_chunk in terms of boxes and get rid of even more casts without much hassle - buffer_access_map already operates on boxes.

Also, a drive-by suggestion:

diff --git a/src/command_graph_generator.cc b/src/command_graph_generator.cc
index da56682e..3cfb6d22 100644
--- a/src/command_graph_generator.cc
+++ b/src/command_graph_generator.cc
@@ -117,11 +117,9 @@ std::vector<const command*> command_graph_generator::build_task(const task& tsk)
 }

 void command_graph_generator::report_overlapping_writes(const task& tsk, const box_vector<3>& local_chunks) const {
-       const chunk<3> full_chunk{tsk.get_global_offset(), tsk.get_global_size(), tsk.get_global_size()};
-
        // Since this check is run distributed on every node, we avoid quadratic behavior by only checking for conflicts between all local chunks and the
        // region-union of remote chunks. This way, every conflict will be reported by at least one node.
-       const box<3> global_chunk(subrange(full_chunk.offset, full_chunk.range));
+       const box<3> global_chunk(subrange(tsk.get_global_offset(), tsk.get_global_size()));
        auto remote_chunks = region_difference(global_chunk, region(box_vector<3>(local_chunks))).into_boxes();

        // detect_overlapping_writes takes a single box_vector, so we concatenate local and global chunks (the order does not matter)

@github-actions
Copy link
Copy Markdown

Check-perf-impact results: (17d2daea565336edd0421cacd8138ced)

❓ No new benchmark data submitted. ❓
Please re-run the microbenchmarks and include the results if your commit could potentially affect performance.

@PeterTh PeterTh merged commit db71b5c into master Jun 3, 2025
28 of 30 checks passed
@PeterTh PeterTh deleted the split-boxes branch June 3, 2025 08:26
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.

5 participants