Skip to content

[autotuner] Reduction fact layer: ReductionFact + AccumulatorFact + enriched MemoryOpFact#2761

Open
calebmkim wants to merge 1 commit into
calebmkim/stack/1from
calebmkim/stack/2
Open

[autotuner] Reduction fact layer: ReductionFact + AccumulatorFact + enriched MemoryOpFact#2761
calebmkim wants to merge 1 commit into
calebmkim/stack/1from
calebmkim/stack/2

Conversation

@calebmkim

@calebmkim calebmkim commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Stacked PRs:


[autotuner] Reduction fact layer: ReductionFact + AccumulatorFact + enriched MemoryOpFact

Add the reduction fact layer the Triton reduction seed heuristic will read, built in
the compiler fact pass. No heuristic yet — that lands in the next PR; these facts are
populated but not consumed here.

  • helion/autotuner/config_spec.py: ReductionFact, AccumulatorFact, enriched
    MemoryOpFact (per-op provenance), and the fact storage fields on ConfigSpec.
  • helion/_compiler/device_ir.py: a 3-phase fact build (roll reductions, collect
    enriched memory-op facts after rolling, derive reduction/accumulator facts) that
    replaces bespoke per-config graph walks.
  • full_width_output / input_load_itemsize key on the reduction AXIS via a new
    MemoryOpFact.subscript_block_ids (block-id read from the index subscript, resolved
    reduction-agnostically) rather than an inner_extent==size_hint size-match — faithful
    for user-tiled (T2) reductions whose reduction block is reduction=False, and immune to
    a non-reduction dim coincidentally equal to the reduction extent. Byte-identical seed
    configs across the curriculum (no size coincidences existed).
  • test/test_memory_op_facts.py: fact coverage incl. the indexing-slot invariant.
  • test/test_barrier.py: update the rdim / config_spec fakes for the new fact build.

@calebmkim calebmkim force-pushed the calebmkim/stack/1 branch from 69cc426 to f212074 Compare June 11, 2026 18:04
@calebmkim calebmkim force-pushed the calebmkim/stack/2 branch from 5041cf6 to 124d450 Compare June 11, 2026 18:04
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 11, 2026
calebmkim pushed a commit that referenced this pull request Jun 11, 2026
…nriched MemoryOpFact

Add the reduction fact layer the Triton reduction seed heuristic will read, built in
the compiler fact pass. No heuristic yet — that lands in the next PR; these facts are
populated but not consumed here.

- helion/autotuner/config_spec.py: ReductionFact, AccumulatorFact, enriched
  MemoryOpFact (per-op provenance), and the fact storage fields on ConfigSpec.
- helion/_compiler/device_ir.py: a 3-phase fact build (roll reductions, collect
  enriched memory-op facts after rolling, derive reduction/accumulator facts) that
  replaces bespoke per-config graph walks.
- full_width_output / input_load_itemsize key on the reduction AXIS via a new
  MemoryOpFact.subscript_block_ids (block-id read from the index subscript, resolved
  reduction-agnostically) rather than an inner_extent==size_hint size-match — faithful
  for user-tiled (T2) reductions whose reduction block is reduction=False, and immune to
  a non-reduction dim coincidentally equal to the reduction extent. Byte-identical seed
  configs across the curriculum (no size coincidences existed).
- test/test_memory_op_facts.py: fact coverage incl. the indexing-slot invariant.
- test/test_barrier.py: update the rdim / config_spec fakes for the new fact build.

stack-info: PR: #2761, branch: calebmkim/stack/2
@calebmkim calebmkim force-pushed the calebmkim/stack/2 branch from 124d450 to 0e1b911 Compare June 11, 2026 20:02
1
for f in memory_op_facts
if f.kind == "load" and f.graph_id in load_graph_ids
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Key change: fill ReductionFact fields by reading MemoryOpFacts instead of manually walking graph.

@calebmkim calebmkim changed the base branch from calebmkim/stack/1 to main June 11, 2026 23:21
@calebmkim calebmkim force-pushed the calebmkim/stack/2 branch from 0e1b911 to 2323360 Compare June 11, 2026 23:22
@calebmkim calebmkim changed the base branch from main to calebmkim/stack/1 June 11, 2026 23:22
@calebmkim calebmkim marked this pull request as ready for review June 11, 2026 23:27
@calebmkim calebmkim marked this pull request as draft June 12, 2026 00:09
@calebmkim calebmkim changed the base branch from calebmkim/stack/1 to main June 12, 2026 00:09
@calebmkim calebmkim force-pushed the calebmkim/stack/2 branch from 2323360 to c527a01 Compare June 12, 2026 00:10
@calebmkim calebmkim changed the base branch from main to calebmkim/stack/1 June 12, 2026 00:10
@calebmkim calebmkim marked this pull request as ready for review June 12, 2026 00:10
…nriched MemoryOpFact

Add the reduction fact layer the Triton reduction seed heuristic will read, built in
the compiler fact pass. No heuristic yet — that lands in the next PR; these facts are
populated but not consumed here.

- helion/autotuner/config_spec.py: ReductionFact, AccumulatorFact, enriched
  MemoryOpFact (per-op provenance), and the fact storage fields on ConfigSpec.
- helion/_compiler/device_ir.py: a 3-phase fact build (roll reductions, collect
  enriched memory-op facts after rolling, derive reduction/accumulator facts) that
  replaces bespoke per-config graph walks.
- full_width_output / input_load_itemsize key on the reduction AXIS via a new
  MemoryOpFact.subscript_block_ids (block-id read from the index subscript, resolved
  reduction-agnostically) rather than an inner_extent==size_hint size-match — faithful
  for user-tiled (T2) reductions whose reduction block is reduction=False, and immune to
  a non-reduction dim coincidentally equal to the reduction extent. Byte-identical seed
  configs across the curriculum (no size coincidences existed).
- test/test_memory_op_facts.py: fact coverage incl. the indexing-slot invariant.
- test/test_barrier.py: update the rdim / config_spec fakes for the new fact build.

stack-info: PR: #2761, branch: calebmkim/stack/2
@calebmkim calebmkim marked this pull request as draft June 12, 2026 00:39
@calebmkim calebmkim changed the base branch from calebmkim/stack/1 to main June 12, 2026 00:39
@calebmkim calebmkim force-pushed the calebmkim/stack/2 branch from c527a01 to 4571ede Compare June 12, 2026 00:39
@calebmkim calebmkim changed the base branch from main to calebmkim/stack/1 June 12, 2026 00:39
@calebmkim calebmkim marked this pull request as ready for review June 12, 2026 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant