vllm.models.deepseek_v41.amd.mhc
¶
Overlap the DSV4.1 mHC gate projection with the next sublayer on ROCm.
Classes:
-
MHCOverlapStream–The global aux stream with the fork and join events of the overlap.
Functions:
-
mhc_pre_delayed_overlap–pre_delayedwith the gate projection moved ontooverlap.stream.
MHCOverlapStream
¶
The global aux stream with the fork and join events of the overlap.
Every fork and join waits on its event before the next records it, so all layers share the two events.
Methods:
-
prepare_mega_mhc–Allocate AITER Mega-MHC's per-stream scratch on the side stream.
Source code in vllm/models/deepseek_v41/amd/mhc.py
prepare_mega_mhc(hidden_size, device)
¶
Allocate AITER Mega-MHC's per-stream scratch on the side stream.
The gates run there only inside FULL graph capture, which cannot
allocate it; sizing it for MHC_OVERLAP_MAX_TOKENS covers every
batch the overlap captures.
Source code in vllm/models/deepseek_v41/amd/mhc.py
mhc_pre_delayed_overlap(pre_delayed, 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, norm_weight=None, norm_eps=1e-06, sublayer_out=None, post_layer_mix=None, comb_res_mix=None, fn_packed=None, *, overlap)
¶
pre_delayed with the gate projection moved onto overlap.stream.
Returns residual, post_mix, comb_mix, layer_input, next_pre_mix. Only the
residual and layer input are ready on the caller stream; call
overlap.join() before using the gates. Seams without a post block, a
carried pre-mix or a fused norm run pre_delayed on the caller stream.
Source code in vllm/models/deepseek_v41/amd/mhc.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |