|
module { |
|
tt.func public @triton__0d1d2d3d4d5d6d7d8de9de(%arg0: !tt.ptr<f32, 1> {tt.divisibility = 16 : i32}, %arg1: !tt.ptr<f32, 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 %arg1 : (!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 %arg2 : (!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 %arg3 : (!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 %arg4 : (!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 %arg5 : (!tt.ptr<f32, 1>) -> tensor<256x!tt.ptr<f32, 1>> |
|
%22 = tt.addptr %21, %1 : tensor<256x!tt.ptr<f32, 1>>, tensor<256xi32> |
|
%23 = tt.load %22, %2, %cst_3 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<256xf32> |
|
%24 = arith.addf %8, %12 : tensor<256xf32> |
|
%25 = arith.addf %24, %16 : tensor<256xf32> |
|
%26 = arith.addf %25, %20 : tensor<256xf32> |
|
%27 = arith.select %2, %26, %cst_3 : tensor<256xi1>, tensor<256xf32> |
|
%28 = "tt.reduce"(%27) <{axis = 0 : i32}> ({ |
|
^bb0(%arg10: f32, %arg11: f32): |
|
%52 = arith.addf %arg10, %arg11 : f32 |
|
tt.reduce.return %52 : f32 |
|
}) : (tensor<256xf32>) -> f32 |
|
%29 = arith.addf %28, %cst_0 : f32 |
|
%30 = arith.divf %29, %cst_1 : f32 |
|
%31 = tt.splat %30 : (f32) -> tensor<1xf32> |
|
%32 = tt.splat %30 : (f32) -> tensor<256xf32> |
|
%33 = arith.subf %26, %32 : tensor<256xf32> |
|
%34 = arith.mulf %33, %33 : tensor<256xf32> |
|
%35 = arith.select %2, %34, %cst_3 : tensor<256xi1>, tensor<256xf32> |
|
%36 = "tt.reduce"(%35) <{axis = 0 : i32}> ({ |
|
^bb0(%arg10: f32, %arg11: f32): |
|
%52 = arith.addf %arg10, %arg11 : f32 |
|
tt.reduce.return %52 : f32 |
|
}) : (tensor<256xf32>) -> f32 |
|
%37 = arith.addf %36, %cst_0 : f32 |
|
%38 = arith.divf %37, %cst_1 : f32 |
|
%39 = arith.addf %38, %cst_2 : f32 |
|
%40 = tt.extern_elementwise %39 {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 |
|
%41 = tt.splat %40 : (f32) -> tensor<1xf32> |
|
%42 = tt.splat %40 : (f32) -> tensor<256xf32> |
|
%43 = arith.mulf %33, %42 : tensor<256xf32> |
|
%44 = arith.mulf %43, %23 : tensor<256xf32> |
|
gpu.barrier |
|
%45 = tt.addptr %arg0, %0 : !tt.ptr<f32, 1>, i32 |
|
%46 = tt.splat %45 : (!tt.ptr<f32, 1>) -> tensor<1x!tt.ptr<f32, 1>> |
|
tt.store %46, %41 {cache = 1 : i32, evict = 1 : i32} : tensor<1xf32> |
|
%47 = tt.splat %arg7 : (!tt.ptr<bf16, 1>) -> tensor<256x!tt.ptr<bf16, 1>> |
|
%48 = tt.addptr %47, %5 : tensor<256x!tt.ptr<bf16, 1>>, tensor<256xi32> |
|
%49 = arith.truncf %44 : tensor<256xf32> to tensor<256xbf16> |
|
tt.store %48, %49, %2 {cache = 1 : i32, evict = 1 : i32} : tensor<256xbf16> |
|
%50 = tt.addptr %arg6, %0 : !tt.ptr<f32, 1>, i32 |
|
%51 = tt.splat %50 : (!tt.ptr<f32, 1>) -> tensor<1x!tt.ptr<f32, 1>> |
|
tt.store %51, %31 {cache = 1 : i32, evict = 1 : i32} : tensor<1xf32> |
|
tt.return |
|
} |
|
} |
|
|