Repository navigation
feat(vllm): publish RL worker metadata - #13529
biswapanda wants to merge 13 commits into
Conversation
|
👋 Hi biswapanda! Thank you for contributing to ai-dynamo/dynamo. Just a reminder: The 🚀 |
|
/ok to test ca915e1 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (9)
Included review availability: Your plan provides up to 12 included reviews per hour; 8 remain after this review. WalkthroughThe change adds protocol-versioned RL worker metadata. vLLM discovers and validates metadata, ChangesRL worker metadata flow
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to The PR is merge-ready after normal checks and review; no actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Comment |
Signed-off-by: Biswa Panda <[email protected]>
Signed-off-by: Biswa Panda <[email protected]>
ca915e1 to
4571d43
Compare
|
/ok to test 4571d43 |
|
/ok to test c9de4cd |
|
/ok to test 0b413d8 |
|
/ok to test ce4b917 |
connorcarpenter15
left a comment
There was a problem hiding this comment.
Left some nit picky comments mainly about tests and helper functions. One question I have is about the new HTTP endpoint. Why do we need this? I thought all control routes were exposed through gRPC.
|
|
||
| #[test] | ||
| fn rl_worker_metadata_rejects_invalid_values() { | ||
| assert!(RlWorkerMetadata::new(0, None).is_err()); | ||
| assert!(RlWorkerMetadata::new(1, Some(" ".to_string())).is_err()); | ||
| } |
There was a problem hiding this comment.
I don't think this test is necessary
| fn normalized_optional(value: Option<String>, error: &str) -> anyhow::Result<Option<String>> { | ||
| value | ||
| .map(|value| { | ||
| let value = value.trim(); | ||
| if value.is_empty() { | ||
| anyhow::bail!(error.to_string()); | ||
| } | ||
| Ok(value.to_string()) | ||
| }) | ||
| .transpose() | ||
| } |
There was a problem hiding this comment.
Why is this a separate function? It's only used in one place.
| fn rl_endpoint_instances( | ||
| instances: Vec<DiscoveryInstance>, | ||
| rl_endpoint: &str, | ||
| component_filter: Option<&[String]>, | ||
| ) -> Vec<Instance> { | ||
| instances | ||
| .into_iter() | ||
| .filter_map(|instance| match instance { | ||
| DiscoveryInstance::Endpoint(endpoint) => Some(endpoint), | ||
| _ => None, | ||
| }) | ||
| .filter(|endpoint| endpoint.endpoint == rl_endpoint) | ||
| .filter(|endpoint| { | ||
| component_filter | ||
| .map(|components| components.iter().any(|c| c == &endpoint.component)) | ||
| .unwrap_or(true) | ||
| }) | ||
| .collect() | ||
| } |
There was a problem hiding this comment.
Was there a reason for making this a helper function as well?
| #[test] | ||
| fn rl_endpoint_instances_do_not_require_model_metadata() { | ||
| let endpoints = rl_endpoint_instances( | ||
| vec![endpoint_instance("dynamo", "backend", "rl", 1)], | ||
| "rl", | ||
| None, | ||
| ); | ||
|
|
||
| assert_eq!(endpoints.len(), 1); | ||
| assert_eq!(endpoints[0].instance_id, 1); | ||
| } |
There was a problem hiding this comment.
Unnecessary test
| #[test] | ||
| fn http_admin_endpoint_accepts_http_https_and_path_prefixes() { | ||
| for endpoint in [ | ||
| "http://worker:8120", | ||
| "https://worker.example.com", | ||
| "https://worker.example.com/admin/v1", | ||
| ] { | ||
| assert_eq!( | ||
| validate_http_endpoint(endpoint).expect("valid HTTP admin endpoint"), | ||
| endpoint | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| #[test] | ||
| fn http_admin_endpoint_rejects_invalid_values() { | ||
| for endpoint in ["", "worker:8120", "grpc://worker:8120", "https:///admin"] { | ||
| let error = validate_http_endpoint(endpoint).unwrap_err(); | ||
| assert!(error.to_string().contains("--vllm-http-endpoint")); | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Unnecessary tests
| #[test] | ||
| fn discovered_model_reports_rl_worker_metadata() { | ||
| let model = DiscoveredModel::from_proto(model_info(), server_info()).expect("valid discovery"); | ||
| assert_eq!( | ||
| model | ||
| .rl_worker_metadata(Some("http://worker:8120".to_string())) | ||
| .expect("valid RL metadata"), | ||
| RlWorkerMetadata::new(4, Some("http://worker:8120".to_string())) | ||
| .expect("valid expected metadata") | ||
| ); | ||
| } |
There was a problem hiding this comment.
Unnecessary test
| /// Optional vLLM HTTP admin endpoint advertised for RL weight-transfer control. | ||
| #[arg(long, env = "VLLM_HTTP_ENDPOINT")] | ||
| pub vllm_http_endpoint: Option<String>, |
There was a problem hiding this comment.
Why do we need this? I thought all necessary controls were exposed through gRPC?
| #[test] | ||
| fn parse_worker_routes_rejects_invalid_rl_metadata() { | ||
| let zero = parse_worker_routes(json!({ "routes": [], "world_size": 0 })).unwrap_err(); | ||
| assert!(zero.to_string().contains("world_size")); | ||
| } | ||
|
|
||
| #[test] | ||
| fn parse_worker_routes_rejects_invalid_admin_base_url() { | ||
| for value in [json!(" "), json!(42)] { | ||
| let err = parse_worker_routes(json!({ | ||
| "routes": [], | ||
| "admin_base_url": value, | ||
| })) | ||
| .unwrap_err(); | ||
| assert!(err.to_string().contains("admin_base_url")); | ||
| } | ||
| } |
There was a problem hiding this comment.
Not sure we really need these either
|
Closing in favor of #13607. |
Summary
Dependency
Stacked on #13524, which defines the shared worker metadata contract. Once #13524 merges, this PR reduces to the four vLLM sidecar files.
Validation
Summary by CodeRabbit
Review follow-up validation
cargo test -p dynamo-vllm-sidecar --lib(26 passed)cargo clippy -p dynamo-vllm-sidecar --all-targets -- -D warnings