0-hero's picture
Add files using upload-large-folder tool
9b31431 verified
module {
tt.func public @triton__0d1d2d3d4d5d6de7de(%arg0: !tt.ptr<f32, 1> {tt.divisibility = 16 : i32}, %arg1: !tt.ptr<bf16, 1> {tt.divisibility = 16 : i32}, %arg2: !tt.ptr<f32, 1> {tt.divisibility = 16 : i32}, %arg3: !tt.ptr<f32, 1> {tt.divisibility = 16 : i32}, %arg4: !tt.ptr<f32, 1> {tt.divisibility = 16 : i32}, %arg5: !tt.ptr<bf16, 1> {tt.divisibility = 16 : i32}, %arg6: i32 {tt.divisibility = 16 : i32, tt.max_divisibility = 16 : i32}, %arg7: i32 {tt.divisibility = 16 : i32, tt.max_divisibility = 16 : i32}) attributes {noinline = false} {
%c256_i32 = arith.constant 256 : i32
%cst = arith.constant dense<0.000000e+00> : tensor<256xbf16>
%cst_0 = arith.constant 0.000000e+00 : f32
%cst_1 = arith.constant dense<0.000000e+00> : tensor<256xf32>
%cst_2 = arith.constant dense<2.560000e+02> : tensor<256xf32>
%cst_3 = arith.constant dense<2.560000e+02> : tensor<1xf32>
%cst_4 = arith.constant dense<256> : tensor<256xi32>
%0 = tt.get_program_id x : i32
%1 = tt.make_range {end = 256 : i32, start = 0 : i32} : tensor<256xi32>
%2 = arith.cmpi slt, %1, %cst_4 : tensor<256xi32>
%3 = arith.muli %0, %c256_i32 : i32
%4 = tt.splat %3 : (i32) -> tensor<256xi32>
%5 = arith.addi %1, %4 : tensor<256xi32>
%6 = tt.splat %arg1 : (!tt.ptr<bf16, 1>) -> tensor<256x!tt.ptr<bf16, 1>>
%7 = tt.addptr %6, %5 : tensor<256x!tt.ptr<bf16, 1>>, tensor<256xi32>
%8 = tt.load %7, %2, %cst {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<256xbf16>
%9 = arith.extf %8 : tensor<256xbf16> to tensor<256xf32>
%10 = tt.splat %arg2 : (!tt.ptr<f32, 1>) -> tensor<256x!tt.ptr<f32, 1>>
%11 = tt.addptr %10, %1 : tensor<256x!tt.ptr<f32, 1>>, tensor<256xi32>
%12 = tt.load %11, %2, %cst_1 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<256xf32>
%13 = tt.splat %arg3 : (!tt.ptr<f32, 1>) -> tensor<256x!tt.ptr<f32, 1>>
%14 = tt.addptr %13, %5 : tensor<256x!tt.ptr<f32, 1>>, tensor<256xi32>
%15 = tt.load %14, %2, %cst_1 {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<256xf32>
%16 = tt.splat %arg0 : (!tt.ptr<f32, 1>) -> tensor<256x!tt.ptr<f32, 1>>
%17 = tt.addptr %16, %5 : tensor<256x!tt.ptr<f32, 1>>, tensor<256xi32>
%18 = tt.load %17, %2, %cst_1 {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<256xf32>
%19 = tt.addptr %arg4, %0 : !tt.ptr<f32, 1>, i32
%20 = tt.splat %19 : (!tt.ptr<f32, 1>) -> tensor<1x!tt.ptr<f32, 1>>
%21 = tt.load %20 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<1xf32>
%22 = arith.mulf %9, %12 : tensor<256xf32>
%23 = arith.select %2, %22, %cst_1 : tensor<256xi1>, tensor<256xf32>
%24 = "tt.reduce"(%23) <{axis = 0 : i32}> ({
^bb0(%arg8: f32, %arg9: f32):
%43 = arith.addf %arg8, %arg9 : f32
tt.reduce.return %43 : f32
}) : (tensor<256xf32>) -> f32
%25 = arith.addf %24, %cst_0 : f32
%26 = arith.mulf %22, %15 : tensor<256xf32>
%27 = arith.select %2, %26, %cst_1 : tensor<256xi1>, tensor<256xf32>
%28 = "tt.reduce"(%27) <{axis = 0 : i32}> ({
^bb0(%arg8: f32, %arg9: f32):
%43 = arith.addf %arg8, %arg9 : f32
tt.reduce.return %43 : f32
}) : (tensor<256xf32>) -> f32
%29 = arith.addf %28, %cst_0 : f32
%30 = arith.divf %21, %cst_3 : tensor<1xf32>
%31 = arith.mulf %22, %cst_2 : tensor<256xf32>
%32 = tt.splat %25 : (f32) -> tensor<256xf32>
%33 = arith.subf %31, %32 : tensor<256xf32>
%34 = tt.splat %29 : (f32) -> tensor<256xf32>
%35 = arith.mulf %15, %34 : tensor<256xf32>
%36 = arith.subf %33, %35 : tensor<256xf32>
%37 = tt.broadcast %30 : (tensor<1xf32>) -> tensor<256xf32>
%38 = arith.mulf %37, %36 : tensor<256xf32>
%39 = arith.addf %18, %38 : tensor<256xf32>
tt.store %17, %39, %2 {cache = 1 : i32, evict = 1 : i32} : tensor<256xf32>
%40 = tt.splat %arg5 : (!tt.ptr<bf16, 1>) -> tensor<256x!tt.ptr<bf16, 1>>
%41 = tt.addptr %40, %5 : tensor<256x!tt.ptr<bf16, 1>>, tensor<256xi32>
%42 = arith.truncf %39 : tensor<256xf32> to tensor<256xbf16>
tt.store %41, %42, %2 {cache = 1 : i32, evict = 1 : i32} : tensor<256xbf16>
tt.return
}
}