0-hero's picture
Add files using upload-large-folder tool
9ab9a5e verified
module {
tt.func public @triton__0d1d2de(%arg0: !tt.ptr<i64, 1> {tt.divisibility = 16 : i32}, %arg1: !tt.ptr<f32, 1> {tt.divisibility = 16 : i32}, %arg2: i64 {tt.divisibility = 16 : i32, tt.max_divisibility = 16 : i32}) attributes {noinline = false} {
%cst = arith.constant dense<50257> : tensor<512xi64>
%cst_0 = arith.constant dense<0> : tensor<512xi64>
%c512_i64 = arith.constant 512 : i64
%cst_1 = arith.constant dense<-1.000000e+00> : tensor<512xf32>
%cst_2 = arith.constant dense<-1> : tensor<512xi64>
%0 = tt.get_program_id x : i32
%1 = arith.extsi %0 : i32 to i64
%2 = arith.muli %1, %c512_i64 : i64
%3 = tt.make_range {end = 512 : i32, start = 0 : i32} : tensor<512xi32>
%4 = arith.extsi %3 : tensor<512xi32> to tensor<512xi64>
%5 = tt.splat %2 : (i64) -> tensor<512xi64>
%6 = arith.addi %5, %4 : tensor<512xi64>
%7 = tt.splat %arg0 : (!tt.ptr<i64, 1>) -> tensor<512x!tt.ptr<i64, 1>>
%8 = tt.addptr %7, %6 : tensor<512x!tt.ptr<i64, 1>>, tensor<512xi64>
%9 = tt.load %8 {cache = 1 : i32, evict = 1 : i32, isVolatile = false} : tensor<512xi64>
%10 = arith.cmpi ne, %9, %cst_2 : tensor<512xi64>
%11 = arith.select %10, %9, %cst_0 : tensor<512xi1>, tensor<512xi64>
%12 = arith.addi %11, %cst : tensor<512xi64>
%13 = arith.cmpi slt, %11, %cst_0 : tensor<512xi64>
%14 = arith.select %13, %12, %11 : tensor<512xi1>, tensor<512xi64>
%15 = arith.cmpi sge, %14, %cst_0 : tensor<512xi64>
%16 = arith.cmpi slt, %14, %cst : tensor<512xi64>
%17 = arith.andi %15, %16 : tensor<512xi1>
tt.assert %17, "index out of bounds: 0 <= tmp7 < 50257", "<frozen importlib._bootstrap_external>", "_call_with_frames_removed", 883 : tensor<512xi1>
%18 = arith.muli %6, %cst : tensor<512xi64>
%19 = arith.addi %14, %18 : tensor<512xi64>
%20 = tt.splat %arg1 : (!tt.ptr<f32, 1>) -> tensor<512x!tt.ptr<f32, 1>>
%21 = tt.addptr %20, %19 : tensor<512x!tt.ptr<f32, 1>>, tensor<512xi64>
tt.store %21, %cst_1 {cache = 1 : i32, evict = 1 : i32} : tensor<512xf32>
tt.return
}
}