fix: use local ev_values and wrap dict.values() in list()#8087
Open
hashwnath wants to merge 1 commit into
Open
fix: use local ev_values and wrap dict.values() in list()#8087hashwnath wants to merge 1 commit into
hashwnath wants to merge 1 commit into
Conversation
Two bugs in the eigenvalue monitoring branch of `_take_model_step`: 1. `self.ev_values[i][0]` references a nonexistent instance attribute. The local variable `ev_values` (no `self.`) is the intended target. 2. `dict.values()` returns a dict_values view which is not subscriptable in Python 3. Wrapping in `list()` makes it indexable. Fixes deepspeedai#7983 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Hashwanth S <s.hashwanth531@gmail.com>
Author
|
Hey, I looked into this and the fix is straightforward. Two things going on here:
|
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
self.ev_values[i][0]on line 3106 references a nonexistent instance attribute, causingAttributeErrorat runtime when eigenvalue monitoring fires. The local variableev_values(defined on line 3102) is the intended target.dict.values()returns adict_valuesview in Python 3 which is not subscriptable. Wrapping inlist()makes it indexable.Test plan
self.ev_valueshas no definition or assignment anywhere inengine.pyev_values(local) is the correct variable from line 3102list()wrapping is needed for Python 3dict_valuessubscriptabilityFixes #7983