---
title: TorchCollective
description: Collective operations using torch.distributed.
canonical: >-
  https://lightning.ai/docs/fabric/stable/full-api-reference/api/generated/lightning.fabric.plugins.collectives.TorchCollective
---
# TorchCollective {#torchcollective}

### `class lightning.fabric.plugins.collectives.TorchCollective` {#lightning.fabric.plugins.collectives.TorchCollective}

Bases: [`Collective`](/docs/fabric/2.6.6/full-api-reference/api/generated/lightning.fabric.plugins.collectives.Collective.md#lightning.fabric.plugins.collectives.Collective "lightning.fabric.plugins.collectives.collective.Collective")

Collective operations using [torch.distributed](https://pytorch.org/docs/stable/distributed.html).

Warning

This is an [experimental](/docs/pytorch/stable/versioning#experimental-api "(in PyTorch Lightning v2.7.0.dev)") feature which is still in development.

#### `property rank: int` {#lightning.fabric.plugins.collectives.TorchCollective.rank}

Rank.

#### `property world_size: int` {#lightning.fabric.plugins.collectives.TorchCollective.world_size}

World size.

---

**Navigation**

- Parent: [Generated](/docs/fabric/2.6.6/full-api-reference/api/generated.md)
