You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add hash and equality functions to planner types (meta-pytorch#3522)
Summary:
Pull Request resolved: meta-pytorch#3522
This diff adds explicit `__hash__` and `__eq__` methods to custom objects in the torchrec planner that previously relied on Python's default object identity-based hashing.
1. **DeviceHardware** (fbcode/torchrec/distributed/planner/types.py):
- Hash based on rank, storage, and perf fields
- Equality checks all three fields
2. **BasicCommsBandwidths** (fbcode/torchrec/distributed/planner/types.py):
- Hash based on inter_host_bw and intra_host_bw
- Equality checks both bandwidth values
Reviewed By: iamzainhuda
Differential Revision: D85731424
fbshipit-source-id: 92e230bb35e6ee1868d419989cae6d616981f0d7
0 commit comments