deepfold.testing package¶
Submodules¶
deepfold.testing.common module¶
- class deepfold.testing.common.MultiProcessTestCase(meethod_name: str = 'runTest')[source]¶
Bases:
TestCase
- MAIN_PROCESS_RANK: int = -1¶
- TEST_ERROR_EXIT_CODE: int = 10¶
- property is_master: bool¶
- property world_size: int¶
- deepfold.testing.common.skip_if_no_gpu(func)[source]¶
Skips if the world size exceeds the number of GPUs.
- deepfold.testing.common.with_nccl_blocking_wait(func)[source]¶
Convenience decorator to set/unset TORCH_NCCL_BLOCKING_WAIT flag. Note that use of this decorator will override the setting of TORCH_NCCL_ASYNC_ERROR_HANDLING for the particular test. After the test, both TORCH_NCCL_BLOCKING_WAIT and TORCH_NCCL_ASYNC_ERROR_HANDLING will be restored to their original values.
deepfold.testing.utils module¶
- deepfold.testing.utils.find_free_port()[source]¶
Finds an available port and returns that port number.
NOTE: If this function is being used to allocate a port to Store (or indirectly via init_process_group or init_rpc), it should be used in conjuction with the retry_on_connect_failures decorator as there is a potential race condition where the allocated port may become unavailable before it can be used