vllm.model_executor.layers.mamba.ops.triton_helpers
¶
Functions:
-
fast_exp–Faster alternative to tl.exp() using the hardware exp2 instruction.
-
launch_autotuned–Launch a
@triton.autotunekernel with the config it already picked.
fast_exp(x)
¶
Faster alternative to tl.exp() using the hardware exp2 instruction.
tl.math.exp2 maps directly to a single ex2.approx.f32 PTX instruction, while tl.exp goes through libdevice __nv_expf which adds function call overhead and extra range checking.
Source code in vllm/model_executor/layers/mamba/ops/triton_helpers.py
launch_autotuned(kernel, grid, **kwargs)
¶
Launch a @triton.autotune kernel with the config it already picked.
Autotuner.run rebuilds its cache key on every launch, matching each
argument name against a list and formatting the dtype of every tensor
argument, several microseconds of host time per launch. This builds an
equivalent key directly from kwargs: the values of the kernel's
autotune key arguments plus the dtype (or None) of every argument.