Skip to main content

Distribution initialization util tool

Project description

idr_torch

Description

Permet de récupérer les variables SLURM afin de gérér le multi-GPU/multi-noeuds pour le parallélisme sur Pytorch.

import torch.distributed as dist
import idr_torch

if idr_torch.rank == 0:
    print(">>> Training on ", len(idr_torch.nodelist), " nodes and ", idr_torch.world_size, " processes") 

dist.init_process_group(backend='nccl', 
                        init_method='env://', 
                        world_size=idr_torch.world_size, 
                        rank=idr_torch.rank)

Si on veut rajouter une nouvelle API, on peut la mettre dans le dossier api et l'importer dans le __init__.py. Ou alors on peut la coder n'importe où, et après appeler idr_torch.register_api(nouvelle_api). Les nouvelles APIs doivent hériter de idr_torch.API. Si on veut faire en sorte que la MASTER_ADDR et le MASTER_PORT soit mis automatiquement (dans le cas où le lanceur ne le fait pas comme SLURM), alors il faut utiliser idr_torch.AutoMasterAddressPort comme décorateur de notre nouvelle API.

On patche aussi le profiler. Il suffit de remplacer from torch.profiler import ... par from idr_torch.profiler import ....

Note : idr_torch est compatible avec submitit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

idr_torch-2.5.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

idr_torch-2.5.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file idr_torch-2.5.0.tar.gz.

File metadata

  • Download URL: idr_torch-2.5.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for idr_torch-2.5.0.tar.gz
Algorithm Hash digest
SHA256 e0947b4e3fea03369c7c2a8db362012da889c50c1962c700212f7fcde43998e3
MD5 4a0c74337450251e097b9f1169243248
BLAKE2b-256 fa06b888c2c998eb811d9542c72e0fde71effb4fb8c28768f636db060c61f985

See more details on using hashes here.

Provenance

The following attestation bundles were made for idr_torch-2.5.0.tar.gz:

Publisher: release.yml on ncassereau/idr_torch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file idr_torch-2.5.0-py3-none-any.whl.

File metadata

  • Download URL: idr_torch-2.5.0-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for idr_torch-2.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cba313766c7f93c17905350e009b7d14d2f08e145cf0662b676f3eec4cb51d9a
MD5 c0689848f4ac448e25899389edadfc49
BLAKE2b-256 d64dc1f4b5a27c41255cb70d853b91c243926f94cc0bf0c6e52fbb3e6e6df91c

See more details on using hashes here.

Provenance

The following attestation bundles were made for idr_torch-2.5.0-py3-none-any.whl:

Publisher: release.yml on ncassereau/idr_torch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page