vllm.kernels.oink_ops ¶
This file registers Oink implementations for vLLM IR ops.
vLLM does not depend on the external Oink repository/package. When an external plugin registers torch.library.custom_op entrypoints under the oink:: namespace (e.g. via vLLM's general_plugins mechanism), these ops will be marked as supported. To dispatch to those ops, set kernel_config.ir_op_priority.VLLM_USE_OINK_OPS=1 will add this to priority by default.
oink_add_rms_supported module-attribute ¶
oink_add_rms_supported = (
lambda x, x_residual, weight, epsilon, variance_size=None: (
variance_size is None
and weight is not None
and dim() >= 2
and dtype == dtype
and is_contiguous()
and _can_view_as_2d(x)
and _is_oink_stride_compatible_2d(
view(-1, shape[-1])
)
and dtype == dtype
and shape == shape
and _can_view_as_2d(x_residual)
and _is_oink_stride_compatible_2d(
view(-1, shape[-1])
)
)
)
Oink fused_add_rms_norm has the same constraints as rms_norm, and residual must be 2d-like with compatible strides.
oink_rms_supported module-attribute ¶
oink_rms_supported = (
lambda x, weight, epsilon, variance_size=None: (
variance_size is None
and weight is not None
and dim() >= 2
and dtype == dtype
and is_contiguous()
and _can_view_as_2d(x)
and _is_oink_stride_compatible_2d(
view(-1, shape[-1])
)
)
)
Oink rms only supports 2d-like inputs with contiguous weight and no variance_size override.
_can_view_as_2d ¶
Return True if x.view(-1, x.shape[-1]) is viewable (no copy).
Source code in vllm/kernels/oink_ops.py
_is_oink_stride_compatible_2d ¶
Return True if x_2d meets Oink's pointer-path stride constraints.