File tree Expand file tree Collapse file tree
src/flag_gems/runtime/backend/_kunlunxin/ops Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33import triton
44import triton .language as tl
5+ from _kunlunxin .utils .codegen_config_utils import CodeGenConfig
56
67from ..utils .pointwise_dynamic import pointwise_dynamic
78
8- logger = logging .getLogger ("flag_gems" ). getChild ( __name__ . lstrip ( "." ) )
9+ logger = logging .getLogger (__name__ )
910
11+ config_ = CodeGenConfig (
12+ 512 ,
13+ (65536 , 65536 , 65536 ),
14+ 32 ,
15+ True ,
16+ prefer_1d_tile = True ,
17+ buffer_size_limit = 4096 ,
18+ unroll_num = 8 ,
19+ )
1020
11- @pointwise_dynamic (promotion_methods = [(0 , "INT_TO_FLOAT" )])
21+
22+ @pointwise_dynamic (promotion_methods = [(0 , "INT_TO_FLOAT" )], config = config_ )
1223@triton .jit
1324def exp2_func (x ):
14- LN2 = 0.69314718056
15- return tl .exp (x .to (tl .float32 ) * LN2 )
25+ return tl .exp2 (x .to (tl .float32 ))
1626
1727
1828def exp2 (A ):
You can’t perform that action at this time.
0 commit comments