Repository: open-compass/opencompass
Issue: [Bug] Error on LLaMA-2-Chat + LocalRunner + Debug
Root cause: Architectural Constraint

### Describe the bug

`configs/eval_llama2_7b_chat.py`
```python3
from mmengine.config import read_base

with read_base():
    from .datasets.piqa.piqa_ppl import piqa_datasets
    from .datasets.siqa.siqa_gen import siqa_datasets
    from .models.llama2_7b_chat import models


datasets = [*piqa_datasets, *siqa_datasets]
```

run command

```bash
python3 run.py configs/eval_llama2_7b_chat.py --debug
```

gives output

```text
Traceback (most recent call last):
  File "/cpfs01/user/zhoufengzhe/anaconda3/envs/pjeval-deploy/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 122, in build_from_cfg
    obj = obj_cls(**args)  # type: ignore
  File "/cpfs01/user/zhoufengzhe/repos/pjeval/opencompass/models/llama2.py", line 36, in __init__
    self._load_model(path=path,
  File "/cpfs01/user/zhoufengzhe/repos/pjeval/opencompass/models/llama2.py", line 50, in _load_model
    self.generator = Llama.build(path, tokenizer_path, max_seq_len,
  File "/cpfs01/user/zhoufengzhe/llama/llama/generation.py", line 62, in build
    torch.distributed.init_process_group("nccl")
  File "/cpfs01/user/zhoufengzhe/anaconda3/envs/pjeval-deploy/lib/python3.8/site-packages/torch/distributed/distributed_c10d.py", line 754, in init_process_group
    store, rank, world_size = next(rendezvous_iterator)
  File "/cpfs01/user/zhoufengzhe/anaconda3/envs/pjeval-deploy/lib/python3.8/site-packages/torch/distributed/rendezvous.py", line 236, in _env_rendezvous_handler
    rank = int(_get_env_or_raise("RANK"))
  File "/cpfs01/user/zhoufengzhe/anaconda3/envs/pjeval-deploy/lib/python3.8/site-packages/torch/distributed/rendezvous.py", line 221, in _get_env_or_raise
    raise _env_error(env_var)
ValueError: Error initializing torch.distributed using env:// rendezvous: environment variable RANK expected, but not set

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "run.py", line 339, in <module>
    main()
  File "run.py", line 214, in main
    exec_infer_runner(tasks, args, cfg)
  File "run.py", line 309, in exec_infer_runner
    runner(tasks)
  File "/cpfs01/user/zhoufengzhe/repos/pjeval/opencompass/runners/base.py", line 38, in __call__
    status = self.launch(tasks)
  File "/cpfs01/user/zhoufengzhe/repos/pjeval/opencompass/runners/local.py", line 57, in launch
    task.run()
  File "/cpfs01/user/zhoufengzhe/repos/pjeval/opencompass/tasks/openicl_infer.py", line 60, in run
    self.model = build_model_from_cfg(model_cfg)
  File "/cpfs01/user/zhoufengzhe/repos/pjeval/opencompass/utils/build.py", line 22, in build_model_from_cfg
    return MODELS.build(model_cfg)
  File "/cpfs01/user/zhoufengzhe/anaconda3/envs/pjeval-deploy/lib/python3.8/site-packages/mmengine/registry/registry.py", line 570, in build
    return self.build_func(cfg, *args, **kwargs, registry=self)
  File "/cpfs01/user/zhoufengzhe/anaconda3/envs/pjeval-deploy/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 144, in build_from_cfg
    raise type(e)(
ValueError: class `Llama2Chat` in opencompass/models/llama2.py: Error initializing torch.distributed using env:// rendezvous: environment variable RANK expected, but not set
```

This is caused by direct use of `task.run()` instead of the 'build command - run the command in subprocess' process.

https://github.com/InternLM/opencompass/blob/e6194df29ef174737f09498169513554b2737dd2/opencompass/runners/local.py#L54-L58 



### Environment

Nah

### Other information

_No response_