|
#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__0d1d2d3d4d5d6de7de(%arg0: !tt.ptr<i64, 1> {tt.divisibility = 16 : i32}, %arg1: !tt.ptr<f32, 1> {tt.divisibility = 16 : i32}, %arg2: !tt.ptr<f32, 1> {tt.divisibility = 16 : i32}, %arg3: !tt.ptr<bf16, 1> {tt.divisibility = 16 : i32}, %arg4: !tt.ptr<f32, 1> {tt.divisibility = 16 : i32}, %arg5: !tt.ptr<bf16, 1> {tt.divisibility = 16 : i32}, %arg6: i32 {tt.divisibility = 16 : i32, tt.max_divisibility = 16 : i32}, %arg7: 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> |
|
%cst_15 = arith.constant dense<0.000000e+00> : tensor<16x256xbf16, #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<i64, 1>) -> tensor<16x1x!tt.ptr<i64, 1>, #blocked> |
|
%15 = tt.splat %arg0 : (!tt.ptr<i64, 1>) -> tensor<16x1x!tt.ptr<i64, 1>, #blocked1> |
|
%16 = tt.addptr %14, %8 : tensor<16x1x!tt.ptr<i64, 1>, #blocked>, tensor<16x1xi32, #blocked> |
|
%17 = tt.addptr %15, %9 : tensor<16x1x!tt.ptr<i64, 1>, #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<f32, 1>) -> tensor<16x256x!tt.ptr<f32, 1>, #blocked> |
|
%28 = tt.addptr %27, %26 : tensor<16x256x!tt.ptr<f32, 1>, #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.muli %8, %cst_1 : tensor<16x1xi32, #blocked> |
|
%32 = tt.broadcast %31 : (tensor<16x1xi32, #blocked>) -> tensor<16x256xi32, #blocked> |
|
%33 = arith.addi %24, %32 : tensor<16x256xi32, #blocked> |
|
%34 = tt.splat %arg3 : (!tt.ptr<bf16, 1>) -> tensor<16x256x!tt.ptr<bf16, 1>, #blocked> |
|
%35 = tt.addptr %34, %33 : tensor<16x256x!tt.ptr<bf16, 1>, #blocked>, tensor<16x256xi32, #blocked> |
|
%36 = tt.load %35, %29, %cst_15 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<16x256xbf16, #blocked> |
|
%37 = arith.extf %36 : tensor<16x256xbf16, #blocked> to tensor<16x256xf32, #blocked> |
|
%38 = arith.addi %18, %cst_5 : tensor<16x1xi64, #blocked> |
|
%39 = arith.addi %19, %cst_8 : tensor<16x1xi64, #blocked1> |
|
%40 = arith.cmpi slt, %18, %cst_6 : tensor<16x1xi64, #blocked> |
|
%41 = arith.cmpi slt, %19, %cst_7 : tensor<16x1xi64, #blocked1> |
|
%42 = arith.select %40, %38, %18 : tensor<16x1xi1, #blocked>, tensor<16x1xi64, #blocked> |
|
%43 = arith.select %41, %39, %19 : tensor<16x1xi1, #blocked1>, tensor<16x1xi64, #blocked1> |
|
%44 = arith.cmpi sge, %43, %cst_7 : tensor<16x1xi64, #blocked1> |
|
%45 = arith.cmpi slt, %43, %cst_8 : tensor<16x1xi64, #blocked1> |
|
%46 = arith.andi %44, %45 : tensor<16x1xi1, #blocked1> |
|
tt.assert %46, "index out of bounds: 0 <= tmp3 < 50257", "<frozen importlib._bootstrap_external>", "_call_with_frames_removed", 883 : tensor<16x1xi1, #blocked1> |
|
%47 = arith.muli %42, %cst_4 : tensor<16x1xi64, #blocked> |
|
%48 = tt.broadcast %47 : (tensor<16x1xi64, #blocked>) -> tensor<16x256xi64, #blocked> |
|
%49 = arith.extsi %12 : tensor<1x256xi32, #blocked> to tensor<1x256xi64, #blocked> |
|
%50 = tt.broadcast %49 : (tensor<1x256xi64, #blocked>) -> tensor<16x256xi64, #blocked> |
|
%51 = arith.addi %50, %48 : tensor<16x256xi64, #blocked> |
|
%52 = tt.splat %arg1 : (!tt.ptr<f32, 1>) -> tensor<16x256x!tt.ptr<f32, 1>, #blocked> |
|
%53 = tt.addptr %52, %51 : tensor<16x256x!tt.ptr<f32, 1>, #blocked>, tensor<16x256xi64, #blocked> |
|
%54 = tt.load %53, %29, %cst_14 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<16x256xf32, #blocked> |
|
%55 = arith.addf %54, %30 : tensor<16x256xf32, #blocked> |
|
%56 = arith.addf %55, %37 : tensor<16x256xf32, #blocked> |
|
%57 = arith.addf %56, %cst_14 : tensor<16x256xf32, #blocked> |
|
%58 = arith.subf %56, %57 : tensor<16x256xf32, #blocked> |
|
%59 = arith.mulf %56, %58 : tensor<16x256xf32, #blocked> |
|
%60 = arith.addf %59, %cst_14 : tensor<16x256xf32, #blocked> |
|
%61 = arith.select %29, %57, %cst_14 : tensor<16x256xi1, #blocked>, tensor<16x256xf32, #blocked> |
|
%62 = arith.select %29, %60, %cst_14 : tensor<16x256xi1, #blocked>, tensor<16x256xf32, #blocked> |
|
%63 = arith.select %21, %cst_2, %cst_3 : tensor<1x256xi1, #blocked>, tensor<1x256xf32, #blocked> |
|
%64 = tt.broadcast %63 : (tensor<1x256xf32, #blocked>) -> tensor<16x256xf32, #blocked> |
|
%65:3 = "tt.reduce"(%61, %62, %64) <{axis = 1 : i32}> ({ |
|
^bb0(%arg8: f32, %arg9: f32, %arg10: f32, %arg11: f32, %arg12: f32, %arg13: f32): |
|
%90 = arith.subf %arg11, %arg8 : f32 |
|
%91 = arith.addf %arg10, %arg13 : f32 |
|
%92 = arith.cmpf oeq, %91, %cst_9 : f32 |
|
%93 = arith.divf %arg13, %91 : f32 |
|
%94 = arith.select %92, %cst_9, %93 : f32 |
|
%95 = arith.mulf %90, %94 : f32 |
|
%96 = arith.addf %arg8, %95 : f32 |
|
%97 = arith.addf %arg9, %arg12 : f32 |
|
%98 = arith.mulf %90, %90 : f32 |
|
%99 = arith.mulf %98, %arg10 : f32 |
|
%100 = arith.mulf %99, %94 : f32 |
|
%101 = arith.addf %97, %100 : f32 |
|
tt.reduce.return %96, %101, %91 : 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}>>) |
|
%66 = tt.expand_dims %65#0 {axis = 1 : i32} : (tensor<16xf32, #triton_gpu.slice<{dim = 1, parent = #blocked}>>) -> tensor<16x1xf32, #blocked> |
|
%67 = tt.expand_dims %65#1 {axis = 1 : i32} : (tensor<16xf32, #triton_gpu.slice<{dim = 1, parent = #blocked}>>) -> tensor<16x1xf32, #blocked> |
|
%68 = tt.load %28, %29, %cst_14 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<16x256xf32, #blocked> |
|
%69 = tt.load %35, %29, %cst_15 {cache = 1 : i32, evict = 2 : i32, isVolatile = false} : tensor<16x256xbf16, #blocked> |
|
%70 = arith.extf %69 : tensor<16x256xbf16, #blocked> to tensor<16x256xf32, #blocked> |
|
%71 = tt.splat %arg4 : (!tt.ptr<f32, 1>) -> tensor<1x256x!tt.ptr<f32, 1>, #blocked2> |
|
%72 = tt.addptr %71, %13 : tensor<1x256x!tt.ptr<f32, 1>, #blocked2>, tensor<1x256xi32, #blocked2> |
|
%73 = tt.load %72, %22, %cst_10 {cache = 1 : i32, evict = 3 : i32, isVolatile = false} : tensor<1x256xf32, #blocked2> |
|
tt.assert %46, "index out of bounds: 0 <= tmp16 < 50257", "<frozen importlib._bootstrap_external>", "_call_with_frames_removed", 883 : tensor<16x1xi1, #blocked1> |
|
%74 = tt.load %53, %29, %cst_14 {cache = 1 : i32, evict = 2 : i32, isVolatile = false} : tensor<16x256xf32, #blocked> |
|
%75 = arith.addf %74, %68 : tensor<16x256xf32, #blocked> |
|
%76 = arith.addf %75, %70 : tensor<16x256xf32, #blocked> |
|
%77 = tt.broadcast %66 : (tensor<16x1xf32, #blocked>) -> tensor<16x256xf32, #blocked> |
|
%78 = arith.subf %76, %77 : tensor<16x256xf32, #blocked> |
|
%79 = arith.divf %67, %cst_13 : tensor<16x1xf32, #blocked> |
|
%80 = arith.addf %79, %cst_12 : tensor<16x1xf32, #blocked> |
|
%81 = tt.extern_elementwise %80 {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> |
|
%82 = tt.broadcast %81 : (tensor<16x1xf32, #blocked>) -> tensor<16x256xf32, #blocked> |
|
%83 = arith.mulf %78, %82 : tensor<16x256xf32, #blocked> |
|
%84 = triton_gpu.convert_layout %73 : (tensor<1x256xf32, #blocked2>) -> tensor<1x256xf32, #blocked> |
|
%85 = tt.broadcast %84 : (tensor<1x256xf32, #blocked>) -> tensor<16x256xf32, #blocked> |
|
%86 = arith.mulf %83, %85 : tensor<16x256xf32, #blocked> |
|
%87 = tt.splat %arg5 : (!tt.ptr<bf16, 1>) -> tensor<16x256x!tt.ptr<bf16, 1>, #blocked> |
|
%88 = tt.addptr %87, %33 : tensor<16x256x!tt.ptr<bf16, 1>, #blocked>, tensor<16x256xi32, #blocked> |
|
%89 = arith.truncf %86 : tensor<16x256xf32, #blocked> to tensor<16x256xbf16, #blocked> |
|
tt.store %88, %89, %29 {cache = 1 : i32, evict = 1 : i32} : tensor<16x256xbf16, #blocked> |
|
tt.return |
|
} |
|
} |
|
|