[Rust Frontend][gRPC] Add server and model discovery (#49491)
Signed-off-by: Connor Carpenter <connorc@nvidia.com> Co-authored-by: Nick Hill <nickhill123@gmail.com>
This commit is contained in:
co-authored by
Nick Hill
parent
2b465b2c42
commit
e3c2fc3b3c
@@ -394,6 +394,17 @@ impl EngineCoreClient {
|
||||
self.engines.iter().map(|engine| &engine.ready_response).collect()
|
||||
}
|
||||
|
||||
/// Return the first engine's ready response.
|
||||
///
|
||||
/// Per-engine fields such as `data_parallel_rank` should be read through
|
||||
/// [`ready_responses`](Self::ready_responses).
|
||||
pub fn ready_response(&self) -> &EngineCoreReadyResponse {
|
||||
&self
|
||||
.engines
|
||||
.first()
|
||||
.expect("engine core client requires at least one engine")
|
||||
.ready_response
|
||||
}
|
||||
/// Return the engine-reported effective model dtype.
|
||||
pub fn model_dtype(&self) -> ModelDtype {
|
||||
self.engines
|
||||
|
||||
@@ -57,6 +57,13 @@ pub fn default_ready_response() -> EngineCoreReadyResponse {
|
||||
vllm_version: "test-vllm-version".to_string(),
|
||||
world_size: 1,
|
||||
data_parallel_size: 1,
|
||||
tensor_parallel_size: 1,
|
||||
pipeline_parallel_size: 1,
|
||||
decode_context_parallel_size: 1,
|
||||
data_parallel_rank: 0,
|
||||
max_num_seqs: 256,
|
||||
max_num_batched_tokens: 8192,
|
||||
instance_id: "test-instance".to_string(),
|
||||
kv_cache_size_tokens: None,
|
||||
kv_cache_max_concurrency: None,
|
||||
}
|
||||
|
||||
@@ -52,6 +52,21 @@ pub struct EngineCoreReadyResponse {
|
||||
pub world_size: u64,
|
||||
/// Data parallelism size from the parallel config.
|
||||
pub data_parallel_size: u64,
|
||||
// Required discovery metadata; EngineCore and client versions must match.
|
||||
/// Tensor-parallel size of this engine.
|
||||
pub tensor_parallel_size: u32,
|
||||
/// Pipeline-parallel size of this engine.
|
||||
pub pipeline_parallel_size: u32,
|
||||
/// Decode-context-parallel size of this engine.
|
||||
pub decode_context_parallel_size: u32,
|
||||
/// This engine's data-parallel rank.
|
||||
pub data_parallel_rank: u32,
|
||||
/// Scheduler cap on concurrently running sequences.
|
||||
pub max_num_seqs: u64,
|
||||
/// Scheduler cap on batched tokens per step.
|
||||
pub max_num_batched_tokens: u64,
|
||||
/// Unique identifier for this server instance.
|
||||
pub instance_id: String,
|
||||
/// Total KV cache capacity in tokens, if reported.
|
||||
pub kv_cache_size_tokens: Option<u64>,
|
||||
/// Maximum achievable request concurrency given the KV cache, if reported.
|
||||
|
||||
@@ -363,6 +363,13 @@ class EngineCoreReadyResponse:
|
||||
vllm_version: str
|
||||
world_size: int
|
||||
data_parallel_size: int
|
||||
tensor_parallel_size: int
|
||||
pipeline_parallel_size: int
|
||||
decode_context_parallel_size: int
|
||||
data_parallel_rank: int
|
||||
max_num_seqs: int
|
||||
max_num_batched_tokens: int
|
||||
instance_id: str
|
||||
kv_cache_size_tokens: int | None = None
|
||||
kv_cache_max_concurrency: float | None = None
|
||||
|
||||
@@ -376,6 +383,13 @@ ready_response = EngineCoreReadyResponse(
|
||||
vllm_version="0.0.0",
|
||||
data_parallel_size=1,
|
||||
world_size=1,
|
||||
tensor_parallel_size=1,
|
||||
pipeline_parallel_size=1,
|
||||
decode_context_parallel_size=1,
|
||||
data_parallel_rank=0,
|
||||
max_num_seqs=256,
|
||||
max_num_batched_tokens=8192,
|
||||
instance_id="test-instance",
|
||||
)
|
||||
|
||||
print(msgspec.msgpack.encode(request).hex())
|
||||
|
||||
Reference in New Issue
Block a user