Skip to content

Commit

Permalink
add mem pool mgmt to bench command
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisChourakiSonos committed Dec 9, 2024
1 parent 83edf43 commit c33b266
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions cli/src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,22 @@ pub fn handle(
let model =
params.tract_model.downcast_ref::<TypedModel>().context("Can only bench TypedModel")?;
let inputs = tract_libcli::tensor::retrieve_or_make_inputs(model, &run_params)?.remove(0);
let plan = SimplePlan::new_with_options(model, &plan_options)?;
let mut plan = SimplePlan::new_with_options(model, &plan_options)?;
let state = TypedSimpleState::new_from_inputs(&plan, inputs.clone())?;

limits.warmup(model, &inputs)?;

let mut state = SimpleState::new(plan)?;
#[cfg(any(target_os = "macos", target_os = "ios"))]
{
let session_handler = tract_metal::MetalSessionHandler::from_plan(
&plan,
&state.session_state.resolved_symbols,
)?;

plan = plan.with_session_handler(session_handler);
}

let mut state = SimpleState::new(Arc::new(plan))?;
let mut iters = 0;

let progress = probe.and_then(|m| m.get_i64("progress"));
Expand Down

0 comments on commit c33b266

Please sign in to comment.