Skip to content

Add Tile config support to reduce op and validate reduction-axis constraint#258

Merged
chhwang merged 2 commits into
mainfrom
pr-h-reduce-tile-fix
Jun 12, 2026
Merged

Add Tile config support to reduce op and validate reduction-axis constraint#258
chhwang merged 2 commits into
mainfrom
pr-h-reduce-tile-fix

Conversation

@chhwang

@chhwang chhwang commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Add Tile config support to reduce op and validate reduction-axis constraint

The reduce op hardcoded UnitOutDims={1,1,1,1}, blocking multi-row
tile-fused patterns (e.g., fused attention) where the reduce kernel must
process multiple output rows per task.

Changes:

  • ark/ops/ops_reduce.cpp: accept Tile in config, parse it as Dims,
    validate udims4[axis] == 1 (raises PlanError on violation), and pass
    the parsed dims to vec_string instead of the hardcoded unit dims.
    default_config emits "Tile": {1,1,1,1} so existing plans are
    unaffected.

  • python/unittest/ops/test_reduce.py: three new tests — WarpWise
    multi-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 on
    reduce axis raises RuntimeError).

chhwang and others added 2 commits June 11, 2026 10:53
- 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

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.00%. Comparing base (d22a90a) to head (1a1d201).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
ark/ops/ops_reduce.cpp 87.50% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chhwang chhwang changed the title ark-dev: Continue P9: commit the staged ops_reduce.cpp + test_reduce.py changes on branch pr-h-reduce-tile-fix, push, and open PR against main. Add Tile config support to reduce op and validate reduction-axis constraint Jun 11, 2026
@chhwang
chhwang merged commit d46b839 into main Jun 12, 2026
10 of 11 checks passed
@chhwang
chhwang deleted the pr-h-reduce-tile-fix branch June 12, 2026 00:21
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