@@ -116,12 +116,17 @@ enum OutputValueKind : byte {
116116// axis). Scales (and, if asymmetric, zero-points) are shipped out-of-line via the
117117// external constant file, keyed by data_key (empty zero_point_data_key means symmetric).
118118// Their shapes derive from the weight shape and group_size, but their dtypes do not,
119- // so they are recorded here. The dequant result dtype is the op output value's
120- // TensorMeta. dtype, not part of this scheme. The qdata itself ( the enclosing
121- // TensorMeta) uses dtype=BYTE with logical sizes; its packed byte length follows from
122- // the logical shape and bitwidth , not prod(sizes). The scale and zero-point keys must
119+ // so they are recorded here. The qdata itself ( the enclosing TensorMeta) uses
120+ // dtype=BYTE with logical sizes. Sub-byte packing is flat over the elements in
121+ // memory order with no per-row padding, so the packed byte length is
122+ // ceil(numel * bitwidth / 8) , not prod(sizes). The scale and zero-point keys must
123123// be read-only stored constants of every method that uses the quantized tensor,
124124// whether that tensor is itself a constant or a graph value such as a user input.
125+ //
126+ // A quantized tensor may feed an explicit dequant op, whose output TensorMeta.dtype
127+ // gives the result dtype, or it may be a direct op operand. A direct operand denotes
128+ // its decoded value with dtype scale_dtype; an engine must lower the consuming op,
129+ // materialize the decode, or reject the program.
125130table AffineGroup {
126131 scale_data_key : string (required );
127132 scale_dtype : ScalarType ; // FLOAT, HALF, or BFLOAT16; not derivable
0 commit comments