fix: remove dead gradient norm fallback - #8411
Open
LOGO127 wants to merge 1 commit into
Open
Conversation
Signed-off-by: luozijian <luozijian0924@gamil.com>
Author
|
The latest remote validation completed successfully: |
Author
|
Gentle follow-up on #8371: the focused CPU regression, pre-commit checks, DCO, and the remote modal-torch-latest validation remain green. The PR is still mergeable and ready for maintainer review. Please let me know if any additional coverage or adjustment is preferred. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #8371.
set_norm_for_param_grad_in_gpupreviously fell back toparam.gradwhen theconfigured gradient attribute was
None. That fallback is invalid for thegrad_accumpath because the source gradient has already been moved andcleared. The method now uses the selected attribute directly and reports a
clear assertion if the required gradient is missing.
Tests
pre-commit run --files deepspeed/runtime/zero/stage_1_and_2.py tests/unit/v1/zero/test_zero.pyPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 py -3 -m pytest -q tests/unit/v1/zero/test_zero.py::TestSetNormForParamGradInGPU(3 passed)py -3 -m compileall -q deepspeed/runtime/zero/stage_1_and_2.py tests/unit/v1/zero/test_zero.pygit diff --checkThe regression test covers both configured gradient attributes and verifies
that the stale
param.gradfallback is not used.AI assistance was used for drafting and local validation; I reviewed the
implementation and take responsibility for the submitted changes.