Fix type checking errors in torchrec source files#4247
Open
kausv wants to merge 1 commit into
Open
Conversation
Summary: Fix pyrefly/pyre type checking errors in 29 non-test source files across torchrec. Adds pyre-fixme comments to suppress type errors that cannot be expressed in the type system, plus one pure type annotation fix (state_dict_transform.py ret variable). Error categories fixed: - ProcessGroup | int | None from dist.new_group() (pyre-fixme[9]) - Module.__getattr__ returning Module | Tensor for dynamic attributes (pyre-fixme[6/8/16/29]) - named_modules override inconsistency (pyre-fixme[14]) - state_dict() returning Optional dict vs T_destination bound (pyre-fixme[6/7]) - max/min builtins not matching Callable signature (pyre-fixme[6]) - Iterable type mismatches for TensorDictKeysView, KeyedJaggedTensor (pyre-fixme[6]) Differential Revision: D104852703
Contributor
|
@kausv has exported this pull request. If you are a Meta employee, you can view the originating Diff in D104852703. |
kausv
added a commit
to kausv/torchrec
that referenced
this pull request
May 13, 2026
Summary: Fix pyrefly/pyre type checking errors in 29 non-test source files across torchrec. Adds pyre-fixme comments to suppress type errors that cannot be expressed in the type system, plus one pure type annotation fix (state_dict_transform.py ret variable). Error categories fixed: - ProcessGroup | int | None from dist.new_group() (pyre-fixme[9]) - Module.__getattr__ returning Module | Tensor for dynamic attributes (pyre-fixme[6/8/16/29]) - named_modules override inconsistency (pyre-fixme[14]) - state_dict() returning Optional dict vs T_destination bound (pyre-fixme[6/7]) - max/min builtins not matching Callable signature (pyre-fixme[6]) - Iterable type mismatches for TensorDictKeysView, KeyedJaggedTensor (pyre-fixme[6]) Differential Revision: D104852703
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:
Fix pyrefly/pyre type checking errors in 29 non-test source files across torchrec. Adds pyre-fixme comments to suppress type errors that cannot be expressed in the type system, plus one pure type annotation fix (state_dict_transform.py ret variable).
Error categories fixed:
Differential Revision: D104852703