Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add lax.exp2_p -> tl.math.exp2 #212

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions jax_triton/pallas/triton_lowering.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from jax._src import pjit
from jax._src import state
from jax._src import util
from jax._src.lax import lax as lax_internal
from jax._src.lax.control_flow import for_loop
from jax._src.lib import gpu_triton as triton_kernel_call_lib
from jax._src.lib.mlir import ir
Expand Down Expand Up @@ -384,6 +385,13 @@ def _exp_lowering_rule(ctx: TritonLoweringRuleContext, a):
triton_lowering_rules[lax.exp_p] = _exp_lowering_rule


def _exp2_lowering_rule(ctx: TritonLoweringRuleContext, a):
return tl.math.exp2(a, _builder=ctx.builder)


triton_lowering_rules[lax_internal.exp2_p] = _exp2_lowering_rule


def _log_lowering_rule(ctx: TritonLoweringRuleContext, a):
return tl.log(a, _builder=ctx.builder)

Expand Down