open-compass / opencompass

OpenCompass is an LLM evaluation platform, supporting a wide range of models (Llama3, Mistral, InternLM2,GPT-4,LLaMa2, Qwen,GLM, Claude, etc) over 100+ datasets.
https://opencompass.org.cn/
Apache License 2.0
3.6k stars 377 forks source link

[Bug] Pangu API doesn't work. can't debug. 盘古API不工作,无法debug #962

Closed iBeyondYourDream closed 5 months ago

iBeyondYourDream commented 5 months ago

Prerequisite

Type

I have modified the code (config is not considered code), or I'm working on my own tasks/models/datasets.

Environment

{'CUDA available': False,
 'GCC': 'gcc (GCC) 11.2.0',
 'MMEngine': '0.10.3',
 'MUSA available': False,
 'OpenCV': '4.9.0',
 'PyTorch': '2.2.1',
 'PyTorch compiling details': 'PyTorch built with:\n'
                              '  - GCC 9.3\n'
                              '  - C++ Version: 201703\n'
                              '  - Intel(R) oneAPI Math Kernel Library Version '
                              '2023.1-Product Build 20230303 for Intel(R) 64 '
                              'architecture applications\n'
                              '  - Intel(R) MKL-DNN v3.3.2 (Git Hash '
                              '2dc95a2ad0841e29db8b22fbccaf3e5da7992b01)\n'
                              '  - OpenMP 201511 (a.k.a. OpenMP 4.5)\n'
                              '  - LAPACK is enabled (usually provided by '
                              'MKL)\n'
                              '  - NNPACK is enabled\n'
                              '  - CPU capability usage: AVX512\n'
                              '  - Build settings: BLAS_INFO=mkl, '
                              'BUILD_TYPE=Release, CUDA_VERSION=12.1, '
                              'CUDNN_VERSION=8.9.2, '
                              'CXX_COMPILER=/opt/rh/devtoolset-9/root/usr/bin/c++, '
                              'CXX_FLAGS= -D_GLIBCXX_USE_CXX11_ABI=0 '
                              '-fabi-version=11 -fvisibility-inlines-hidden '
                              '-DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO '
                              '-DLIBKINETO_NOROCTRACER -DUSE_FBGEMM '
                              '-DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK '
                              '-DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE '
                              '-O2 -fPIC -Wall -Wextra -Werror=return-type '
                              '-Werror=non-virtual-dtor -Werror=bool-operation '
                              '-Wnarrowing -Wno-missing-field-initializers '
                              '-Wno-type-limits -Wno-array-bounds '
                              '-Wno-unknown-pragmas -Wno-unused-parameter '
                              '-Wno-unused-function -Wno-unused-result '
                              '-Wno-strict-overflow -Wno-strict-aliasing '
                              '-Wno-stringop-overflow -Wsuggest-override '
                              '-Wno-psabi -Wno-error=pedantic '
                              '-Wno-error=old-style-cast -Wno-missing-braces '
                              '-fdiagnostics-color=always -faligned-new '
                              '-Wno-unused-but-set-variable '
                              '-Wno-maybe-uninitialized -fno-math-errno '
                              '-fno-trapping-math -Werror=format '
                              '-Wno-stringop-overflow, LAPACK_INFO=mkl, '
                              'PERF_WITH_AVX=1, PERF_WITH_AVX2=1, '
                              'PERF_WITH_AVX512=1, TORCH_VERSION=2.2.1, '
                              'USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, '
                              'USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, '
                              'USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, '
                              'USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, '
                              'USE_ROCM_KERNEL_ASSERT=OFF, \n',
 'Python': '3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0]',
 'TorchVision': '0.17.1',
 'numpy_random_seed': 2147483648,
 'opencompass': '0.2.2+3e9844e',
 'sys.platform': 'linux'}

Reproduces the problem - code/configuration sample

from mmengine.config import read_base
from opencompass.models import PanGu
from opencompass.partitioners import NaivePartitioner
from opencompass.runners.local_api import LocalAPIRunner
from opencompass.tasks import OpenICLInferTask

with read_base():
    from ..summarizers.medium import summarizer
    from ..datasets.ceval.ceval_gen import ceval_datasets

datasets = [
    *ceval_datasets,
]

models = [
    dict(
        abbr='pangu',
        type=PanGu,
        path='pangu',
        access_key="xxxxxxxxxxx",
        secret_key="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        url='https://pangu.cn-xxxx-2.myhuaweicloud.com/v1/infers/xxxxxxxxxxxxxxxxxxx/v1/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
            '/deployments/xxxxxxxxxxxxxxxxxxxx/chat/completions',
        token_url="https://iam.cn-xxxxx-2.myhuaweicloud.com/v3/auth/tokens",
        project_name="cn-xxxxxxx-2",
        query_per_second=1,
        max_out_len=10,
        max_seq_len=10,
        batch_size=8),
]

infer = dict(
    partitioner=dict(type=NaivePartitioner),
    runner=dict(
        type=LocalAPIRunner,
        max_num_workers=2,
        concurrent_users=2,
        task=dict(type=OpenICLInferTask)),
)

work_dir = "outputs/api_pangu/"

Reproduces the problem - command or script

run the command python run.py ./configs/api_examples/eval_api_pangu.py --debug

Reproduces the problem - error message

then get response from agent sdk failed. there is figure image

Other information

Your framework code has a high level of abstraction, and I don't want to study the MMEngine framework. How should I debug it 你们的框架代码抽象程度有点高,我不想研究MMEngine框架的东西,这该怎么debug。

Can you throw more details about the error?

tonysy commented 5 months ago

You can use pdb in https://github.com/open-compass/opencompass/blob/main/opencompass/models/pangu_api.py. At present, we do not possess a valid key for Pangu API. Kindly review the latest documentation of the Pangu API and modify the implementation accordingly if necessary.implementation if needed.

iBeyondYourDream commented 5 months ago

You can use pdb in https://github.com/open-compass/opencompass/blob/main/opencompass/models/pangu_api.py. At present, we do not possess a valid key for Pangu API. Kindly review the latest documentation of the Pangu API and modify the implementation accordingly if necessary.implementation if needed.

the latest https://github.com/open-compass/opencompass/blob/main/opencompass/models/pangu_api.py is updated 4 months ago. its same setting in my code. How to debug this error get response from agent sdk failed. ? I can't search this message in the whole project.