Skip to content

[vl]remove duplicated load logic #2744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2025
Merged

Conversation

bukejiyu
Copy link
Collaborator

@bukejiyu bukejiyu commented Jul 8, 2025

Reuse the loading logic from fastdeploy/worker/worker_process.py

Copy link

paddle-bot bot commented Jul 8, 2025

Thanks for your contribution!

@CLAassistant
Copy link

CLAassistant commented Jul 8, 2025

CLA assistant check
All committers have signed the CLA.

@bukejiyu bukejiyu force-pushed the vl_loader branch 3 times, most recently from a6690a6 to 05b4eda Compare July 8, 2025 06:10
@bukejiyu bukejiyu force-pushed the vl_loader branch 2 times, most recently from 70afc2c to c64018b Compare July 11, 2025 03:16
@yuanlehome yuanlehome requested a review from Copilot July 11, 2025 05:57
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes duplicated distributed environment initialization logic from the vision-language model runner by reusing the centralized loading logic from worker_process.py. The main purpose is to consolidate configuration initialization and reduce code duplication across the codebase.

Key changes include:

  • Extracted common parallel configuration initialization into reusable functions
  • Replaced custom model building logic in VL model runner with centralized configuration initialization
  • Updated function signatures to accept rank parameters for proper distributed setup

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
fastdeploy/worker/worker_process.py Extracted distributed initialization and parallel config setup into reusable functions, updated function signatures
fastdeploy/worker/vl_gpu_model_runner.py Removed duplicated model building logic and reused centralized initialization from worker_process.py
fastdeploy/rl/rollout_config.py Updated function call to pass required rank parameters
fastdeploy/model_executor/models/utils.py Added new expert ID placeholders for text and image experts
fastdeploy/model_executor/models/tp_utils.py Enhanced key expansion logic to handle new expert types and improved error handling
fastdeploy/model_executor/models/ernie4_5_vl/modeling_resampler.py Added prefix name support and custom state dict loading
fastdeploy/model_executor/models/ernie4_5_vl/ernie4_5_vl_moe.py Restructured model initialization and added tensor parallel mappings
fastdeploy/model_executor/models/ernie4_5_vl/dfnrope/modeling.py Added prefix name support and custom state dict loading
fastdeploy/model_executor/models/ernie4_5_moe.py Updated tensor parallel mapping function calls
fastdeploy/model_executor/model_loader.py Added VL model support to model registry
fastdeploy/config.py Updated type annotations for MoE configuration fields
Comments suppressed due to low confidence (1)

fastdeploy/worker/vl_gpu_model_runner.py:159

  • Missing space after comma in parameter list - should be '_init_image_preprocess(self, vision_config)'
    def _init_image_preprocess(self,vision_config) -> None:

@bukejiyu bukejiyu force-pushed the vl_loader branch 4 times, most recently from d95f493 to b7c1c5f Compare July 11, 2025 13:41
@yuanlehome yuanlehome merged commit bad53c6 into PaddlePaddle:develop Jul 12, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants