code: def pytest_runtest_teardown(item: Any) -> None:
      if "OMPI_COMM_WORLD_RANK" in os.environ:
          destroy_model_parallel()
          if torch.distributed.is_initialized():
              torch.distributed.destroy_process_group()
          try:
              torch.distributed.rpc.shutdown()
          except Exception:
              pass
  
file_path: fairscale/tests/nn/pipe_process/conftest.py
imports: import functools
  import os
  from typing import Any, Callable
  import pytest
  import torch
  from fairscale.nn.model_parallel import destroy_model_parallel
label_desc: Use image node_id 6 for calling a global function with example usage: pytest_runtest_teardown(item) without return types