Skip to content

Commit

Permalink
Rudimentary loading, terminate after 5s
Browse files Browse the repository at this point in the history
  • Loading branch information
EricLBuehler committed Dec 31, 2024
1 parent 4cdaa20 commit c97a950
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mistralrs-core/src/pipeline/normal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,12 @@ impl Loader for NormalLoader {
let num_parallel = 2;
use nix::sys::signal::{kill, Signal};
use nix::unistd::{fork, ForkResult};
let mut pids = Vec::new();
for _ in 0..num_parallel {
match unsafe { fork() } {
Ok(ForkResult::Parent { child, .. }) => {
println!("created child {child}");
pids.push(child);
}
Ok(ForkResult::Child) => {
println!("child executing!!");
Expand All @@ -353,6 +355,10 @@ impl Loader for NormalLoader {
Err(_) => println!("Fork failed"),
}
}
std::thread::sleep(std::time::Duration::from_secs_f32(5.));
for pid in pids {
kill(pid, Signal::SIGTERM)?;
}
}

let mut model = match self.kind {
Expand Down

0 comments on commit c97a950

Please sign in to comment.