-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move conv autotune under feature flag (except key) (#2330)
- Loading branch information
Showing
6 changed files
with
58 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
use cubecl::AutotuneKey; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Hash, Eq, PartialEq, Debug, Clone, Serialize, Deserialize, AutotuneKey)] | ||
/// Autotune key representative of matmul versions | ||
pub struct Conv2dAutotuneKey { | ||
pub kernel_size: [usize; 2], | ||
pub stride: [usize; 2], | ||
pub padding: [usize; 2], | ||
pub dilation: [usize; 2], | ||
pub groups: usize, | ||
#[autotune(anchor)] | ||
pub in_channels: usize, | ||
#[autotune(anchor)] | ||
pub out_channels: usize, | ||
#[autotune(anchor)] | ||
pub height: usize, | ||
#[autotune(anchor)] | ||
pub width: usize, | ||
#[autotune(anchor)] | ||
pub batch_size: usize, | ||
pub has_bias: bool, | ||
} | ||
|
||
#[derive(Hash, Eq, PartialEq, Debug, Clone, Serialize, Deserialize, AutotuneKey)] | ||
/// Autotune key representative of matmul versions | ||
pub struct ConvTranspose2dAutotuneKey { | ||
pub kernel_size: [usize; 2], | ||
pub stride: [usize; 2], | ||
pub padding: [usize; 2], | ||
pub padding_out: [usize; 2], | ||
pub dilation: [usize; 2], | ||
pub groups: usize, | ||
#[autotune(anchor)] | ||
pub in_channels: usize, | ||
#[autotune(anchor)] | ||
pub out_channels: usize, | ||
#[autotune(anchor)] | ||
pub height: usize, | ||
#[autotune(anchor)] | ||
pub width: usize, | ||
#[autotune(anchor)] | ||
pub batch_size: usize, | ||
pub has_bias: bool, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
#[cfg(feature = "autotune")] | ||
mod conv2d; | ||
#[cfg(feature = "autotune")] | ||
mod conv_transpose2d; | ||
|
||
#[cfg(feature = "autotune")] | ||
pub use conv2d::*; | ||
#[cfg(feature = "autotune")] | ||
pub use conv_transpose2d::*; | ||
|
||
mod key; | ||
pub use key::*; |