Skip to content

Commit eb90ac1

Browse files
[KUNLUNXIN] sqrt speed up (#1253)
disable vectorization of sqrt
1 parent 8404a51 commit eb90ac1

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

  • src/flag_gems/runtime/backend/_kunlunxin/ops

src/flag_gems/runtime/backend/_kunlunxin/ops/sqrt.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,25 @@
22

33
import triton
44
import triton.language as tl
5+
from _kunlunxin.utils.codegen_config_utils import CodeGenConfig
56

67
from ..utils.pointwise_dynamic import pointwise_dynamic
78

89
logger = logging.getLogger("flag_gems").getChild(__name__.lstrip("."))
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+
isCloseVectorization=True,
19+
unroll_num=8,
20+
)
1021

11-
@pointwise_dynamic(promotion_methods=[(0, "INT_TO_FLOAT")])
22+
23+
@pointwise_dynamic(promotion_methods=[(0, "INT_TO_FLOAT")], config=config_)
1224
@triton.jit
1325
def sqrt_func(x):
1426
return tl.sqrt(x.to(tl.float32))

0 commit comments

Comments
 (0)