Skip to content

Give rollout cache fakes the per-layer config Transformers now reads - #8730

Merged
pengdurice merged 1 commit into
masterfrom
fix/rollout-cache-per-layer-config
Oct 2, 2026
Merged

pengdurice merged 1 commit into
masterfrom
fix/rollout-cache-per-layer-config

Conversation

@sfc-gh-truwase

Copy link
Copy Markdown
Collaborator

Summary

  • cpu-torch-latest installs Transformers from git main. StaticCache now reads config.per_layer_config before choosing layer types.
  • The three continuous-generation tests used a SimpleNamespace cache config, so that read raised AttributeError. Real PreTrainedConfig objects already have this property.
  • The fakes now return a one-element per_layer_config, which Transformers treats as full attention.

Test plan

  • cpu-torch-latest unit tests, especially the three continuous-generation cases
  • Local run could not reproduce the CI Transformers SHA; this machine's Transformers fails later on Cache.update(cache_position=...)

Made with Cursor

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]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@pengdurice
pengdurice added this pull request to the merge queue Oct 2, 2026
Merged via the queue into master with commit 8fb2c9a Oct 2, 2026
13 of 15 checks passed
@pengdurice
pengdurice deleted the fix/rollout-cache-per-layer-config branch October 2, 2026 23:39
meefs pushed a commit to meefs/DeepSpeed that referenced this pull request Oct 6, 2026
…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]>
@auto-pr-labeler-with-jev auto-pr-labeler-with-jev Bot added the skip-gpu-test Requires positive evidence that every changed behavior can be validated without a GPU. label Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-gpu-test Requires positive evidence that every changed behavior can be validated without a GPU.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants