From 7c98884331994fa0edf43547ee6c6ae44a37779a Mon Sep 17 00:00:00 2001 From: Marcus Asteborg Date: Sat, 6 Jun 2026 07:48:34 -0700 Subject: [PATCH] Remove md5 deps --- crates/cubecl-runtime/Cargo.toml | 1 - crates/cubecl-runtime/src/tune/operation.rs | 13 ++++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/crates/cubecl-runtime/Cargo.toml b/crates/cubecl-runtime/Cargo.toml index 1759c7806f..3743d0f772 100644 --- a/crates/cubecl-runtime/Cargo.toml +++ b/crates/cubecl-runtime/Cargo.toml @@ -60,7 +60,6 @@ web-time = { workspace = true } thiserror = { workspace = true } ahash = { version = "0.8.12", default-features = false } -md5 = { workspace = true } # Persistent cache deps - has to match the cfg(std_io) cfg. [target.'cfg(any(target_os = "windows", target_os = "linux", target_os = "macos", target_os = "android"))'.dependencies] diff --git a/crates/cubecl-runtime/src/tune/operation.rs b/crates/cubecl-runtime/src/tune/operation.rs index cab28236f7..f26e38168d 100644 --- a/crates/cubecl-runtime/src/tune/operation.rs +++ b/crates/cubecl-runtime/src/tune/operation.rs @@ -5,8 +5,6 @@ use alloc::vec::Vec; use core::fmt::{Debug, Display}; use core::hash::Hash; -use alloc::format; - use super::{ AutotuneError, input_generator::InputGenerator, key_generator::KeyGenerator, tune_inputs::TuneInputs, @@ -93,12 +91,21 @@ impl TunableSet { /// Compute a checksum that invalidates outdated cached auto-tune results when the /// set of tunable names changes. + #[cfg(std_io)] pub fn compute_checksum(&self) -> String { let mut checksum = String::new(); for tune in &self.tunables { checksum += &tune.function.name; } - format!("{:x}", md5::compute(checksum)) + alloc::format!( + "{:x}", + cubecl_common::hash::StableHasher::hash_one(&checksum) + ) + } + + #[cfg(not(std_io))] + pub fn compute_checksum(&self) -> String { + String::new() } /// Generate a key from a set of inputs