Skip to content

Commit

Permalink
Matmul: kernel select heuristic (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
louisfd authored Nov 27, 2024
1 parent e3f442a commit 630f1e7
Show file tree
Hide file tree
Showing 12 changed files with 524 additions and 403 deletions.
6 changes: 4 additions & 2 deletions crates/cubecl-linalg/src/matmul/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ pub fn launch_ref<R: Runtime, EG: Float>(
out: TensorHandleRef<R>,
) {
match strategy {
Strategy::Accelerated => matmul::launch_ref::<R, EG>(client, lhs, rhs, out, false),
Strategy::PlaneMma => matmul::launch_ref::<R, EG>(client, lhs, rhs, out, true),
Strategy::Accelerated => matmul::launch_ref::<R, EG>(client, lhs, rhs, out, false)
.expect("Accelerated strategy should be available on your device"),
Strategy::PlaneMma => matmul::launch_ref::<R, EG>(client, lhs, rhs, out, true)
.expect("PlaneMma strategy should be available on your device"),
Strategy::CmmaOld(config) => {
cmma_old::launch_ref::<R, EG>(client, lhs, rhs, out, config.clone())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,8 @@ pub trait Algorithm<EG: Numeric> {
) -> Result<(), &str> {
Self::BatchMatmul::check_availability::<R>(client)
}

fn advanced_config() -> AdvancedConfig {
AdvancedConfig::default()
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
mod base;
mod selection;
mod selector;

pub mod cmma;
pub mod plane_mma;
pub mod standard;

pub use base::Algorithm;
pub use selection::*;
pub use selector::*;

This file was deleted.

This file was deleted.

Loading

0 comments on commit 630f1e7

Please sign in to comment.