@@ -285,25 +285,26 @@ If the model dtype is already f32, no Cast is needed.
285285
286286Models with KV-shared layers (e.g. Gemma4) borrow key/value from
287287earlier source layers instead of projecting their own. With GQA
288- (PR #279 ), shared layers use ` GroupQueryAttention ` with:
288+ (` onnxruntime/mobius #279` ), shared layers use ` GroupQueryAttention ` with:
289289
290- - ` key=None ` (empty, ` kv_sequence_length =0` )
290+ - ` key=None ` (empty current K, i.e. ` new_kv_length =0` )
291291- ` value=None ` (empty)
292292- ` past_key=source_layer_present_key ` (borrowed from source)
293293- ` past_value=source_layer_present_value ` (borrowed from source)
294- - ` do_rotary=1 ` (RoPE applied to queries; source K already has RoPE)
294+ - ` do_rotary=1 ` (RoPE applied to queries; borrowed source K is already RoPE-rotated )
295295
296296This eliminates ~ 40 Transpose/Reshape ops per shared layer that
297297were previously needed to convert the source KV from BNSH
298298` [B, kv_heads, seq, head_dim] ` to 3D ` [B, seq, kv_hidden] ` format.
299299
300- ** Caveat:** Requires ORT to support ` kv_sequence_length=0 ` in the
301- GQA op. Tracked in microsoft/onnxruntime #28318 .
300+ This relies on ORT GQA support for empty current K/V (` new_kv_length=0 ` ,
301+ represented in graph wiring as empty key/value tensors with
302+ ` kv_sequence_length=0 ` ).
302303
303304## Vision preprocessing: float-domain bicubic resize
304305
305- For HF parity in vision preprocessing, ort -extensions provides a
306- float-domain bicubic resize (PR # 1056 ) that avoids uint8 clamping
306+ For HF parity in vision preprocessing, ` microsoft/onnxruntime -extensions#1056 `
307+ provides a float-domain bicubic resize that avoids uint8 clamping
307308artifacts. This eliminates 0.03-0.13 pixel differences that can
308309cause token divergence in vision encoders. The utility operates in
309310packed RGB with fused uint8→float rescale.
0 commit comments