Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions crates/messages/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,11 @@ pub enum Executor {
config: DiLoCoConfig,
},
#[serde(rename = "parameter-server")]
ParameterServer { updates: Receive, results: Send },
ParameterServer {
updates: Receive,
results: Send,
optimizer: Optimizer,
},
}

#[derive(Serialize, Deserialize, Debug, Clone)]
Expand All @@ -381,9 +385,9 @@ pub enum Optimizer {
betas: Option<[f64; 2]>,
epsilon: Option<f64>,
},
Sgd {
Nesterov {
learning_rate: f64,
momentum: Option<f64>,
momentum: f64,
},
}

Expand Down
4 changes: 4 additions & 0 deletions crates/scheduler/src/bin/hypha-scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ async fn run(config: ConfigWithMetadata<Config>) -> Result<()> {
executor: Executor::ParameterServer {
updates: Receive::peers(worker_ids.clone()),
results: Send::peers(worker_ids.clone(), SelectionStrategy::All),
optimizer: Optimizer::Nesterov {
learning_rate: 0.7,
momentum: 0.9,
},
},
})
.await
Expand Down
6 changes: 6 additions & 0 deletions crates/worker/src/executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ mod process;
pub use parameter_server::ParameterServerExecutor;
pub use process::ProcessExecutor;

use crate::executor::parameter_server::TensorOpError;

#[derive(Error, Debug)]
pub enum Error {
#[error("Bridge error")]
Expand All @@ -19,6 +21,10 @@ pub enum Error {
Io(#[from] std::io::Error),
#[error("Unsupported job spec")]
UnsupportedJobSpec(),
#[error("Unsupported optimizer")]
UnsupportedOptimizer(),
#[error("Tensor error")]
Tensor(#[from] TensorOpError),
}

pub trait JobExecutor {
Expand Down
Loading
Loading