Parallel test utils
clean_up_distributed()
Cleans up the distributed environment.
Destroys the process group and empties the CUDA cache.
Returns:
Type | Description |
---|---|
None
|
None |
Source code in bionemo/moco/testing/parallel_test_utils.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
parallel_context(rank=0, world_size=1)
Context manager for torch distributed testing.
Sets up and cleans up the distributed environment, including the device mesh.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rank
|
int
|
The rank of the process. Defaults to 0. |
0
|
world_size
|
int
|
The world size of the distributed environment. Defaults to 1. |
1
|
Yields:
Type | Description |
---|---|
None |
Source code in bionemo/moco/testing/parallel_test_utils.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|