|
|
@@ -47,12 +47,12 @@ pub struct Config {
|
|
|
pub nccl: HashMap<String, NcclConfig>,
|
|
|
#[serde(default)]
|
|
|
pub hf_cache_dir: Option<String>,
|
|
|
- /// TCP port for cluster init (vLLM/SGLang).
|
|
|
+ /// TCP port for cluster init (vLLM/SGLang)
|
|
|
#[serde(default = "default_init_port")]
|
|
|
pub init_port: u16,
|
|
|
- /// Per-cluster pre-serve commands, command aliases, HA config.
|
|
|
+ /// Per-cluster pre-serve commands, command aliases, HA config
|
|
|
#[serde(default)]
|
|
|
- pub before_serve: HashMap<String, BeforeServeTable>,
|
|
|
+ pub before_serve: HashMap<String, BeforeServeTable>, // <-- move here
|
|
|
#[serde(default)]
|
|
|
pub exec_aliases: HashMap<String, String>,
|
|
|
#[serde(default)]
|
|
|
@@ -75,6 +75,9 @@ fn default_shutdown_delay() -> u64 {
|
|
|
fn default_init_port() -> u16 {
|
|
|
25000
|
|
|
}
|
|
|
+fn default_port() -> u16 {
|
|
|
+ 30000
|
|
|
+}
|
|
|
|
|
|
impl Config {
|
|
|
pub fn resolved_hf_cache_dir(&self) -> String {
|
|
|
@@ -99,7 +102,7 @@ pub struct Recipe {
|
|
|
pub docker_image: String,
|
|
|
#[serde(default)]
|
|
|
pub model: String,
|
|
|
- #[serde(default)]
|
|
|
+ #[serde(default = "default_port")]
|
|
|
pub port: u16,
|
|
|
#[serde(default)]
|
|
|
pub required_nodes: Option<u32>,
|
|
|
@@ -117,8 +120,7 @@ pub struct Recipe {
|
|
|
pub entrypoint: Vec<String>,
|
|
|
#[serde(default = "default_distributed_backend")]
|
|
|
pub distributed_backend: String,
|
|
|
- /// Shared memory size for the container (e.g. "10g", "64gb").
|
|
|
- /// Default: "10g". Larger contexts (1M tokens) need much more.
|
|
|
+ /// Shared memory size for the container. Default: "10g".
|
|
|
#[serde(default = "default_shm_size")]
|
|
|
pub shm_size: String,
|
|
|
/// Recipe-level pre-serve commands (appended after cluster-level).
|
|
|
@@ -295,7 +297,7 @@ model = "test/model"
|
|
|
assert_eq!(recipe.name, "Minimal");
|
|
|
assert_eq!(recipe.model, "test/model");
|
|
|
assert_eq!(recipe.engine, "vllm");
|
|
|
- assert_eq!(recipe.port, 0);
|
|
|
+ assert_eq!(recipe.port, 30000);
|
|
|
assert!(recipe.args.is_empty());
|
|
|
assert!(recipe.env.is_empty());
|
|
|
assert_eq!(recipe.distributed_backend, "mp");
|
|
|
@@ -397,8 +399,6 @@ nodes = [
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- // ── select_cluster tests ───────────────────────────────────
|
|
|
-
|
|
|
#[test]
|
|
|
fn test_select_cluster_by_name() {
|
|
|
let mut config = Config {
|