Skip to content

[Fix] Register ModelOutputs as a PyTree node to enable FSDP pre_backward_hook injection#1677

Merged
HAOCHENYE merged 3 commits intoInternLM:mainfrom
HAOCHENYE:yehc/fix-modeloutput
Apr 15, 2026
Merged

[Fix] Register ModelOutputs as a PyTree node to enable FSDP pre_backward_hook injection#1677
HAOCHENYE merged 3 commits intoInternLM:mainfrom
HAOCHENYE:yehc/fix-modeloutput

Conversation

@HAOCHENYE
Copy link
Copy Markdown
Collaborator

  • fix bug
  • [Fix] Register ModelOutputs as a PyTree node to enable FSDP pre_backward_hook injection

@HAOCHENYE HAOCHENYE changed the title yehc/fix modeloutput [Fix] Register ModelOutputs as a PyTree node to enable FSDP pre_backward_hook injection Apr 14, 2026
@HAOCHENYE
Copy link
Copy Markdown
Collaborator Author

@claude fix the lint

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Apr 14, 2026

Claude: Fixed the lint errors as requested.

What was requested: Fix lint failures in CI.

Issues found (from CI logs):

  1. ruff-format: List comprehension in _flatten_pydantic_model_with_keys needed to be collapsed to a single line.
  2. mypy: Return type mismatch at line 280 — GetAttrKey not recognized as subtype of KeyEntry without explicit annotation.

Fix applied:

  • Added explicit type annotation list[tuple[_pytree.KeyEntry, Any]] on key_children to satisfy mypy.
  • Collapsed the list comprehension element to a single line to satisfy ruff-format.

Commit: HAOCHENYE@e653fbb

@HAOCHENYE HAOCHENYE force-pushed the yehc/fix-modeloutput branch from e653fbb to 2307688 Compare April 15, 2026 07:42
@HAOCHENYE HAOCHENYE merged commit 2770f8e into InternLM:main Apr 15, 2026
4 of 5 checks passed
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.

1 participant