Skip to content

Fix type checking errors in torchrec source files#4247

Open
kausv wants to merge 1 commit into
meta-pytorch:mainfrom
kausv:export-D104852703
Open

Fix type checking errors in torchrec source files#4247
kausv wants to merge 1 commit into
meta-pytorch:mainfrom
kausv:export-D104852703

Conversation

@kausv
Copy link
Copy Markdown
Contributor

@kausv kausv commented May 12, 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

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
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 12, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 12, 2026

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported fx meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant