code: def check_tp_or_pp_inference(rank, world_size, port):
      colossalai.launch(
          config={},
          rank=rank,
          world_size=world_size,
          host="localhost",
          port=port,
          backend="nccl",
      )
      run_tp_inference_test()
      run_pipeline_inference_test()
  
file_path: colossalai/tests/test_infer/test_hybrid_chatglm2.py
imports: import importlib.util
  import pytest
  import torch
  import torch.distributed
  from packaging import version
  import colossalai
  from colossalai.inference import InferenceEngine
  from colossalai.shardformer.modeling.chatglm2_6b.configuration_chatglm import ChatGLMConfig
  from colossalai.shardformer.modeling.chatglm2_6b.modeling_chatglm import ChatGLMForConditionalGeneration
  from colossalai.testing import clear_cache_before_run, parameterize, rerun_if_address_is_in_use, spawn
label_desc: Use image node_id 8 for calling a global function with example usage: check_tp_or_pp_inference(rank, world_size, port) without return types