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
77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
find_free_network_port(address='localhost')
Finds a free port for the specified address. Defaults to localhost.
Source code in bionemo/moco/testing/parallel_test_utils.py
31 32 33 34 35 36 37 38 39 40 |
|
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
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|