Skip to content

Back out "Add new argument for sharding type" #3022

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
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions torchrec/inference/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,6 @@ def shard_quant_model(
device_memory_size: Optional[int] = None,
constraints: Optional[Dict[str, ParameterConstraints]] = None,
ddr_cap: Optional[int] = None,
sharding_type: ShardingType = ShardingType.TABLE_WISE,
) -> Tuple[torch.nn.Module, ShardingPlan]:
"""
Shard a quantized TorchRec model, used for generating the most optimal model for inference and
Expand Down Expand Up @@ -535,10 +534,6 @@ def shard_quant_model(
quant_model = quantize_inference_model(module)
sharded_model, _ = shard_quant_model(quant_model)
"""
# TODO(T220572301): remove after new sharding types are validated.
assert (
sharding_type == ShardingType.TABLE_WISE
), "Only table-wise sharding is supported now."

if constraints is None:
table_fqns = []
Expand All @@ -557,7 +552,7 @@ def shard_quant_model(
constraints = {}
for name in table_fqns:
constraints[name] = ParameterConstraints(
sharding_types=[sharding_type.value],
sharding_types=[ShardingType.TABLE_WISE.value],
compute_kernels=[EmbeddingComputeKernel.QUANT.value],
)

Expand Down
Loading