Support Transformers 5.20 cache query offsets in DeepSpeedStaticCache #8852
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.37) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 237 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.327
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #8852"
general
weight: 0.35
delock
Background
Native Llama continuous rollout on Transformers 5.20.1 failed because
DeepSpeedStaticCachelackedget_query_offset(layer_idx). The query offset must exclude the current write; usingget_seq_length()would be off by one.Changes
Implemented and validated on
fix/static-cache-query-offset:Validation
RTX A4500 (20 GiB), PyTorch 2.9.1+cu128 / CUDA 12.8, FP16:
| Transformers | Results |
| --- | --- |
| 5.20.1 | 76 passed, 1 skipped |
| 4.57.6 | 73 passed, 4 skipped |
Actual CUDA capture/replay passed. Randomly initialized tiny Llama rollouts matched native
generate()tokens, attention masks, and response offsets. Both versions skipped the optional pretrained-model test; 4.57.6 also skipped three tests requiring the newer masking API. Modified-file pre-commit checks passed.Run in each Transformers environment:
Scope and dependencies
Depends on the cache code from deepspeedai/DeepSpeed#8732, not the benchmark. Changes are limited to compatibility, tests, and documentation; this does not claim full Transformers 5.20 cache API support. Issue 1 depends on this fix in the tested 5.20.1 environment.
CC @delock