triton.language.dot¶
- triton.language.dot(input, other, acc=None, input_precision=None, allow_tf32=None, max_num_imprecise_acc=None, out_dtype=triton.language.float32, _semantic=None)¶
返回两个块的矩阵乘积。
这两个块必须是二维或三维的,并且内维兼容。对于三维块,tl.dot 执行批处理矩阵乘积,其中每个块的第一个维度表示批处理维度。
- 参数:
input (标量类型为 {
int8
,float8_e5m2
,float16
,bfloat16
,float32
} 的二维或三维张量) – 要相乘的第一个张量。other (标量类型为 {
int8
,float8_e5m2
,float16
,bfloat16
,float32
} 的二维或三维张量) – 要相乘的第二个张量。acc (标量类型为 {
float16
,float32
,int32
} 的二维或三维张量) – 累加器张量。如果不是 None,结果将添加到此张量中。input_precision (字符串。Nvidia 可用选项:
"tf32"
,"tf32x3"
,"ieee"
。默认值:"tf32"
。AMD 可用选项:"ieee"
, (仅限 CDNA3)"tf32"
。) – 如何对 f32 x f32 执行 Tensor Cores 操作。如果设备没有 Tensor Cores 或输入不是 f32 类型,则此选项将被忽略。对于具有 Tensor Cores 的设备,默认精度为 tf32。allow_tf32 – 已弃用。 如果为 true,input_precision 将设置为“tf32”。input_precision 和 allow_tf32 中只能指定一个(即至少一个必须是
None
)。