Add Tile config support to reduce op and validate reduction-axis constraint#258
Merged
Conversation
- ops_reduce.cpp: add Tile to check_fields_config, parse it in
impl_name, validate udims4[axis]==1, pass parsed tile to vec_string
instead of hardcoded {1,1,1,1}, emit Tile in default_config.
- test_reduce.py: add test_reduce_sum_fused_tile (WarpWise multi-row),
test_reduce_sum_fused_tile_elementwise (ElementWise non-default tile),
test_reduce_tile_axis_validation (non-1 tile on axis raises error).
…py changes on branch pr-h-reduce-tile-fix, push, and open PR against main.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #258 +/- ##
==========================================
- Coverage 85.00% 85.00% -0.01%
==========================================
Files 127 127
Lines 6181 6187 +6
==========================================
+ Hits 5254 5259 +5
- Misses 927 928 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Add Tile config support to reduce op and validate reduction-axis constraint
The reduce op hardcoded
UnitOutDims={1,1,1,1}, blocking multi-rowtile-fused patterns (e.g., fused attention) where the reduce kernel must
process multiple output rows per task.
Changes:
ark/ops/ops_reduce.cpp: acceptTilein config, parse it asDims,validate
udims4[axis] == 1(raisesPlanErroron violation), and passthe parsed dims to
vec_stringinstead of the hardcoded unit dims.default_configemits"Tile": {1,1,1,1}so existing plans areunaffected.
python/unittest/ops/test_reduce.py: three new tests — WarpWisemulti-row tile (
Tile=[1,1,2,1], axis 3), ElementWise non-default tile(
Tile=[1,1,1,64], axis 2), and negative validation (non-1 tile onreduce axis raises
RuntimeError).