From 341963a4b3a4b7430402f7db18eb7aeff79bb17f Mon Sep 17 00:00:00 2001 From: nathaniel Date: Wed, 27 Nov 2024 17:37:48 -0500 Subject: [PATCH] Cleanup --- crates/cubecl-linalg/src/matmul/base.rs | 2 +- crates/cubecl-linalg/src/matmul/kernels/cmma_old/launch.rs | 4 ++-- .../cubecl-linalg/src/matmul/kernels/matmul/algorithm/base.rs | 2 +- crates/cubecl-linalg/src/matmul/kernels/matmul/base.rs | 4 ++-- crates/cubecl-linalg/src/matmul/kernels/tiling2d/launch.rs | 4 ++-- .../src/matmul/tests/cmma_matmul/matmul_test_launcher.rs | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/cubecl-linalg/src/matmul/base.rs b/crates/cubecl-linalg/src/matmul/base.rs index f2ac42f3..dc53b881 100644 --- a/crates/cubecl-linalg/src/matmul/base.rs +++ b/crates/cubecl-linalg/src/matmul/base.rs @@ -59,7 +59,7 @@ pub fn launch_ref( } Strategy::Simple => simple::launch_ref::(client, lhs, rhs, out), Strategy::Auto => { - if let Err(_) = matmul::launch_ref::(client, lhs, rhs, out, false) { + if matmul::launch_ref::(client, lhs, rhs, out, false).is_err() { tiling2d::launch_ref::(client, lhs, rhs, out, Tiling2dConfig::default()) } } diff --git a/crates/cubecl-linalg/src/matmul/kernels/cmma_old/launch.rs b/crates/cubecl-linalg/src/matmul/kernels/cmma_old/launch.rs index a666af2f..2e879ed4 100644 --- a/crates/cubecl-linalg/src/matmul/kernels/cmma_old/launch.rs +++ b/crates/cubecl-linalg/src/matmul/kernels/cmma_old/launch.rs @@ -45,8 +45,8 @@ pub fn matmul_cmma_ref( MatrixLayout::HighlyPermuted => false, }; - let lhs_correct_layout = check_layout(&lhs); - let rhs_correct_layout = check_layout(&rhs); + let lhs_correct_layout = check_layout(lhs); + let rhs_correct_layout = check_layout(rhs); match (lhs_correct_layout, rhs_correct_layout) { (true, true) => matmul_cmma_ref_no_check::(client, lhs, rhs, out, cmma_config), diff --git a/crates/cubecl-linalg/src/matmul/kernels/matmul/algorithm/base.rs b/crates/cubecl-linalg/src/matmul/kernels/matmul/algorithm/base.rs index 08ced961..aa7c9cf5 100644 --- a/crates/cubecl-linalg/src/matmul/kernels/matmul/algorithm/base.rs +++ b/crates/cubecl-linalg/src/matmul/kernels/matmul/algorithm/base.rs @@ -41,7 +41,7 @@ pub trait Algorithm { fn cube_dim() -> CubeDim; fn cube_count(problem: &MatmulProblem) -> CubeCount; - + #[allow(clippy::type_complexity)] fn make_config( problem: &MatmulProblem, cube_dim: &CubeDim, diff --git a/crates/cubecl-linalg/src/matmul/kernels/matmul/base.rs b/crates/cubecl-linalg/src/matmul/kernels/matmul/base.rs index 68eecea6..a1ef515e 100644 --- a/crates/cubecl-linalg/src/matmul/kernels/matmul/base.rs +++ b/crates/cubecl-linalg/src/matmul/kernels/matmul/base.rs @@ -60,8 +60,8 @@ pub fn launch_ref( MatrixLayout::HighlyPermuted => (true, false), }; - let (lhs_make_contiguous, lhs_transposed) = check_layout(&lhs); - let (rhs_make_contiguous, rhs_transposed) = check_layout(&rhs); + let (lhs_make_contiguous, lhs_transposed) = check_layout(lhs); + let (rhs_make_contiguous, rhs_transposed) = check_layout(rhs); match (lhs_make_contiguous, rhs_make_contiguous) { (false, false) => matmul_cmma_ref_no_check::( diff --git a/crates/cubecl-linalg/src/matmul/kernels/tiling2d/launch.rs b/crates/cubecl-linalg/src/matmul/kernels/tiling2d/launch.rs index d60c33da..d16a98dc 100644 --- a/crates/cubecl-linalg/src/matmul/kernels/tiling2d/launch.rs +++ b/crates/cubecl-linalg/src/matmul/kernels/tiling2d/launch.rs @@ -46,8 +46,8 @@ pub fn matmul_tiling_2d_ref( } => true, MatrixLayout::HighlyPermuted => false, }; - let lhs_correct_layout = check_layout(&lhs); - let rhs_correct_layout = check_layout(&rhs); + let lhs_correct_layout = check_layout(lhs); + let rhs_correct_layout = check_layout(rhs); match (lhs_correct_layout, rhs_correct_layout) { (true, true) => matmul_tiling_2d_ref_no_check::(client, lhs, rhs, out, config), diff --git a/crates/cubecl-linalg/src/matmul/tests/cmma_matmul/matmul_test_launcher.rs b/crates/cubecl-linalg/src/matmul/tests/cmma_matmul/matmul_test_launcher.rs index ac09c64d..2f584726 100644 --- a/crates/cubecl-linalg/src/matmul/tests/cmma_matmul/matmul_test_launcher.rs +++ b/crates/cubecl-linalg/src/matmul/tests/cmma_matmul/matmul_test_launcher.rs @@ -47,7 +47,7 @@ where let cube_dim = A::cube_dim(); let cube_count = A::cube_count(&problem); - let config = A::make_config(&problem, &cube_dim, &cube_count, &A::advanced_config()); + let config = A::make_config(&problem, &cube_dim, &cube_count, &A::advanced_config()).unwrap(); unsafe { A::BatchMatmul::launch_unchecked(