#blocked = #triton_gpu.blocked<{sizePerThread = [4], threadsPerWarp = [32], warpsPerCTA = [2], order = [0], CTAsPerCGA = [1], CTASplitNum = [1], CTAOrder = [0]}> #blocked1 = #triton_gpu.blocked<{sizePerThread = [1], threadsPerWarp = [32], warpsPerCTA = [2], order = [0], CTAsPerCGA = [1], CTASplitNum = [1], CTAOrder = [0]}> module attributes {"triton_gpu.compute-capability" = 89 : i32, "triton_gpu.num-ctas" = 1 : i32, "triton_gpu.num-warps" = 2 : i32, "triton_gpu.threads-per-warp" = 32 : i32} { tt.func public @triton__0d1d2d3d4d5d6d7de8de(%arg0: !tt.ptr {tt.divisibility = 16 : i32}, %arg1: !tt.ptr {tt.divisibility = 16 : i32}, %arg2: !tt.ptr {tt.divisibility = 16 : i32}, %arg3: !tt.ptr {tt.divisibility = 16 : i32}, %arg4: !tt.ptr {tt.divisibility = 16 : i32}, %arg5: !tt.ptr {tt.divisibility = 16 : i32}, %arg6: !tt.ptr {tt.divisibility = 16 : i32}, %arg7: i32 {tt.divisibility = 16 : i32, tt.max_divisibility = 16 : i32}, %arg8: i32 {tt.divisibility = 16 : i32, tt.max_divisibility = 16 : i32}) attributes {noinline = false} { %cst = arith.constant dense<256> : tensor<256xi32, #blocked> %cst_0 = arith.constant 9.99999974E-6 : f32 %cst_1 = arith.constant 2.560000e+02 : f32 %cst_2 = arith.constant 0.000000e+00 : f32 %c256_i32 = arith.constant 256 : i32 %cst_3 = arith.constant dense<0.000000e+00> : tensor<256xf32, #blocked> %cst_4 = arith.constant dense<0.000000e+00> : tensor<256xbf16, #blocked> %0 = tt.get_program_id x : i32 %1 = tt.make_range {end = 256 : i32, start = 0 : i32} : tensor<256xi32, #blocked> %2 = arith.cmpi slt, %1, %cst : tensor<256xi32, #blocked> %3 = arith.muli %0, %c256_i32 : i32 %4 = tt.splat %3 : (i32) -> tensor<256xi32, #blocked> %5 = arith.addi %1, %4 : tensor<256xi32, #blocked> %6 = tt.splat %arg1 : (!tt.ptr) -> tensor<256x!tt.ptr, #blocked> %7 = tt.addptr %6, %5 : tensor<256x!tt.ptr, #blocked>, tensor<256xi32, #blocked> %8 = tt.load %7, %2, %cst_3 {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<256xf32, #blocked> %9 = tt.splat %arg2 : (!tt.ptr) -> tensor<256x!tt.ptr, #blocked> %10 = tt.addptr %9, %5 : tensor<256x!tt.ptr, #blocked>, tensor<256xi32, #blocked> %11 = tt.load %10, %2, %cst_4 {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<256xbf16, #blocked> %12 = arith.extf %11 : tensor<256xbf16, #blocked> to tensor<256xf32, #blocked> %13 = tt.splat %arg3 : (!tt.ptr) -> tensor<256x!tt.ptr, #blocked> %14 = tt.addptr %13, %5 : tensor<256x!tt.ptr, #blocked>, tensor<256xi32, #blocked> %15 = tt.load %14, %2, %cst_4 {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<256xbf16, #blocked> %16 = arith.extf %15 : tensor<256xbf16, #blocked> to tensor<256xf32, #blocked> %17 = tt.splat %arg4 : (!tt.ptr) -> tensor<256x!tt.ptr, #blocked> %18 = tt.addptr %17, %1 : tensor<256x!tt.ptr, #blocked>, tensor<256xi32, #blocked> %19 = tt.load %18, %2, %cst_3 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<256xf32, #blocked> %20 = arith.addf %8, %12 : tensor<256xf32, #blocked> %21 = arith.addf %20, %16 : tensor<256xf32, #blocked> %22 = arith.select %2, %21, %cst_3 : tensor<256xi1, #blocked>, tensor<256xf32, #blocked> %23 = "tt.reduce"(%22) <{axis = 0 : i32}> ({ ^bb0(%arg9: f32, %arg10: f32): %47 = arith.addf %arg9, %arg10 : f32 tt.reduce.return %47 : f32 }) : (tensor<256xf32, #blocked>) -> f32 %24 = arith.addf %23, %cst_2 : f32 %25 = arith.divf %24, %cst_1 : f32 %26 = tt.splat %25 : (f32) -> tensor<1xf32, #blocked1> %27 = tt.splat %25 : (f32) -> tensor<256xf32, #blocked> %28 = arith.subf %21, %27 : tensor<256xf32, #blocked> %29 = arith.mulf %28, %28 : tensor<256xf32, #blocked> %30 = arith.select %2, %29, %cst_3 : tensor<256xi1, #blocked>, tensor<256xf32, #blocked> %31 = "tt.reduce"(%30) <{axis = 0 : i32}> ({ ^bb0(%arg9: f32, %arg10: f32): %47 = arith.addf %arg9, %arg10 : f32 tt.reduce.return %47 : f32 }) : (tensor<256xf32, #blocked>) -> f32 %32 = arith.addf %31, %cst_2 : f32 %33 = arith.divf %32, %cst_1 : f32 %34 = arith.addf %33, %cst_0 : f32 %35 = tt.extern_elementwise %34 {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 %36 = tt.splat %35 : (f32) -> tensor<1xf32, #blocked1> %37 = tt.splat %35 : (f32) -> tensor<256xf32, #blocked> %38 = arith.mulf %28, %37 : tensor<256xf32, #blocked> %39 = arith.mulf %38, %19 : tensor<256xf32, #blocked> gpu.barrier %40 = tt.addptr %arg0, %0 : !tt.ptr, i32 %41 = tt.splat %40 : (!tt.ptr) -> tensor<1x!tt.ptr, #blocked1> tt.store %41, %36 {cache = 1 : i32, evict = 1 : i32} : tensor<1xf32, #blocked1> %42 = tt.splat %arg6 : (!tt.ptr) -> tensor<256x!tt.ptr, #blocked> %43 = tt.addptr %42, %5 : tensor<256x!tt.ptr, #blocked>, tensor<256xi32, #blocked> %44 = arith.truncf %39 : tensor<256xf32, #blocked> to tensor<256xbf16, #blocked> tt.store %43, %44, %2 {cache = 1 : i32, evict = 1 : i32} : tensor<256xbf16, #blocked> %45 = tt.addptr %arg5, %0 : !tt.ptr, i32 %46 = tt.splat %45 : (!tt.ptr) -> tensor<1x!tt.ptr, #blocked1> tt.store %46, %26 {cache = 1 : i32, evict = 1 : i32} : tensor<1xf32, #blocked1> tt.return } }