Skip to content

Incorrect variable name: self.ev_values #7983

Description

@nameearly

engine.py:2838-2846:

  • The code incorrectly uses self.ev_values[i][0]
  • In the context, only a local variable is defined: ev_values = self.block_eigenvalue.values()
  • I found no definition or assignment of self.ev_values anywhere in the same file (it appears out of nowhere in this scope)

Result: When the branch conditions are met (monitor.enabled + GA boundary + rank0 + eigenvalue condition), this line will throw AttributeError: 'DeepSpeedEngine' object has no attribute 'ev_values'. This causes the eigenvalue-related monitoring log writing to fail (and may even prevent a single monitor.write_events call from executing).

Additional hidden prerequisite issue:

dict.values() returns a dict_values view object in Python 3, which does not support indexing. The current code:

ev_values = self.block_eigenvalue.values()
for i in range(len(ev_values)):
    ...
  • len(ev_values) works on dict_values
  • But even if you fix self.ev_values to ev_values[i], it will still throw a TypeError because dict_values is not subscriptable

Fix required: Convert ev_values to an indexable sequence (e.g., list(self.block_eigenvalue.values())) to access values via index i correctly.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions