module { tt.func public @triton__0d1d2d3de4de(%arg0: !tt.ptr {tt.divisibility = 16 : i32}, %arg1: !tt.ptr {tt.divisibility = 16 : i32}, %arg2: !tt.ptr {tt.divisibility = 16 : i32}, %arg3: i32 {tt.divisibility = 16 : i32, tt.max_divisibility = 16 : i32}, %arg4: i32 {tt.divisibility = 16 : i32, tt.max_divisibility = 16 : i32}) attributes {noinline = false} { %cst = arith.constant dense<0.000000e+00> : tensor<64x8xbf16> %c8_i32 = arith.constant 8 : i32 %c128_i32 = arith.constant 128 : i32 %c0_i32 = arith.constant 0 : i32 %cst_0 = arith.constant dense<32768> : tensor<64x1xi32> %cst_1 = arith.constant dense<256> : tensor<1x8xi32> %cst_2 = arith.constant dense<128> : tensor<1x8xi32> %cst_3 = arith.constant dense<0.000000e+00> : tensor<64x8xf32> %cst_4 = arith.constant dense<256> : tensor<64x1xi32> %c64_i32 = arith.constant 64 : i32 %0 = tt.get_program_id x : i32 %1 = arith.muli %0, %c64_i32 : i32 %2 = tt.make_range {end = 64 : i32, start = 0 : i32} : tensor<64xi32> %3 = tt.expand_dims %2 {axis = 1 : i32} : (tensor<64xi32>) -> tensor<64x1xi32> %4 = tt.splat %1 : (i32) -> tensor<64x1xi32> %5 = arith.addi %4, %3 : tensor<64x1xi32> %6 = tt.make_range {end = 8 : i32, start = 0 : i32} : tensor<8xi32> %7 = tt.expand_dims %6 {axis = 0 : i32} : (tensor<8xi32>) -> tensor<1x8xi32> %8 = arith.remsi %5, %cst_4 : tensor<64x1xi32> %9 = arith.divsi %5, %cst_4 : tensor<64x1xi32> %10 = tt.broadcast %8 : (tensor<64x1xi32>) -> tensor<64x8xi32> %11 = arith.muli %9, %cst_0 : tensor<64x1xi32> %12 = tt.broadcast %11 : (tensor<64x1xi32>) -> tensor<64x8xi32> %13 = tt.splat %arg0 : (!tt.ptr) -> tensor<64x8x!tt.ptr> %14 = tt.splat %arg1 : (!tt.ptr) -> tensor<64x8x!tt.ptr> %15 = scf.for %arg5 = %c0_i32 to %c128_i32 step %c8_i32 iter_args(%arg6 = %cst_3) -> (tensor<64x8xf32>) : i32 { %20 = tt.splat %arg5 : (i32) -> tensor<1x8xi32> %21 = arith.addi %20, %7 : tensor<1x8xi32> %22 = arith.cmpi slt, %21, %cst_2 : tensor<1x8xi32> %23 = arith.muli %21, %cst_1 : tensor<1x8xi32> %24 = tt.broadcast %23 : (tensor<1x8xi32>) -> tensor<64x8xi32> %25 = arith.addi %10, %24 : tensor<64x8xi32> %26 = arith.addi %25, %12 : tensor<64x8xi32> %27 = tt.addptr %13, %26 : tensor<64x8x!tt.ptr>, tensor<64x8xi32> %28 = tt.broadcast %22 : (tensor<1x8xi1>) -> tensor<64x8xi1> %29 = tt.load %27, %28, %cst {cache = 1 : i32, evict = 2 : i32, isVolatile = false} : tensor<64x8xbf16> %30 = arith.extf %29 : tensor<64x8xbf16> to tensor<64x8xf32> %31 = tt.addptr %14, %26 : tensor<64x8x!tt.ptr>, tensor<64x8xi32> %32 = tt.load %31, %28, %cst_3 {cache = 1 : i32, evict = 2 : i32, isVolatile = false} : tensor<64x8xf32> %33 = arith.mulf %30, %32 : tensor<64x8xf32> %34 = arith.addf %arg6, %33 : tensor<64x8xf32> %35 = arith.select %28, %34, %arg6 : tensor<64x8xi1>, tensor<64x8xf32> scf.yield %35 : tensor<64x8xf32> } %16 = "tt.reduce"(%15) <{axis = 1 : i32}> ({ ^bb0(%arg5: f32, %arg6: f32): %20 = arith.addf %arg5, %arg6 : f32 tt.reduce.return %20 : f32 }) : (tensor<64x8xf32>) -> tensor<64xf32> %17 = tt.expand_dims %16 {axis = 1 : i32} : (tensor<64xf32>) -> tensor<64x1xf32> %18 = tt.splat %arg2 : (!tt.ptr) -> tensor<64x1x!tt.ptr> %19 = tt.addptr %18, %5 : tensor<64x1x!tt.ptr>, tensor<64x1xi32> tt.store %19, %17 {cache = 1 : i32, evict = 1 : i32} : tensor<64x1xf32> tt.return } }