§
    9²¸j|  ã                  ó    — d Z ddlmZ ddlZddlmZmZmZmZm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ ddlmZ eZeZe
Zd„ Zg d¢Z dS )	zŽBackward-compatibility shim for the tensor parallel API.

The canonical implementation lives in ``transformers.distributed.tensor_parallel``.
é    )ÚannotationsNé   )ÚALL_PARALLEL_STYLESÚAllReduceParallelÚColwiseParallelÚEpRouterParallelÚMlaKvAProjParallelÚMoeExpertsParallelÚMoeIdentityParallelÚMoEParamShardÚMoeTensorParalellMegaMoeExpertsÚPackedColwiseParallelÚPackedRowwiseParallelÚParallelInterfaceÚReplicatedWithGradAllReduceÚRouterParallelMegaMoeÚRowwiseParallelÚSequenceParallelÚTensorParallelLayerÚapply_tensor_parallelismÚgather_state_dict_for_saveÚ replace_layer_number_by_wildcardÚverify_tp_plan)Úinitialize_tensor_parallelismc                 óX   — t          j        dt          d¬¦  «         t          d¦  «        ‚)zIDeprecated per-parameter sharding helper from the legacy TP loading path.zä`shard_and_distribute_module` is deprecated and unavailable with the DTensor tensor-parallel loading path. Use `transformers.distributed.tensor_parallel.apply_tensor_parallelism` with `from_pretrained(..., tp_plan=...)` instead.r   )Ú
stacklevelz[`shard_and_distribute_module` is unavailable with the DTensor tensor-parallel loading path.)ÚwarningsÚwarnÚFutureWarningÚRuntimeError)ÚargsÚkwargss     úy/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/transformers/integrations/tensor_parallel.pyÚshard_and_distribute_moduler$   6   s9   € å„Mð	7õ 	Øðñ ô ð õ ÐtÑ
uÔ
uÐuó    )r   ÚMoeIdentityExpertParallelÚMoeTensorParalellExpertsÚRouterParallelr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r$   r   )!Ú__doc__Ú
__future__r   r   Údistributed.tensor_parallelr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Údistributed.utilsr   r(   r&   r'   r$   Ú__all__© r%   r#   ú<module>r/      s`  ððð ð
 #Ð "Ð "Ð "Ð "Ð "à €€€ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð. >Ð =Ð =Ð =Ð =Ð =ð "€Ø/Ð Ø-Ð ð	vð 	vð 	vðð ð €€€r%   