Skip to content

Commit e52e76a

Browse files
RaderCementZhang
andauthored
feat: PD disaggregation uses client-provided config instead of DB recommendation (#1240)
Co-authored-by: cemeng <cemengzhang@gmail.com>
1 parent a36088c commit e52e76a

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

common/types/model.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,11 @@ type ModelRunReq struct {
282282
// When true, the system checks the model metadata for PD recommendation,
283283
// validates hardware resources, and splits resources between prefill and decode.
284284
EnablePD bool `json:"enable_pd"`
285+
// PD is the client-provided PD (Prefill-Decode) disaggregation configuration.
286+
// When EnablePD is true, the client sends TP/DP/EP/PodsSize for prefill and decode
287+
// roles. The server validates the config against available hardware resources
288+
// instead of deriving it from PDRecommendation.
289+
PD *PDConfig `json:"pd,omitempty"`
285290
// OwnerNamespace is optional. If set, the inference is created under this namespace (user or org) for billing and listing; path {namespace} remains the model's owner.
286291
OwnerNamespace string `json:"owner_namespace,omitempty"`
287292
}
@@ -312,6 +317,11 @@ type InstanceRunReq struct {
312317
// When true, the system checks the model metadata for PD recommendation,
313318
// validates hardware resources, and splits resources between prefill and decode.
314319
EnablePD bool `json:"enable_pd"`
320+
// PD is the client-provided PD (Prefill-Decode) disaggregation configuration.
321+
// When EnablePD is true, the client sends TP/DP/EP/PodsSize for prefill and decode
322+
// roles. The server validates the config against available hardware resources
323+
// instead of deriving it from PDRecommendation.
324+
PD *PDConfig `json:"pd,omitempty"`
315325
// OwnerNamespace is optional. If set, the finetune is created under this namespace (user or org); path {namespace} remains the model's owner.
316326
OwnerNamespace string `json:"owner_namespace,omitempty"`
317327
}

common/types/pd.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,17 +190,21 @@ type PDConfig struct {
190190
}
191191

192192
// PDRoleRuntimeConfig holds the runtime parallelism and hardware resource
193-
// configuration for one PD role (prefill or decode). This is derived from
194-
// the PDRecommendation and the user's hardware input, split proportionally.
193+
// configuration for one PD role (prefill or decode). This is provided by the
194+
// client and validated/supplemented by the server.
195195
type PDRoleRuntimeConfig struct {
196196
// TP is the tensor parallelism degree.
197197
TP int `json:"tp"`
198198
// EP is the expert parallelism degree (1 for dense models).
199199
EP int `json:"ep"`
200200
// DP is the data parallelism degree.
201201
DP int `json:"dp"`
202-
// TotalGPUs is the total GPUs for this role (TP * EP * DP).
202+
// TotalGPUs is the total GPUs for this role (TP * DP). EP does not add extra GPUs.
203203
TotalGPUs int `json:"total_gpus"`
204+
// PodsSize is the number of pods per LWS group (maps to LWS spec.leaderWorkerTemplate.size).
205+
// Each pod runs one vLLM/SGLang instance. GPUs per pod = TotalGPUs / PodsSize.
206+
// When PodsSize is 0 or 1, all GPUs are in a single pod.
207+
PodsSize int `json:"pods_size,omitempty"`
204208
// Hardware is the hardware resource allocated to this role.
205209
Hardware HardWare `json:"hardware"`
206210
}

0 commit comments

Comments
 (0)