Skip to content
Open
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
19 changes: 11 additions & 8 deletions crates/cubecl-runtime/src/tune/tuner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use alloc::vec::Vec;
use async_channel::{Receiver, Sender};
use cubecl_common::profile::ProfileDuration;
use hashbrown::HashSet;
use log::warn;

use core::time::Duration;

Expand Down Expand Up @@ -308,16 +309,17 @@ impl<K: AutotuneKey> Tuner<K> {
a.cmp(&b)
});

// Log & send results.
let result = results
.first()
.expect("At least one kernel needed.")
.as_ref()
.expect("At least one kernel has to succeed.");
let mut fastest_index = 0;

if let Some(result) = results.first() {
if let Ok(result) = result.as_ref() {
fastest_index = result.index;
}
}

AutotuneMessage::Done {
key,
fastest_index: result.index,
fastest_index,
results,
#[cfg(std_io)]
checksum,
Expand All @@ -341,7 +343,8 @@ impl<K: AutotuneKey> Tuner<K> {
let tunable_indices = plan.next();

if tunable_indices.is_empty() {
panic!("No autotune was flagged as valid for the problem.")
log::warn!("No autotune was flagged as valid for the problem.");
return;
}

for index in tunable_indices {
Expand Down
Loading