0-hero's picture
Add files using upload-large-folder tool
00602c7 verified
module {
tt.func public @triton__0d1d2d3d4d5d6d7d8de9de(%arg0: !tt.ptr<f32, 1> {tt.divisibility = 16 : i32}, %arg1: !tt.ptr<bf16, 1> {tt.divisibility = 16 : i32}, %arg2: !tt.ptr<bf16, 1> {tt.divisibility = 16 : i32}, %arg3: !tt.ptr<bf16, 1> {tt.divisibility = 16 : i32}, %arg4: !tt.ptr<bf16, 1> {tt.divisibility = 16 : i32}, %arg5: !tt.ptr<f32, 1> {tt.divisibility = 16 : i32}, %arg6: !tt.ptr<f32, 1> {tt.divisibility = 16 : i32}, %arg7: !tt.ptr<bf16, 1> {tt.divisibility = 16 : i32}, %arg8: i32 {tt.divisibility = 16 : i32, tt.max_divisibility = 16 : i32}, %arg9: 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 2.560000e+02 : f32
%cst_2 = arith.constant 9.99999974E-6 : f32
%cst_3 = arith.constant dense<0.000000e+00> : tensor<256xf32>
%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 %arg0 : (!tt.ptr<f32, 1>) -> tensor<256x!tt.ptr<f32, 1>>
%7 = tt.addptr %6, %5 : tensor<256x!tt.ptr<f32, 1>>, tensor<256xi32>
%8 = tt.load %7, %2, %cst_3 {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<256xf32>
%9 = tt.splat %arg1 : (!tt.ptr<bf16, 1>) -> tensor<256x!tt.ptr<bf16, 1>>
%10 = tt.addptr %9, %5 : tensor<256x!tt.ptr<bf16, 1>>, tensor<256xi32>
%11 = tt.load %10, %2, %cst {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<256xbf16>
%12 = arith.extf %11 : tensor<256xbf16> to tensor<256xf32>
%13 = tt.splat %arg2 : (!tt.ptr<bf16, 1>) -> tensor<256x!tt.ptr<bf16, 1>>
%14 = tt.addptr %13, %5 : tensor<256x!tt.ptr<bf16, 1>>, tensor<256xi32>
%15 = tt.load %14, %2, %cst {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<256xbf16>
%16 = arith.extf %15 : tensor<256xbf16> to tensor<256xf32>
%17 = tt.splat %arg3 : (!tt.ptr<bf16, 1>) -> tensor<256x!tt.ptr<bf16, 1>>
%18 = tt.addptr %17, %5 : tensor<256x!tt.ptr<bf16, 1>>, tensor<256xi32>
%19 = tt.load %18, %2, %cst {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<256xbf16>
%20 = arith.extf %19 : tensor<256xbf16> to tensor<256xf32>
%21 = tt.splat %arg4 : (!tt.ptr<bf16, 1>) -> tensor<256x!tt.ptr<bf16, 1>>
%22 = tt.addptr %21, %5 : tensor<256x!tt.ptr<bf16, 1>>, tensor<256xi32>
%23 = tt.load %22, %2, %cst {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<256xbf16>
%24 = arith.extf %23 : tensor<256xbf16> to tensor<256xf32>
%25 = tt.splat %arg5 : (!tt.ptr<f32, 1>) -> tensor<256x!tt.ptr<f32, 1>>
%26 = tt.addptr %25, %1 : tensor<256x!tt.ptr<f32, 1>>, tensor<256xi32>
%27 = tt.load %26, %2, %cst_3 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<256xf32>
%28 = arith.addf %8, %12 : tensor<256xf32>
%29 = arith.addf %28, %16 : tensor<256xf32>
%30 = arith.addf %29, %20 : tensor<256xf32>
%31 = arith.addf %30, %24 : tensor<256xf32>
%32 = arith.select %2, %31, %cst_3 : tensor<256xi1>, tensor<256xf32>
%33 = "tt.reduce"(%32) <{axis = 0 : i32}> ({
^bb0(%arg10: f32, %arg11: f32):
%53 = arith.addf %arg10, %arg11 : f32
tt.reduce.return %53 : f32
}) : (tensor<256xf32>) -> f32
%34 = arith.addf %33, %cst_0 : f32
%35 = arith.divf %34, %cst_1 : f32
%36 = tt.splat %35 : (f32) -> tensor<256xf32>
%37 = arith.subf %31, %36 : tensor<256xf32>
%38 = arith.mulf %37, %37 : tensor<256xf32>
%39 = arith.select %2, %38, %cst_3 : tensor<256xi1>, tensor<256xf32>
%40 = "tt.reduce"(%39) <{axis = 0 : i32}> ({
^bb0(%arg10: f32, %arg11: f32):
%53 = arith.addf %arg10, %arg11 : f32
tt.reduce.return %53 : f32
}) : (tensor<256xf32>) -> f32
%41 = arith.addf %40, %cst_0 : f32
%42 = arith.divf %41, %cst_1 : f32
%43 = arith.addf %42, %cst_2 : f32
%44 = tt.extern_elementwise %43 {libname = "libdevice", libpath = "/usr/local/lib/python3.10/dist-packages/triton/language/../third_party/cuda/lib/libdevice.10.bc", pure = true, symbol = "__nv_rsqrtf"} : (f32) -> f32
%45 = tt.splat %44 : (f32) -> tensor<256xf32>
%46 = arith.mulf %37, %45 : tensor<256xf32>
%47 = arith.mulf %46, %27 : tensor<256xf32>
%48 = tt.splat %arg6 : (!tt.ptr<f32, 1>) -> tensor<256x!tt.ptr<f32, 1>>
%49 = tt.addptr %48, %5 : tensor<256x!tt.ptr<f32, 1>>, tensor<256xi32>
tt.store %49, %31, %2 {cache = 1 : i32, evict = 1 : i32} : tensor<256xf32>
%50 = tt.splat %arg7 : (!tt.ptr<bf16, 1>) -> tensor<256x!tt.ptr<bf16, 1>>
%51 = tt.addptr %50, %5 : tensor<256x!tt.ptr<bf16, 1>>, tensor<256xi32>
%52 = arith.truncf %47 : tensor<256xf32> to tensor<256xbf16>
tt.store %51, %52, %2 {cache = 1 : i32, evict = 1 : i32} : tensor<256xbf16>
tt.return
}
}