Skip to content

vllm.model_executor.kernels.mhc.torch

Functions:

mhc_pre_delayed_torch(residual, fn, hc_scale, hc_base, rms_eps, hc_pre_eps, hc_sinkhorn_eps, hc_post_mult_value, sinkhorn_repeat, pre_mix=None, x=None)

Reference for mHC pre using coefficients from the previous sublayer.

mhc_pre_torch(residual, fn, hc_scale, hc_base, rms_eps, hc_pre_eps, hc_sinkhorn_eps, hc_post_mult_value, sinkhorn_repeat, n_splits=1)

Forward pass for mHC pre block.

Parameters:

  • residual

    (Tensor) –

    shape (..., hc_mult, hidden_size), dtype torch.bfloat16

  • fn

    (Tensor) –

    shape (hc_mult3, hc_mult * hidden_size), dtype torch.float32

  • hc_scale

    (Tensor) –

    shape (3,), dtype torch.float32

  • hc_base

    (Tensor) –

    shape (hc_mult3,), dtype torch.float32

  • rms_eps

    (float) –

    RMS normalization epsilon

  • hc_pre_eps

    (float) –

    pre-mix epsilon

  • hc_sinkhorn_eps

    (float) –

    sinkhorn epsilon

  • hc_post_mult_value

    (float) –

    post-mix multiplier value

  • sinkhorn_repeat

    (int) –

    number of sinkhorn iterations

  • n_splits

    (int, default: 1 ) –

    split-k factor;

Returns:

  • post_mix ( Tensor ) –

    shape (..., hc_mult), dtype torch.float32

  • comb_mix ( Tensor ) –

    shape (..., hc_mult, hc_mult), dtype torch.float32

  • layer_input ( Tensor ) –

    shape (..., hidden_size), dtype torch.bfloat16