docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sdfg::structured_control_flow::ReductionInfo Struct Reference

A single reduction carried by a Reduce loop. More...

#include <sdfg/structured_control_flow/reduce.h>

Public Attributes

ReductionOperation operation
std::string container
symbolic::Expression original_index = SymEngine::null
std::string rescale = ""
RescaleBase rescale_base = RescaleBase::E

Detailed Description

A single reduction carried by a Reduce loop.

Pairs an associative/commutative ReductionOperation with the name of the accumulator container it combines into. The container name identifies which access node / memlet in the loop body holds the accumulator; the concrete subset (for partial reductions over arrays or struct members) is left to the body's memlets so that there is a single source of truth for where the accumulator lives.

A Reduce may carry several of these at once (e.g. a fused sum and max), which is why the node stores a collection rather than a single operator.

A rescaled reduction (non-empty rescale) is an Add whose partials stand for value * base^anchor, where the anchor is a Max reduction of the same Reduce (e.g. the online-softmax denominator, or the FlashAttention output, relative to the running max). Combining partials rescales them to the merged anchor; the body is responsible for keeping its dependents relative to the anchor in the same base.

Member Data Documentation

◆ container

std::string sdfg::structured_control_flow::ReductionInfo::container

◆ operation

ReductionOperation sdfg::structured_control_flow::ReductionInfo::operation

◆ original_index

symbolic::Expression sdfg::structured_control_flow::ReductionInfo::original_index = SymEngine::null

◆ rescale

std::string sdfg::structured_control_flow::ReductionInfo::rescale = ""

◆ rescale_base

RescaleBase sdfg::structured_control_flow::ReductionInfo::rescale_base = RescaleBase::E

The documentation for this struct was generated from the following file:
  • sdfg/include/sdfg/structured_control_flow/reduce.h