#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__0d1d2d3d4d5d6d7d8de9de(%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: !tt.ptr {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} { %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, %5 : tensor<256x!tt.ptr, #blocked>, tensor<256xi32, #blocked> %19 = tt.load %18, %2, %cst_4 {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<256xbf16, #blocked> %20 = arith.extf %19 : tensor<256xbf16, #blocked> to tensor<256xf32, #blocked> %21 = tt.splat %arg5 : (!tt.ptr) -> tensor<256x!tt.ptr, #blocked> %22 = tt.addptr %21, %1 : tensor<256x!tt.ptr, #blocked>, tensor<256xi32, #blocked> %23 = tt.load %22, %2, %cst_3 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<256xf32, #blocked> %24 = arith.addf %8, %12 : tensor<256xf32, #blocked> %25 = arith.addf %24, %16 : tensor<256xf32, #blocked> %26 = arith.addf %25, %20 : tensor<256xf32, #blocked> %27 = arith.select %2, %26, %cst_3 : tensor<256xi1, #blocked>, tensor<256xf32, #blocked> %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, #blocked>) -> f32 %29 = arith.addf %28, %cst_2 : f32 %30 = arith.divf %29, %cst_1 : f32 %31 = tt.splat %30 : (f32) -> tensor<1xf32, #blocked1> %32 = tt.splat %30 : (f32) -> tensor<256xf32, #blocked> %33 = arith.subf %26, %32 : tensor<256xf32, #blocked> %34 = arith.mulf %33, %33 : tensor<256xf32, #blocked> %35 = arith.select %2, %34, %cst_3 : tensor<256xi1, #blocked>, tensor<256xf32, #blocked> %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, #blocked>) -> f32 %37 = arith.addf %36, %cst_2 : f32 %38 = arith.divf %37, %cst_1 : f32 %39 = arith.addf %38, %cst_0 : 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, #blocked1> %42 = tt.splat %40 : (f32) -> tensor<256xf32, #blocked> %43 = arith.mulf %33, %42 : tensor<256xf32, #blocked> %44 = arith.mulf %43, %23 : tensor<256xf32, #blocked> gpu.barrier %45 = tt.addptr %arg0, %0 : !tt.ptr, i32 %46 = tt.splat %45 : (!tt.ptr) -> tensor<1x!tt.ptr, #blocked1> tt.store %46, %41 {cache = 1 : i32, evict = 1 : i32} : tensor<1xf32, #blocked1> %47 = tt.splat %arg7 : (!tt.ptr) -> tensor<256x!tt.ptr, #blocked> %48 = tt.addptr %47, %5 : tensor<256x!tt.ptr, #blocked>, tensor<256xi32, #blocked> %49 = arith.truncf %44 : tensor<256xf32, #blocked> to tensor<256xbf16, #blocked> tt.store %48, %49, %2 {cache = 1 : i32, evict = 1 : i32} : tensor<256xbf16, #blocked> %50 = tt.addptr %arg6, %0 : !tt.ptr, i32 %51 = tt.splat %50 : (!tt.ptr) -> tensor<1x!tt.ptr, #blocked1> tt.store %51, %31 {cache = 1 : i32, evict = 1 : i32} : tensor<1xf32, #blocked1> tt.return } }