# mHC post (`mhc_post`) | ServingStudio Kernel Library

Mix a sub-layer's output into the mHC residual streams with the post gates and the comb matrix.

TileKernels' mhc_post_fwd as DeepInfer calls it outside the fused boundary: each new stream is the post gate times the sub-layer output plus the comb-weighted sum of the old streams. One launch, bf16 streams, fp32 mixes.

Category: Normalization; group: Hyper-connections. Interactive page: https://servingstudio.cs.washington.edu/kernels.html?kind=mhc_post. All kernel kinds: https://servingstudio.cs.washington.edu/kernels.md.

## Formula

- `streamⱼ ← postⱼ · x + Σᵢ combᵢⱼ · streamᵢ`

## How it is measured

GPU kernel time from CUPTI activity records, averaged over repeated launches in one capture. The L2 cache is flushed before each launch, so the numbers are cold-cache times. One launch. The output is checked against an fp32 Torch transcription before timing.

## Caveats

- GB/s counts x, the streams and the mixes read and the streams written once.

## Arguments

| Argument | Type | Unit | Meaning |
| --- | --- | --- | --- |
| `num_tokens` | number | tokens | Token rows processed by the MHC block. |
| `hidden_size` | number | elements | Features in each residual stream. |
| `hc_mult` | number | streams | Parallel residual streams per token. |
| `hidden_dtype` | dtype |  | Element type of the residual streams. |

## Metrics

- Time (`time_ms`, ms)
- Throughput (`tflops`, TFLOPS)
- Memory bandwidth (`memory_bandwidth_gbps`, GB/s)
- Energy (`energy_j`, J)

## Backends

- `tile_kernels`: TileKernels mhc_post_fwd, as DeepInfer's HCLayerMixin.hc_post calls it. dtypes `bf16`, any CUDA GPU. Source: https://github.com/deepseek-ai/TileKernels

## Measured rows

71 rows in all.

| GPU | Backend | Precision | Rows |
| --- | --- | --- | --- |
| NVIDIA B200 | `tile_kernels` | `bf16` | 71 |

## Used by these deployments

- [DeepSeek V4.1 Flash 1017: vLLM or DeepInfer, DP attention, EP MoE](https://servingstudio.cs.washington.edu/models/DeepSeek-V4.1-Flash-1017/deepseek_v41_vllm_dp_attn_ep_moe.md) (`DeepSeek-V4.1-Flash-1017/deepseek_v41_vllm_dp_attn_ep_moe`)
- [DeepSeek V4.1 Flash 1017: vLLM, DP attention, EP MoE, DSpark speculative decoding](https://servingstudio.cs.washington.edu/models/DeepSeek-V4.1-Flash-1017/deepseek_v41_vllm_dp_attn_ep_moe_dspark.md) (`DeepSeek-V4.1-Flash-1017/deepseek_v41_vllm_dp_attn_ep_moe_dspark`)

## API

- This kind: https://servingstudio.cs.washington.edu/api/public/v1/kernels/mhc_post
- Measured rows: https://servingstudio.cs.washington.edu/api/public/v1/kernels/mhc_post/rows (filter by any column, such as `?gpu=NVIDIA%20H200`; `format=csv` for CSV)
- Configs the public deployments ask of it: https://servingstudio.cs.washington.edu/api/public/v1/kernels/mhc_post/configs

---

This page as Markdown: https://servingstudio.cs.washington.edu/kernels/mhc_post.md. A guide to the whole site for AI agents: [llms.txt](https://servingstudio.cs.washington.edu/llms.txt).
