#blocked = #triton_gpu.blocked<{sizePerThread = [1, 8], threadsPerWarp = [1, 32], warpsPerCTA = [8, 1], order = [1, 0], CTAsPerCGA = [1, 1], CTASplitNum = [1, 1], CTAOrder = [1, 0]}> #blocked1 = #triton_gpu.blocked<{sizePerThread = [1, 1], threadsPerWarp = [32, 1], warpsPerCTA = [8, 1], order = [1, 0], CTAsPerCGA = [1, 1], CTASplitNum = [1, 1], CTAOrder = [1, 0]}> #blocked2 = #triton_gpu.blocked<{sizePerThread = [1, 1], threadsPerWarp = [1, 32], warpsPerCTA = [1, 8], order = [1, 0], CTAsPerCGA = [1, 1], CTASplitNum = [1, 1], CTAOrder = [1, 0]}> module attributes {"triton_gpu.compute-capability" = 89 : i32, "triton_gpu.num-ctas" = 1 : i32, "triton_gpu.num-warps" = 8 : i32, "triton_gpu.threads-per-warp" = 32 : i32} { tt.func public @triton__0d1d2d3d4d5de6de(%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: i32 {tt.divisibility = 16 : i32, tt.max_divisibility = 16 : i32}, %arg6: i32 {tt.divisibility = 16 : i32, tt.max_divisibility = 16 : i32}) attributes {noinline = false} { %cst = arith.constant dense<512> : tensor<16x1xi32, #blocked> %cst_0 = arith.constant dense<256> : tensor<1x256xi32, #blocked> %cst_1 = arith.constant dense<256> : tensor<16x1xi32, #blocked> %cst_2 = arith.constant dense<1.000000e+00> : tensor<1x256xf32, #blocked> %cst_3 = arith.constant dense<0.000000e+00> : tensor<1x256xf32, #blocked> %cst_4 = arith.constant dense<256> : tensor<16x1xi64, #blocked> %cst_5 = arith.constant dense<50257> : tensor<16x1xi64, #blocked> %cst_6 = arith.constant dense<0> : tensor<16x1xi64, #blocked> %cst_7 = arith.constant dense<0> : tensor<16x1xi64, #blocked1> %cst_8 = arith.constant dense<50257> : tensor<16x1xi64, #blocked1> %cst_9 = arith.constant 0.000000e+00 : f32 %cst_10 = arith.constant dense<0.000000e+00> : tensor<1x256xf32, #blocked2> %cst_11 = arith.constant dense<256> : tensor<1x256xi32, #blocked2> %cst_12 = arith.constant dense<9.99999974E-6> : tensor<16x1xf32, #blocked> %cst_13 = arith.constant dense<2.560000e+02> : tensor<16x1xf32, #blocked> %cst_14 = arith.constant dense<0.000000e+00> : tensor<16x256xf32, #blocked> %c16_i32 = arith.constant 16 : i32 %0 = tt.get_program_id x : i32 %1 = arith.muli %0, %c16_i32 : i32 %2 = tt.make_range {end = 16 : i32, start = 0 : i32} : tensor<16xi32, #triton_gpu.slice<{dim = 1, parent = #blocked}>> %3 = tt.make_range {end = 16 : i32, start = 0 : i32} : tensor<16xi32, #triton_gpu.slice<{dim = 1, parent = #blocked1}>> %4 = tt.expand_dims %2 {axis = 1 : i32} : (tensor<16xi32, #triton_gpu.slice<{dim = 1, parent = #blocked}>>) -> tensor<16x1xi32, #blocked> %5 = tt.expand_dims %3 {axis = 1 : i32} : (tensor<16xi32, #triton_gpu.slice<{dim = 1, parent = #blocked1}>>) -> tensor<16x1xi32, #blocked1> %6 = tt.splat %1 : (i32) -> tensor<16x1xi32, #blocked> %7 = tt.splat %1 : (i32) -> tensor<16x1xi32, #blocked1> %8 = arith.addi %6, %4 : tensor<16x1xi32, #blocked> %9 = arith.addi %7, %5 : tensor<16x1xi32, #blocked1> %10 = tt.make_range {end = 256 : i32, start = 0 : i32} : tensor<256xi32, #triton_gpu.slice<{dim = 0, parent = #blocked}>> %11 = tt.make_range {end = 256 : i32, start = 0 : i32} : tensor<256xi32, #triton_gpu.slice<{dim = 0, parent = #blocked2}>> %12 = tt.expand_dims %10 {axis = 0 : i32} : (tensor<256xi32, #triton_gpu.slice<{dim = 0, parent = #blocked}>>) -> tensor<1x256xi32, #blocked> %13 = tt.expand_dims %11 {axis = 0 : i32} : (tensor<256xi32, #triton_gpu.slice<{dim = 0, parent = #blocked2}>>) -> tensor<1x256xi32, #blocked2> %14 = tt.splat %arg0 : (!tt.ptr) -> tensor<16x1x!tt.ptr, #blocked> %15 = tt.splat %arg0 : (!tt.ptr) -> tensor<16x1x!tt.ptr, #blocked1> %16 = tt.addptr %14, %8 : tensor<16x1x!tt.ptr, #blocked>, tensor<16x1xi32, #blocked> %17 = tt.addptr %15, %9 : tensor<16x1x!tt.ptr, #blocked1>, tensor<16x1xi32, #blocked1> %18 = tt.load %16 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<16x1xi64, #blocked> %19 = tt.load %17 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<16x1xi64, #blocked1> %20 = arith.remsi %8, %cst : tensor<16x1xi32, #blocked> %21 = arith.cmpi slt, %12, %cst_0 : tensor<1x256xi32, #blocked> %22 = arith.cmpi slt, %13, %cst_11 : tensor<1x256xi32, #blocked2> %23 = arith.muli %20, %cst_1 : tensor<16x1xi32, #blocked> %24 = tt.broadcast %12 : (tensor<1x256xi32, #blocked>) -> tensor<16x256xi32, #blocked> %25 = tt.broadcast %23 : (tensor<16x1xi32, #blocked>) -> tensor<16x256xi32, #blocked> %26 = arith.addi %24, %25 : tensor<16x256xi32, #blocked> %27 = tt.splat %arg2 : (!tt.ptr) -> tensor<16x256x!tt.ptr, #blocked> %28 = tt.addptr %27, %26 : tensor<16x256x!tt.ptr, #blocked>, tensor<16x256xi32, #blocked> %29 = tt.broadcast %21 : (tensor<1x256xi1, #blocked>) -> tensor<16x256xi1, #blocked> %30 = tt.load %28, %29, %cst_14 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<16x256xf32, #blocked> %31 = arith.addi %18, %cst_5 : tensor<16x1xi64, #blocked> %32 = arith.addi %19, %cst_8 : tensor<16x1xi64, #blocked1> %33 = arith.cmpi slt, %18, %cst_6 : tensor<16x1xi64, #blocked> %34 = arith.cmpi slt, %19, %cst_7 : tensor<16x1xi64, #blocked1> %35 = arith.select %33, %31, %18 : tensor<16x1xi1, #blocked>, tensor<16x1xi64, #blocked> %36 = arith.select %34, %32, %19 : tensor<16x1xi1, #blocked1>, tensor<16x1xi64, #blocked1> %37 = arith.cmpi sge, %36, %cst_7 : tensor<16x1xi64, #blocked1> %38 = arith.cmpi slt, %36, %cst_8 : tensor<16x1xi64, #blocked1> %39 = arith.andi %37, %38 : tensor<16x1xi1, #blocked1> tt.assert %39, "index out of bounds: 0 <= tmp3 < 50257", "", "_call_with_frames_removed", 883 : tensor<16x1xi1, #blocked1> %40 = arith.muli %35, %cst_4 : tensor<16x1xi64, #blocked> %41 = tt.broadcast %40 : (tensor<16x1xi64, #blocked>) -> tensor<16x256xi64, #blocked> %42 = arith.extsi %12 : tensor<1x256xi32, #blocked> to tensor<1x256xi64, #blocked> %43 = tt.broadcast %42 : (tensor<1x256xi64, #blocked>) -> tensor<16x256xi64, #blocked> %44 = arith.addi %43, %41 : tensor<16x256xi64, #blocked> %45 = tt.splat %arg1 : (!tt.ptr) -> tensor<16x256x!tt.ptr, #blocked> %46 = tt.addptr %45, %44 : tensor<16x256x!tt.ptr, #blocked>, tensor<16x256xi64, #blocked> %47 = tt.load %46, %29, %cst_14 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<16x256xf32, #blocked> %48 = arith.addf %47, %30 : tensor<16x256xf32, #blocked> %49 = arith.addf %48, %cst_14 : tensor<16x256xf32, #blocked> %50 = arith.subf %48, %49 : tensor<16x256xf32, #blocked> %51 = arith.mulf %48, %50 : tensor<16x256xf32, #blocked> %52 = arith.addf %51, %cst_14 : tensor<16x256xf32, #blocked> %53 = arith.select %29, %49, %cst_14 : tensor<16x256xi1, #blocked>, tensor<16x256xf32, #blocked> %54 = arith.select %29, %52, %cst_14 : tensor<16x256xi1, #blocked>, tensor<16x256xf32, #blocked> %55 = arith.select %21, %cst_2, %cst_3 : tensor<1x256xi1, #blocked>, tensor<1x256xf32, #blocked> %56 = tt.broadcast %55 : (tensor<1x256xf32, #blocked>) -> tensor<16x256xf32, #blocked> %57:3 = "tt.reduce"(%53, %54, %56) <{axis = 1 : i32}> ({ ^bb0(%arg7: f32, %arg8: f32, %arg9: f32, %arg10: f32, %arg11: f32, %arg12: f32): %82 = arith.subf %arg10, %arg7 : f32 %83 = arith.addf %arg9, %arg12 : f32 %84 = arith.cmpf oeq, %83, %cst_9 : f32 %85 = arith.divf %arg12, %83 : f32 %86 = arith.select %84, %cst_9, %85 : f32 %87 = arith.mulf %82, %86 : f32 %88 = arith.addf %arg7, %87 : f32 %89 = arith.addf %arg8, %arg11 : f32 %90 = arith.mulf %82, %82 : f32 %91 = arith.mulf %90, %arg9 : f32 %92 = arith.mulf %91, %86 : f32 %93 = arith.addf %89, %92 : f32 tt.reduce.return %88, %93, %83 : f32, f32, f32 }) : (tensor<16x256xf32, #blocked>, tensor<16x256xf32, #blocked>, tensor<16x256xf32, #blocked>) -> (tensor<16xf32, #triton_gpu.slice<{dim = 1, parent = #blocked}>>, tensor<16xf32, #triton_gpu.slice<{dim = 1, parent = #blocked}>>, tensor<16xf32, #triton_gpu.slice<{dim = 1, parent = #blocked}>>) %58 = tt.expand_dims %57#0 {axis = 1 : i32} : (tensor<16xf32, #triton_gpu.slice<{dim = 1, parent = #blocked}>>) -> tensor<16x1xf32, #blocked> %59 = tt.expand_dims %57#1 {axis = 1 : i32} : (tensor<16xf32, #triton_gpu.slice<{dim = 1, parent = #blocked}>>) -> tensor<16x1xf32, #blocked> %60 = tt.load %28, %29, %cst_14 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<16x256xf32, #blocked> %61 = tt.splat %arg3 : (!tt.ptr) -> tensor<1x256x!tt.ptr, #blocked2> %62 = tt.addptr %61, %13 : tensor<1x256x!tt.ptr, #blocked2>, tensor<1x256xi32, #blocked2> %63 = tt.load %62, %22, %cst_10 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<1x256xf32, #blocked2> tt.assert %39, "index out of bounds: 0 <= tmp13 < 50257", "", "_call_with_frames_removed", 883 : tensor<16x1xi1, #blocked1> %64 = tt.load %46, %29, %cst_14 {cache = 1 : i32, evict = 2 : i32, isVolatile = false} : tensor<16x256xf32, #blocked> %65 = arith.addf %64, %60 : tensor<16x256xf32, #blocked> %66 = tt.broadcast %58 : (tensor<16x1xf32, #blocked>) -> tensor<16x256xf32, #blocked> %67 = arith.subf %65, %66 : tensor<16x256xf32, #blocked> %68 = arith.divf %59, %cst_13 : tensor<16x1xf32, #blocked> %69 = arith.addf %68, %cst_12 : tensor<16x1xf32, #blocked> %70 = tt.extern_elementwise %69 {libname = "libdevice", libpath = "/usr/local/lib/python3.10/dist-packages/triton/language/../third_party/cuda/lib/libdevice.10.bc", pure = true, symbol = "__nv_rsqrtf"} : (tensor<16x1xf32, #blocked>) -> tensor<16x1xf32, #blocked> %71 = tt.broadcast %70 : (tensor<16x1xf32, #blocked>) -> tensor<16x256xf32, #blocked> %72 = arith.mulf %67, %71 : tensor<16x256xf32, #blocked> %73 = triton_gpu.convert_layout %63 : (tensor<1x256xf32, #blocked2>) -> tensor<1x256xf32, #blocked> %74 = tt.broadcast %73 : (tensor<1x256xf32, #blocked>) -> tensor<16x256xf32, #blocked> %75 = arith.mulf %72, %74 : tensor<16x256xf32, #blocked> %76 = arith.muli %8, %cst_1 : tensor<16x1xi32, #blocked> %77 = tt.broadcast %76 : (tensor<16x1xi32, #blocked>) -> tensor<16x256xi32, #blocked> %78 = arith.addi %24, %77 : tensor<16x256xi32, #blocked> %79 = tt.splat %arg4 : (!tt.ptr) -> tensor<16x256x!tt.ptr, #blocked> %80 = tt.addptr %79, %78 : tensor<16x256x!tt.ptr, #blocked>, tensor<16x256xi32, #blocked> %81 = arith.truncf %75 : tensor<16x256xf32, #blocked> to tensor<16x256xbf16, #blocked> tt.store %80, %81, %29 {cache = 1 : i32, evict = 1 : i32} : tensor<16x256xbf16, #blocked> tt.return } }