Skip to content

Conversation

Echo-Nie
Copy link
Contributor

Test Content

  • Verify that load_model() successfully returns the mock model and that it can be correctly retrieved via get_model().

  • Call execute_model() with batch_size=4, prompt_tokens=6, and decode_tokens=8.

  • Check the returned ModelRunnerOutput:

    1. generated_ids and logits have the correct batch dimension.
    2. Each sequence contains the expected number of decode tokens.
  • Call profile_run() to return mocked profile information, including the key field memory.

Result

/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/utils/cpp_extension/extension_utils.py:717: UserWarning: No ccache found. Please be aware that recompiling all source files may be required. You can download and install ccache from: https://github.com/ccache/ccache/blob/master/doc/INSTALL.md
  warnings.warn(warning_message)
/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/_distutils_hack/__init__.py:30: UserWarning: Setuptools is replacing distutils. Support for replacing an already imported distutils is deprecated. In the future, this condition will fail. Register concerns at https://github.com/pypa/setuptools/issues/new?template=distutils-deprecation.yml
  warnings.warn(
...
----------------------------------------------------------------------
Ran 3 tests in 0.005s

OK

测试内容:构造一个可以随意指定BatchSize(无动态插入)、Prompt 的 token 数、Decode 的 token 数的只跑假数据的 Worker/ModelRunner
Copy link

paddle-bot bot commented Aug 24, 2025

Thanks for your contribution!

@paddle-bot paddle-bot bot added the contributor External developers label Aug 24, 2025
@Echo-Nie Echo-Nie changed the title 【Hackathon 9th No.72】unit test supplement for the Worker/ModelRunner 【Hackathon 9th No.72】supplementary unit test for worker/model_runner Aug 24, 2025
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议参考下gpu_model_runner的 dummy run 方法,dummy run 会构造特定长度的输入

@luotao1
Copy link
Collaborator

luotao1 commented Sep 15, 2025

@Echo-Nie Any update?

@Echo-Nie
Copy link
Contributor Author

之前没来得及维护,该PR暂时关闭

@Echo-Nie Echo-Nie closed this Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants