code: def make_distributed_infer_program(args, model_dict):
      device_ids = get_cuda_places()
      infer_opt = copy.deepcopy(
          static.default_main_program()._fleet_opt
      )
      model_dict.train_program = static.default_main_program().clone()
      model_dict.train_program._fleet_opt = infer_opt
      opt_info = model_dict.train_program._fleet_opt
  
      opt_info["worker_places"] = device_ids
      opt_info["dump_fields"] = [
          args.dump_node_name + ".tmp_0",
          args.dump_node_emb_name + ".tmp_0",
      ]
      opt_info["dump_fields_path"] = args.local_result_path
      opt_info["is_dump_in_simple_mode"] = True
      opt_info["user_define_dump_filename"] = "000"
      opt_info["dump_fields_mode"] = "a"
  
      with open("infer_before_main_program.pbtxt", "w") as fout:
          fout.write(str(model_dict.train_program))
      remove_op(model_dict.train_program, "push_gpups_sparse")
      remove_backword(model_dict.train_program)
      with open("infer_main_program.pbtxt", "w") as fout:
          fout.write(str(model_dict.train_program))
  
file_path: PGL/apps/PGLBox/src/distributed_program.py
imports: import copy
  import paddle
  import paddle.static
  from place import get_cuda_places
label_desc: Use image node_id 2 for calling a global function with example usage: make_distributed_infer_program(args, model_dict) without return types