#loc = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1758:5) #loc4 = loc(unknown) #loc30 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1777:17) #loc37 = loc("Input"(#loc)) #loc38 = loc("Output"(#loc)) #loc39 = loc("Scale"(#loc)) #loc40 = loc("L"(#loc)) #loc41 = loc("stride_iz"(#loc)) #loc42 = loc("stride_ih"(#loc)) #loc43 = loc("stride_in"(#loc)) #loc44 = loc("stride_oz"(#loc)) #loc45 = loc("stride_oh"(#loc)) #loc46 = loc("stride_on"(#loc)) #loc47 = loc("stride_sz"(#loc)) #loc48 = loc("stride_sh"(#loc)) #loc76 = loc("scale"(#loc30)) #loc81 = loc(callsite(#loc4 at #loc76)) module { tt.func public @_quant_query_per_thread_int8_i64_kernel(%Input: !tt.ptr {tt.divisibility = 16 : i32} loc("Input"(#loc)), %Output: !tt.ptr {tt.divisibility = 16 : i32} loc("Output"(#loc)), %Scale: !tt.ptr {tt.divisibility = 16 : i32} loc("Scale"(#loc)), %L: i32 loc("L"(#loc)), %stride_iz: i32 {tt.divisibility = 16 : i32} loc("stride_iz"(#loc)), %stride_ih: i32 {tt.divisibility = 16 : i32} loc("stride_ih"(#loc)), %stride_in: i32 {tt.divisibility = 16 : i32} loc("stride_in"(#loc)), %stride_oz: i32 {tt.divisibility = 16 : i32} loc("stride_oz"(#loc)), %stride_oh: i32 {tt.divisibility = 16 : i32} loc("stride_oh"(#loc)), %stride_on: i32 {tt.divisibility = 16 : i32} loc("stride_on"(#loc)), %stride_sz: i32 {tt.divisibility = 16 : i32} loc("stride_sz"(#loc)), %stride_sh: i32 {tt.divisibility = 16 : i32} loc("stride_sh"(#loc))) attributes {noinline = false} { %x_int8 = arith.constant dense<0.000000e+00> : tensor<4x128xf32> loc(#loc49) %x_int8_0 = arith.constant dense<5.000000e-01> : tensor<4x128xf32> loc(#loc50) %x_int8_1 = arith.constant dense<-1> : tensor<4x128xi32> loc(#loc51) %x_int8_2 = arith.constant dense<1> : tensor<4x128xi32> loc(#loc51) %cst = arith.constant 1.000000e-07 : f32 loc(#loc4) %cst_3 = arith.constant 1.270000e+02 : f32 loc(#loc4) %offs_n = arith.constant dense<8> : tensor<4xi32> loc(#loc52) %c32_i32 = arith.constant 32 : i32 loc(#loc4) %c8_i32 = arith.constant 8 : i32 loc(#loc4) %off_blk = tt.get_program_id x : i32 loc(#loc53) %off_blk_4 = arith.divsi %off_blk, %c8_i32 : i32 loc(#loc53) %off_tld = arith.remsi %off_blk, %c8_i32 : i32 loc(#loc54) %off_h = tt.get_program_id y : i32 loc(#loc55) %off_b = tt.get_program_id z : i32 loc(#loc56) %offs_n_5 = arith.muli %off_blk_4, %c32_i32 : i32 loc(#loc57) %offs_n_6 = tt.make_range {end = 4 : i32, start = 0 : i32} : tensor<4xi32> loc(#loc52) %offs_n_7 = arith.muli %offs_n_6, %offs_n : tensor<4xi32> loc(#loc52) %offs_n_8 = tt.splat %offs_n_5 : i32 -> tensor<4xi32> loc(#loc57) %offs_n_9 = arith.addi %offs_n_8, %offs_n_7 : tensor<4xi32> loc(#loc57) %offs_n_10 = tt.splat %off_tld : i32 -> tensor<4xi32> loc(#loc57) %offs_n_11 = arith.addi %offs_n_9, %offs_n_10 : tensor<4xi32> loc(#loc57) %offs_k = tt.make_range {end = 128 : i32, start = 0 : i32} : tensor<128xi32> loc(#loc58) %input_ptrs = arith.muli %off_b, %stride_iz : i32 loc(#loc59) %input_ptrs_12 = tt.addptr %Input, %input_ptrs : !tt.ptr, i32 loc(#loc60) %input_ptrs_13 = arith.muli %off_h, %stride_ih : i32 loc(#loc61) %input_ptrs_14 = tt.addptr %input_ptrs_12, %input_ptrs_13 : !tt.ptr, i32 loc(#loc60) %input_ptrs_15 = tt.expand_dims %offs_n_11 {axis = 1 : i32} : tensor<4xi32> -> tensor<4x1xi32> loc(#loc62) %input_ptrs_16 = arith.extsi %input_ptrs_15 : tensor<4x1xi32> to tensor<4x1xi64> loc(#loc62) %input_ptrs_17 = arith.extsi %stride_in : i32 to i64 loc(#loc62) %input_ptrs_18 = tt.splat %input_ptrs_17 : i64 -> tensor<4x1xi64> loc(#loc62) %input_ptrs_19 = arith.muli %input_ptrs_16, %input_ptrs_18 : tensor<4x1xi64> loc(#loc62) %input_ptrs_20 = tt.splat %input_ptrs_14 : !tt.ptr -> tensor<4x1x!tt.ptr> loc(#loc60) %input_ptrs_21 = tt.addptr %input_ptrs_20, %input_ptrs_19 : tensor<4x1x!tt.ptr>, tensor<4x1xi64> loc(#loc60) %input_ptrs_22 = tt.expand_dims %offs_k {axis = 0 : i32} : tensor<128xi32> -> tensor<1x128xi32> loc(#loc63) %input_ptrs_23 = tt.broadcast %input_ptrs_21 : tensor<4x1x!tt.ptr> -> tensor<4x128x!tt.ptr> loc(#loc60) %input_ptrs_24 = tt.broadcast %input_ptrs_22 : tensor<1x128xi32> -> tensor<4x128xi32> loc(#loc60) %input_ptrs_25 = tt.addptr %input_ptrs_23, %input_ptrs_24 : tensor<4x128x!tt.ptr>, tensor<4x128xi32> loc(#loc60) %output_ptrs = arith.muli %off_b, %stride_oz : i32 loc(#loc64) %output_ptrs_26 = tt.addptr %Output, %output_ptrs : !tt.ptr, i32 loc(#loc65) %output_ptrs_27 = arith.muli %off_h, %stride_oh : i32 loc(#loc66) %output_ptrs_28 = tt.addptr %output_ptrs_26, %output_ptrs_27 : !tt.ptr, i32 loc(#loc65) %output_ptrs_29 = arith.extsi %stride_on : i32 to i64 loc(#loc67) %output_ptrs_30 = tt.splat %output_ptrs_29 : i64 -> tensor<4x1xi64> loc(#loc67) %output_ptrs_31 = arith.muli %input_ptrs_16, %output_ptrs_30 : tensor<4x1xi64> loc(#loc67) %output_ptrs_32 = tt.splat %output_ptrs_28 : !tt.ptr -> tensor<4x1x!tt.ptr> loc(#loc65) %output_ptrs_33 = tt.addptr %output_ptrs_32, %output_ptrs_31 : tensor<4x1x!tt.ptr>, tensor<4x1xi64> loc(#loc65) %output_ptrs_34 = tt.broadcast %output_ptrs_33 : tensor<4x1x!tt.ptr> -> tensor<4x128x!tt.ptr> loc(#loc65) %output_ptrs_35 = tt.addptr %output_ptrs_34, %input_ptrs_24 : tensor<4x128x!tt.ptr>, tensor<4x128xi32> loc(#loc65) %scale_ptrs = arith.muli %off_b, %stride_sz : i32 loc(#loc68) %scale_ptrs_36 = tt.addptr %Scale, %scale_ptrs : !tt.ptr, i32 loc(#loc69) %scale_ptrs_37 = arith.muli %off_h, %stride_sh : i32 loc(#loc70) %scale_ptrs_38 = tt.addptr %scale_ptrs_36, %scale_ptrs_37 : !tt.ptr, i32 loc(#loc69) %scale_ptrs_39 = arith.muli %off_blk_4, %c8_i32 : i32 loc(#loc71) %scale_ptrs_40 = tt.addptr %scale_ptrs_38, %scale_ptrs_39 : !tt.ptr, i32 loc(#loc69) %scale_ptrs_41 = tt.addptr %scale_ptrs_40, %off_tld : !tt.ptr, i32 loc(#loc69) %x = tt.splat %L : i32 -> tensor<4x1xi32> loc(#loc72) %x_42 = arith.cmpi slt, %input_ptrs_15, %x : tensor<4x1xi32> loc(#loc72) %x_43 = tt.broadcast %x_42 : tensor<4x1xi1> -> tensor<4x128xi1> loc(#loc73) %x_44 = tt.load %input_ptrs_25, %x_43 : tensor<4x128x!tt.ptr> loc(#loc73) %x_45 = arith.extf %x_44 : tensor<4x128xbf16> to tensor<4x128xf32> loc(#loc74) %scale = math.absf %x_45 : tensor<4x128xf32> loc(#loc75) %scale_46 = tt.reshape %scale allow_reorder : tensor<4x128xf32> -> tensor<512xf32> loc(#loc80) %scale_47 = "tt.reduce"(%scale_46) <{axis = 0 : i32}> ({ ^bb0(%scale_58: f32 loc(callsite(#loc4 at #loc76)), %scale_59: f32 loc(callsite(#loc4 at #loc76))): %scale_60 = arith.maxnumf %scale_58, %scale_59 : f32 loc(#loc82) tt.reduce.return %scale_60 : f32 loc(#loc80) }) : (tensor<512xf32>) -> f32 loc(#loc80) %scale_48 = arith.divf %scale_47, %cst_3 : f32 loc(#loc76) %scale_49 = arith.addf %scale_48, %cst : f32 loc(#loc76) %x_int8_50 = tt.splat %scale_49 : f32 -> tensor<4x128xf32> loc(#loc77) %x_int8_51 = arith.divf %x_45, %x_int8_50 : tensor<4x128xf32> loc(#loc77) %x_int8_52 = arith.cmpf oge, %x_int8_51, %x_int8 : tensor<4x128xf32> loc(#loc49) %x_int8_53 = arith.select %x_int8_52, %x_int8_2, %x_int8_1 : tensor<4x128xi1>, tensor<4x128xi32> loc(#loc51) %x_int8_54 = arith.sitofp %x_int8_53 : tensor<4x128xi32> to tensor<4x128xf32> loc(#loc50) %x_int8_55 = arith.mulf %x_int8_54, %x_int8_0 : tensor<4x128xf32> loc(#loc50) %x_int8_56 = arith.addf %x_int8_51, %x_int8_55 : tensor<4x128xf32> loc(#loc78) %x_int8_57 = arith.fptosi %x_int8_56 : tensor<4x128xf32> to tensor<4x128xi8> loc(#loc79) tt.store %output_ptrs_35, %x_int8_57, %x_43 : tensor<4x128x!tt.ptr> loc(#loc35) tt.store %scale_ptrs_41, %scale_49 : !tt.ptr loc(#loc36) tt.return loc(#loc) } loc(#loc) } loc(#loc) #loc1 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1779:34) #loc2 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1779:19) #loc3 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1779:25) #loc5 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1768:34) #loc6 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1763:19) #loc7 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1764:19) #loc8 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1765:17) #loc9 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1766:17) #loc10 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1768:18) #loc11 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1769:18) #loc12 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1771:30) #loc13 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1771:22) #loc14 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1771:50) #loc15 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1771:70) #loc16 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1771:113) #loc17 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1772:32) #loc18 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1772:23) #loc19 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1772:52) #loc20 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1772:72) #loc21 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1773:30) #loc22 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1773:22) #loc23 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1773:50) #loc24 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1773:70) #loc25 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1775:38) #loc26 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1775:13) #loc27 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1776:13) #loc28 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1777:24) #loc29 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\python_embeded\\Lib\\site-packages\\triton\\language\\standard.py":191:16) #loc31 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\python_embeded\\Lib\\site-packages\\triton\\language\\standard.py":170:12) #loc32 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1778:18) #loc33 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1779:9) #loc34 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1780:18) #loc35 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1781:9) #loc36 = loc("D:\\Comfy\\App\\ComfyUI_windows_portable\\ComfyUI\\custom_nodes\\comfyui-kjnodes\\nodes\\ltxv_nodes.py":1782:9) #loc49 = loc("x_int8"(#loc1)) #loc50 = loc("x_int8"(#loc2)) #loc51 = loc("x_int8"(#loc3)) #loc52 = loc("offs_n"(#loc5)) #loc53 = loc("off_blk"(#loc6)) #loc54 = loc("off_tld"(#loc7)) #loc55 = loc("off_h"(#loc8)) #loc56 = loc("off_b"(#loc9)) #loc57 = loc("offs_n"(#loc10)) #loc58 = loc("offs_k"(#loc11)) #loc59 = loc("input_ptrs"(#loc12)) #loc60 = loc("input_ptrs"(#loc13)) #loc61 = loc("input_ptrs"(#loc14)) #loc62 = loc("input_ptrs"(#loc15)) #loc63 = loc("input_ptrs"(#loc16)) #loc64 = loc("output_ptrs"(#loc17)) #loc65 = loc("output_ptrs"(#loc18)) #loc66 = loc("output_ptrs"(#loc19)) #loc67 = loc("output_ptrs"(#loc20)) #loc68 = loc("scale_ptrs"(#loc21)) #loc69 = loc("scale_ptrs"(#loc22)) #loc70 = loc("scale_ptrs"(#loc23)) #loc71 = loc("scale_ptrs"(#loc24)) #loc72 = loc("x"(#loc25)) #loc73 = loc("x"(#loc26)) #loc74 = loc("x"(#loc27)) #loc75 = loc("scale"(#loc28)) #loc77 = loc("x_int8"(#loc32)) #loc78 = loc("x_int8"(#loc33)) #loc79 = loc("x_int8"(#loc34)) #loc80 = loc(callsite(#loc29 at #loc76)) #loc82 = loc(callsite(#loc31 at #loc80))