Skip to content

Add LinearProgrammingPlanner option to benchmark_train_sparsenn #3070

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

SSYernar
Copy link
Contributor

@SSYernar SSYernar commented Jun 9, 2025

Summary:
This change adds the ability to select different sharding planners when running sparse neural network benchmarks. Previously, the benchmark code only used EmbeddingShardingPlanner, but now users can choose between EmbeddingShardingPlanner and LinearProgrammingPlanner.

The changes include:

  1. Adding a new planner_type parameter to the RunOptions class
  2. Creating a new _generate_planner function that returns the appropriate planner based on the selected type
  3. Updating the runner function to use this new function
  4. Updating type annotations to support both planner types

Differential Revision: D76231527

@facebook-github-bot facebook-github-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 Jun 9, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D76231527

SSYernar added 2 commits June 9, 2025 14:33
…ugh GPUs

Summary:
1) Add comprehensive docstrings to RunOptions, EmbeddingTablesConfig, and PipelineConfig.

2) Replace direct return with hypothesis.assume(torch.cuda.is_available() and torch.cuda.device_count() >= world_size)

Differential Revision: D76160331
Summary: Created an EmbeddingShardingPlanner in the runner function after generating the unsharded model and modified _generate_sharded_model_and_optimizer to accept and use this planner. This change enables optimized sharding of embedding tables based on the topology.

Differential Revision: D76188112
SSYernar added a commit to SSYernar/torchrec that referenced this pull request Jun 9, 2025
…rch#3070)

Summary:

This change adds the ability to select different sharding planners when running sparse neural network benchmarks. Previously, the benchmark code only used EmbeddingShardingPlanner, but now users can choose between EmbeddingShardingPlanner and LinearProgrammingPlanner.

The changes include:

1.  Adding a new `planner_type` parameter to the `RunOptions` class
2.  Creating a new `_generate_planner` function that returns the appropriate planner based on the selected type
3.  Updating the runner function to use this new function
4.  Updating type annotations to support both planner types

Differential Revision: D76231527
@SSYernar SSYernar force-pushed the export-D76231527 branch from 0981c9d to cfbb45e Compare June 9, 2025 21:46
…rch#3070)

Summary:
Pull Request resolved: pytorch#3070

This change adds the ability to select different sharding planners when running sparse neural network benchmarks. Previously, the benchmark code only used EmbeddingShardingPlanner, but now users can choose between EmbeddingShardingPlanner and LinearProgrammingPlanner.

The changes include:

1.  Adding a new `planner_type` parameter to the `RunOptions` class
2.  Creating a new `_generate_planner` function that returns the appropriate planner based on the selected type
3.  Updating the runner function to use this new function
4.  Updating type annotations to support both planner types

Differential Revision: D76231527
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D76231527

@SSYernar SSYernar force-pushed the export-D76231527 branch from cfbb45e to 82887c3 Compare June 9, 2025 21:50
SSYernar added a commit to SSYernar/torchrec that referenced this pull request Jun 10, 2025
…rch#3070)

Summary:

This change adds the ability to select different sharding planners when running sparse neural network benchmarks. Previously, the benchmark code only used EmbeddingShardingPlanner, but now users can choose between EmbeddingShardingPlanner and LinearProgrammingPlanner.

The changes include:

1.  Adding a new `planner_type` parameter to the `RunOptions` class
2.  Creating a new `_generate_planner` function that returns the appropriate planner based on the selected type
3.  Updating the runner function to use this new function
4.  Updating type annotations to support both planner types

Differential Revision: D76231527
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants