Skip to content

Conversation

@therealnaveenkamal
Copy link
Contributor

fixes #7650

adding a value.dim()>0 check to prevent slicing of 0-dim tensors

cc @sfc-gh-truwase

@sfc-gh-truwase
Copy link
Collaborator

@therealnaveenkamal, thanks for the fix. Please address the formatting issues,.

@sfc-gh-truwase sfc-gh-truwase enabled auto-merge (squash) November 1, 2025 17:02
@therealnaveenkamal
Copy link
Contributor Author

therealnaveenkamal commented Nov 1, 2025

hi @sfc-gh-truwase i think yapf check failed while loading a pickle grammar file from its cache. pre-commit passed in local.

@tohtana
Copy link
Contributor

tohtana commented Nov 3, 2025

Hi @therealnaveenkamal, thank you for your contribution!
I'm not so sure about why the error doesn't show the actual formatting issue, but it seems we need space. I pushed a commit to fix it.

-            if torch.is_tensor(value) and value.dim()>0:
+            if torch.is_tensor(value) and value.dim() > 0:

@sfc-gh-truwase sfc-gh-truwase merged commit 6fe3c7a into deepspeedai:master Nov 3, 2025
13 checks passed
@therealnaveenkamal
Copy link
Contributor Author

@tohtana / @sfc-gh-truwase thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] IndexError occurs when saving checkpoint under ZeRO Stage 1/2

3 participants