3#include <nlohmann/json_fwd.hpp>
50 virtual std::string
name()
const override;
57 virtual void to_json(nlohmann::json& j)
const override;
Note: Even though the class references unique_ptr, it will never delete an SDFG it has a reference to...
Definition structured_sdfg_builder.h:44
Base class for all library nodes in the dataflow graph.
Definition library_node.h:106
virtual std::string name() const override
Get the name of this transformation.
virtual void to_json(nlohmann::json &j) const override
Serialize this transformation to JSON.
static QuantizeContraction from_json(builder::StructuredSDFGBuilder &builder, const nlohmann::json &j)
int bits() const
Definition quantize_contraction.h:61
Rescaling rescaling() const
Definition quantize_contraction.h:65
QuantizeContraction(data_flow::LibraryNode &node, int bits=8, Rescaling rescaling=Rescaling::Exponents)
virtual bool can_be_applied(builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager) override
Check if this transformation can be safely applied.
virtual void apply(builder::StructuredSDFGBuilder &builder, analysis::AnalysisManager &analysis_manager) override
Apply this transformation to the SDFG.
Library node definitions for calling functions beyond simple instructions.
Definition function_builder.h:10
Definition kernel_builder.h:18
Rescaling
How QuantizeContraction applies the scales of A's rows and B's columns to the Int32 products.
Definition quantize_contraction.h:15
@ Exponents
Through the scales' power-of-two exponents in one step, so that no intermediate overflows where the r...
Definition quantize_contraction.h:18
@ Direct
Multiplied by s_A[i] / q and then s_B[j] / q, which needs nothing beyond multiplication but overflows...
Definition quantize_contraction.h:21