yum-archive/TaSTT-Whisper

High-performance GPGPU inference of OpenAI's Whisper automatic speech recognition (ASR) model

git clone https://git.yummers.dev/yum-archive/TaSTT-Whisper

KonstantinSource codes8c4603c

master
933 B33 linesraw
1// GGML_TASK_INIT step for matrix*matrix product, where nb01 >= nb00;
2// Dispatch with [ ne11, ne12 ] groups
3Buffer<float> arg0: register( t0 );
4RWBuffer<float> result: register( u0 );
5
6cbuffer Constants: register( b0 )
7{
8	uint4 src0_elements: packoffset( c0 );
9	uint4 src0_strides: packoffset( c1 );
10}
11
12#include "miscUtils.hlsli"
13
14// Each thread group of this shader copies a single rows of the matrix
15[ numthreads( 32, 1, 1 ) ]
16void main( uint3 group: SV_GroupID, uint thread : SV_GroupIndex )
17{
18	const uint i12 = group.y;
19	const uint i11 = group.x;
20	const uint ne10 = src0_elements.x;
21	const uint ne11 = src0_elements.y;
22	const uint nb12 = src0_strides.z;
23	const uint nb11 = src0_strides.y;
24
25	uint rdi = i11 * ne10 + i12 * ne10 * ne11;
26	const uint rdiEnd = rdi + ne10;
27	uint rsi = i12 * nb12 + i11 * nb11;
28	rdi += thread;
29	rsi += thread;
30
31	for( ; rdi < rdiEnd; rdi += 32, rsi += 32 )
32		result[ rdi ] = adjustFp16( arg0[ rsi ] );
33}