mirror of
https://github.com/huggingface/candle.git
synced 2025-06-15 18:28:24 +00:00
Use mkl to accelerate binary ops. (#190)
* Vectorized binary ops with mkl. * Improve the binary op mkl support. * Push the support for mkl binary ops. * Proper vectorization of binary ops. * Proper mkl'isation when broadcasting binary ops.
This commit is contained in:
@ -115,9 +115,12 @@ fn main() -> Result<()> {
|
||||
let token_ids = Tensor::new(&tokens[..], device)?.unsqueeze(0)?;
|
||||
let token_type_ids = token_ids.zeros_like()?;
|
||||
println!("Loaded and encoded {:?}", start.elapsed());
|
||||
for _ in 0..args.n {
|
||||
for idx in 0..args.n {
|
||||
let start = std::time::Instant::now();
|
||||
let _ys = model.forward(&token_ids, &token_type_ids)?;
|
||||
let ys = model.forward(&token_ids, &token_type_ids)?;
|
||||
if idx == 0 {
|
||||
println!("{ys}");
|
||||
}
|
||||
println!("Took {:?}", start.elapsed());
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user