基于 DirectLaunch 的 HIP/CUDA 双平台 vLLM 调度#26
Open
tonghaoxin wants to merge 63 commits into
Open
Conversation
包括 CUDA/HIP 平台的 shim 拦截层、XQueue 虚拟队列、 XScheduler 调度器、多级抢占 HAL 等核心组件。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
将 cudaStreamCreate/hipStreamCreate 拦截后改调 cuStreamCreateWithPriority/hipStreamCreateWithPriority, 优先级从 XSCHED_AUTO_XQUEUE_PRIORITY 环境变量读取。 这样 Runtime API 创建的 stream 也能获得 GPU 硬件优先级, 支持 XSched 的多优先级调度,无需 ShadowSubmit/VipPulse 等事后补救机制。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
原版 XSched 对默认流(stream=nullptr)直接 bypass,不建 XQueue、不参与调度。vLLM 等现代推理引擎主要使用默认流发射 kernel,导致 GPU
活动对调度器完全不可见。本次提交解决了 HIP(海光 DCU)和 CUDA(NVIDIA)两个平台上的 vLLM 调度问题。
核心思路
应用调 kernel API
→ shim 拦截
→ XQueue 查/建(仅追踪,不执行)
→ Ready 心跳 → 调度器感知活动
→ suspend 门控 → 挂起时 sleep 等待 Resume
→ DirectLaunch → 直调真 GPU 驱动 API
kernel 不再经过 XQueue 的 CommandBuffer/LaunchWorker 执行管线,调度控制通过主线程上的门控实现。
修改内容
HIP 平台
CUDA 平台
基础设施
解决的问题
本次修改关联issue “How to integrate/run vLLM with XSched? (Missing example/docs)#22”