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.

Installation

With idr-pypi 🐍 (by default)

pip install idris[torch]

Master from idr-pypi 🐍

pip install idris-nightly[torch]

From source

git clone https://idrforge.prive.idris.fr/assistance/outils/idr_torch.git
cd idr_torch
pip install .

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.3.0.tar.gz (11.4 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.3.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for idr_torch-2.3.0.tar.gz
Algorithm Hash digest
SHA256 9c93934f3dda99c51078693b420d3cb1370aac48397677dccb1b2ac02d9a1dbe
MD5 416698d1d3dcea86ee9ff08b8c6c19e8
BLAKE2b-256 57db736b4d6e5ac81ae73fd54e93d1ba9137498260151c7380bbd61f288c27ba

See more details on using hashes here.

Provenance

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

Publisher: release.yml on idriscnrs/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.3.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for idr_torch-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 866c89754d32e110a8396cce363b1ae82fc69f0b94922008d897c14be61f395c
MD5 8e7382b964f6438815796f8c2e779881
BLAKE2b-256 d76200055ebce3a37ee332aeaa907372291e81d3a66a57f526f43fc70176c710

See more details on using hashes here.

Provenance

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

Publisher: release.yml on idriscnrs/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