DO NOT MERGE - AI prototype of reduction algorithm framework - #6765
Draft
blowekamp wants to merge 3 commits into
Draft
DO NOT MERGE - AI prototype of reduction algorithm framework#6765blowekamp wants to merge 3 commits into
blowekamp wants to merge 3 commits into
Conversation
Add ReduceAlgorithm base interface plus Greedy, Tree, and Linear implementations for combining per-work-unit partial results. Greedy is thread-safe but non-deterministic in merge order. Tree and Linear merge in a fixed, chunk-ID order so results are reproducible across runs regardless of thread scheduling.
Replace hand-rolled mutex swap-and-merge loops in LabelStatisticsImageFilter, LabelOverlapMeasuresImageFilter, and ImageToHistogramFilter with GreedyReduceAlgorithm. Also add a using-declaration in GreedyReduceAlgorithm to stop it from hiding the base class's chunk-ID Merge() overload (-Woverloaded-virtual).
7 tasks
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.
Prototype of a generic
ReduceAlgorithminterface (Greedy, Tree, Linearstrategies) for combining per-work-unit partial results, plus a
refactor of
LabelStatisticsImageFilter,LabelOverlapMeasuresImageFilter,and
ImageToHistogramFilterto useGreedyReduceAlgorithminstead ofhand-rolled mutex swap-and-merge loops. Opened as a draft for discussion,
not intended to merge as-is.
Background
Follows up on the deterministic-parallel-reduce discussion in #6622
(Mattes metric derivatives).
GreedyReduceAlgorithmmatches theexisting non-deterministic swap-and-merge pattern;
TreeReduceAlgorithmand
LinearReduceAlgorithmoffer deterministic, chunk-ID-orderedmerging for cases that need reproducible floating-point results.
AI assistance
ReduceAlgorithmclass hierarchy and GTestsuites, and refactored the three filters to use
GreedyReduceAlgorithmTest results
ITKCommonGTestDriver(Greedy/Tree/Linear reduce tests): all passingITKImageStatisticsTestDriver/GTestDriver,ITKStatisticsTestDriver/GTestDriver: all passing after fetching ExternalData