-
Notifications
You must be signed in to change notification settings - Fork 564
PlanLoader addition into planner #3355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
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
This pull request was exported from Phabricator. Differential Revision: D81571293 |
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 8, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Differential Revision: D81571293
a13d75a
to
dd6fbc5
Compare
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 8, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Differential Revision: D81571293
dd6fbc5
to
f752d39
Compare
This pull request was exported from Phabricator. Differential Revision: D81571293 |
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 8, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Differential Revision: D81571293
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 8, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Differential Revision: D81571293
This pull request was exported from Phabricator. Differential Revision: D81571293 |
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 8, 2025
Summary: Pull Request resolved: meta-pytorch#3355 **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Differential Revision: D81571293
8adb0e7
to
a2dc995
Compare
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 11, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
This pull request was exported from Phabricator. Differential Revision: D81571293 |
a2dc995
to
181d5c8
Compare
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 11, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
This pull request was exported from Phabricator. Differential Revision: D81571293 |
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 14, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
181d5c8
to
0229973
Compare
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 14, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
0229973
to
1d393a5
Compare
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 14, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 14, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 14, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
1d393a5
to
9791507
Compare
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 16, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 16, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 16, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
203a487
to
a5adc63
Compare
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 16, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 16, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
a5adc63
to
b43c9d2
Compare
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 16, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 17, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
b43c9d2
to
2b28554
Compare
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 17, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
2b28554
to
04c0e8b
Compare
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 17, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 17, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 17, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
aliafzal
added a commit
to aliafzal/torchrec
that referenced
this pull request
Sep 17, 2025
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
04c0e8b
to
2aeca98
Compare
…torch#3327) Summary: internal Context: This change is part of the effort in improving planners overall UX and reliability. This Diff: 1. Add ConfigeratorStats to upload sharding plan to config store. **How is a sharding plan stored in Configerator?** The Thrift definition of a sharding plan includes two fields: Topology and Dict[int, ShardingOption]. 1. Topology: The Topology field contains the information mentioned in this diff D79142495. 2. Dict[int, ShardingOption]: This field represents a dictionary where each key is a 64-bit hash of a sharding option, and the value is the corresponding Thrift-converted sharding option. The hash is calculated using the storage_hash function within the ShardingOption object, which takes into account factors such as the fqn, sharding type, and compute kernel. **How can a loaded plan be merged with an enumerated search space?** **Background:** When a plan is preserved during the logging stage, a hash is generated to ensure that the same plan can be loaded and validated later. The [hash is calculated](https://www.internalfb.com/code/fbsource/[fdf90ff2be9041f867bc6c9e4aec6ee94862fa11]/fbcode/torchrec/distributed/planner/types.py?lines=1010-1026) using input fields such as topology, batch size, constraints, storage reservation, and storage reservation policy, as well as fields from the sharding options like fqn, sharding type, kernel type, shards, and cache parameters. Once the plan is loaded and validated, we can safely assume that all loaded sharding options are a 1:1 map of enumerated sharded options. During the loading process, we traverse the enumerated search space, calculate the storage hash for each sharding option, look up the corresponding sharding option from the loaded plan, and replace the Shards of the enumerated sharding option with those of the loaded sharding option. This approach enables us to generate precise sharding options that can be seamlessly converted into a sharing plan as done by the planner and this also ensures consistent logging while also facilitating plan replay. Reviewed By: ge0405 Differential Revision: D81185992
Summary: internal Context: Planner stats db is introduced in this diff to track metadata and perf metrics associated with sharding plan. This Diff: 1. Added methods to insert, select and delete planner stats db row. 2. UTs for planner stats db 3. Integration of planner stats db with ConfigeratorStats Reviewed By: ge0405 Differential Revision: D81216987
Summary: **Summary:** * Added PlanLoader abstract base class to enable loading pre-computed sharding plans from stored locations within planner. * Supports two key scenarios: 1. Reusing previously computed and stored sharding plans to avoid regeneration costs 2. Using sharding plans from previous runs as starting points for iterative improvements * Defines two abstract methods: * `load()`: Returns a dictionary mapping sharding option hashes to ShardingOption objects * `plan_validation_str()`: Provides validation string for plan integrity checks * Part of the broader effort to improve planner UX and reliability by enabling plan persistence and reuse across training runs Reviewed By: mserturk Differential Revision: D81571293
2aeca98
to
1e6d8ca
Compare
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
meta-exported
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:
Summary:
load()
: Returns a dictionary mapping sharding option hashes to ShardingOption objectsplan_validation_str()
: Provides validation string for plan integrity checksDifferential Revision: D81571293