interplane.Get Omega
Read in your language

openaccel-lab

aien-dev/openaccel-lab

Brought by drakestapleton

branch main Branches Tags History

openaccel-lab / workloads / dequant_int8 / triton_kernel.py

16 lines · 454 bytes Raw Blame History
1# SPDX-License-Identifier: Apache-2.0
2import triton
3import triton.language as tl
4
5
6@triton.jit
7def _dequant_int8(q, s, y, C, BC: tl.constexpr):
8 r = tl.program_id(0)
9 c = tl.arange(0, BC)
10 live = c < C
11 qv = tl.load(q + r * C + c, mask=live, other=0).to(tl.float32)
12 tl.store(y + r * C + c, qv * tl.load(s + r), mask=live)
13
14
15def launch(p, t):
16 _dequant_int8[(p["R"],)](t["q"], t["s"], t["y"], p["C"], BC=triton.next_power_of_2(p["C"]))