Repository navigation
Give rollout cache fakes the per-layer config Transformers now reads - #8730
Conversation
StaticCache on Transformers main reads config.per_layer_config before choosing layer types. The continuous-generation doubles were a SimpleNamespace, so cpu-torch-latest failed with AttributeError. Signed-off-by: tunji-ruwase_snow <[email protected]> Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e8dc9697b7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| def get_text_config(self, **_kwargs): | ||
| return self | ||
|
|
||
| @property |
There was a problem hiding this comment.
Add the required Signed-off-by trailer
This non-merge commit has no Signed-off-by trailer: I verified the full message with git log --format='%b' cba1e9755ce31c0915400f0a737e345b46d70e97, rather than relying on the diff. Add the configured contributor sign-off before merging to satisfy the repository's commit requirement.
AGENTS.md reference: AGENTS.md:L8-L9
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This commit already has the trailer. e8dc9697b7eadee258e47164a9831d16d4e601f2 ends with:
Signed-off-by: tunji-ruwase_snow <[email protected]>
The SHA in the review (cba1e9755ce31c0915400f0a737e345b46d70e97) is not a commit in this repository. The DCO check on this pull request is green.
…epspeedai#8638) ## Summary - DeepSpeed encodes inf/NaN group norms as `-1`. Combining those with `vector_norm` squares the sentinel to `1.0`, so clipping and Adam treat a failed group as healthy and apply an unclipped step. - Treat non-finite or negative group norms as overflow (`inf`), skip the optimizer step, reset overflow each step, and advance the loss scaler once (including ZeRO-3 / SuperOffload / ZenFlow / FP16 fused+unfused / BF16). - Direct `unscale_and_clip_grads` callers map the sentinel to `inf` so they still zero gradients instead of using clip_coef=1. This is split out of the ZeRO-2 oversized-gradient / stream-lifetime work so the sentinel contract can land independently. ## Test plan - [x] CPU, rebased onto current master (`75eb961d1`, includes deepspeedai#8730): 17 passed in `tests/unit/v1/zero/test_invalid_grad_norm.py` (`combine_grad_norm_groups` / `get_global_norm` / `CheckOverflow`, ZeRO-1 clip, CPU-offload combine, ZeRO-3 / BF16 / SuperOffload overflow paths) - [x] GPU (2× H200, prior run): `TestZeROBFloat16Stage3InvalidNormRecovery`. Skipped on the rebase machine (2 GPUs required, 1 available) - [ ] CI unit tests for the touched runtime files, started by the rebase push --------- Signed-off-by: tunji-ruwase_snow <[email protected]> Co-authored-by: Cursor <[email protected]>
Summary
cpu-torch-latestinstalls Transformers from gitmain.StaticCachenow readsconfig.per_layer_configbefore choosing layer types.SimpleNamespacecache config, so that read raisedAttributeError. RealPreTrainedConfigobjects already have this property.per_layer_config, which Transformers treats as full attention.Test plan
cpu-torch-latestunit tests, especially the three continuous-generation casesCache.update(cache_position=...)Made with Cursor