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

How contractions (MatMul and GEMM nodes) of Float and Double compute, as users select it. More...

#include <sdfg/fp_math/passes/contraction_precision.h>

Public Types

enum class  Kind { Native , Quantize , Ozaki }

Public Member Functions

std::string str () const

Static Public Member Functions

static ContractionPrecision parse (const std::string &spec)

Public Attributes

Kind kind = Kind::Native
OzakiVariant variant = OzakiVariant::Modular
int parameter = 0
 Bits for Quantize, slices or moduli for Ozaki; 0 picks the default.
Rescaling rescaling = Rescaling::Exponents
 How the transformations apply the scales; not part of the spec, but chosen by the target, as Direct for targets without Double, floor or exact powers of two (Ozaki then slices).

Detailed Description

How contractions (MatMul and GEMM nodes) of Float and Double compute, as users select it.

Spec Computation
native unchanged
int8 QuantizeContraction with 8 bits (lossy); int2 ... int7 use fewer
ozaki OzakiContraction, modular, as many moduli as the output precision needs
ozaki1[:s] OzakiContraction, slicing with s slices (default: by precision)
ozaki2[:L] OzakiContraction, modular with L moduli (default: by precision)

Member Enumeration Documentation

◆ Kind

Enumerator
Native 
Quantize 
Ozaki 

Member Function Documentation

◆ parse()

ContractionPrecision sdfg::fp_math::ContractionPrecision::parse ( const std::string & spec)
static
Exceptions
std::invalid_argumentfor a malformed spec

◆ str()

std::string sdfg::fp_math::ContractionPrecision::str ( ) const

Member Data Documentation

◆ kind

Kind sdfg::fp_math::ContractionPrecision::kind = Kind::Native

◆ parameter

int sdfg::fp_math::ContractionPrecision::parameter = 0

Bits for Quantize, slices or moduli for Ozaki; 0 picks the default.

◆ rescaling

Rescaling sdfg::fp_math::ContractionPrecision::rescaling = Rescaling::Exponents

How the transformations apply the scales; not part of the spec, but chosen by the target, as Direct for targets without Double, floor or exact powers of two (Ozaki then slices).

◆ variant

OzakiVariant sdfg::fp_math::ContractionPrecision::variant = OzakiVariant::Modular

The documentation for this struct was generated from the following file: