Skip to content

Commit

Permalink
Add sharding optimization feature rollout (pytorch#2680)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#2680

As per title, adding JK to enable gradual rollout of sharding optmization in torchrec per entitlement
https://www.internalfb.com/intern/justknobs/?name=ai_infra%2Ftraining_components#torchrec_sharding_optimization_enable

Reviewed By: lijia19, iamzainhuda

Differential Revision: D68038832

fbshipit-source-id: 29fa81cedea8d87044b5fc35238627b6cd327e0c
  • Loading branch information
Boris Sarana authored and facebook-github-bot committed Jan 13, 2025
1 parent 28f9734 commit 542b0b2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions torchrec/distributed/global_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ def construct_sharded_tensor_from_metadata_enabled() -> bool:
return (
os.environ.get(TORCHREC_CONSTRUCT_SHARDED_TENSOR_FROM_METADATA_ENV, "0") == "1"
)


def enable_construct_sharded_tensor_from_metadata() -> None:
os.environ[TORCHREC_CONSTRUCT_SHARDED_TENSOR_FROM_METADATA_ENV] = "1"

0 comments on commit 542b0b2

Please sign in to comment.