-
Notifications
You must be signed in to change notification settings - Fork 694
[Feature] support async download features #4910
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
[Feature] support async download features #4910
Conversation
|
Thanks for your contribution! |
…50908' into preprocess_download
…50908' into preprocess_download
There was a problem hiding this 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 adds asynchronous download capabilities for multimodal features (image, video, audio) from Baidu Object Storage (BOS). The implementation uses a thread pool executor to download features asynchronously during request scheduling, preventing blocking operations on the main scheduler thread. The feature is controlled by the --enable-async-download-features CLI flag.
Key Changes:
- Added
download_from_bos()utility function for downloading pickled feature data from BOS - Implemented async preprocessing in the resource manager with thread pool executor for non-blocking downloads
- Enhanced tensor conversion to handle lists of features and bidirectional numpy/tensor conversion
- Refactored error handling to support async download failures with proper error codes
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
fastdeploy/utils.py |
Added download_from_bos() function to download and deserialize features from BOS using pickle |
fastdeploy/inter_communicator/engine_worker_queue.py |
Added to_numpy() method for engine-to-worker tensor conversion and enhanced to_tensor() to handle feature lists |
fastdeploy/engine/sched/resource_manager_v1.py |
Implemented async preprocessing pipeline with thread pool executor, download orchestration, and skip/error request handling in scheduler |
fastdeploy/engine/request.py |
Added async_process_futures, error_message, and error_code fields to support async preprocessing |
fastdeploy/engine/common_engine.py |
Refactored error response handling into _send_error_response() method and integrated async error handling in scheduler loop |
fastdeploy/engine/args_utils.py |
Added --enable-async-download-features CLI argument |
fastdeploy/config.py |
Added enable_async_download_features configuration flag to ParallelConfig |
eb1c5d4
3ce2c8f
into
PaddlePaddle:feature/experimental_feature_20250908
* add async download * update code * fix bug * update code * update code * fix bugs * update code --------- Co-authored-by: Jiang-Jia-Jun <163579578+Jiang-Jia-Jun@users.noreply.github.com>
Motivation
support async download features
Modifications
Usage or Command
优化通信速度(不强依赖,建议配置):
export FD_ENABLE_E2W_TENSOR_CONVERT = 1
启动时需要增加参数:
Accuracy Tests
Checklist
[FDConfig],[APIServer],[Engine],[Scheduler],[PD Disaggregation],[Executor],[Graph Optimization],[Speculative Decoding],[RL],[Models],[Quantization],[Loader],[OP],[KVCache],[DataProcessor],[BugFix],[Docs],[CI],[Optimization],[Feature],[Benchmark],[Others],[XPU],[HPU],[GCU],[DCU],[Iluvatar],[Metax]]pre-commitbefore commit.releasebranch, make sure the PR has been submitted to thedevelopbranch, then cherry-pick it to thereleasebranch with the[Cherry-Pick]PR tag.