Skip to main content

PoolKind

Enum PoolKind 

Source
#[non_exhaustive]
#[repr(u16)]
pub enum PoolKind {
Show 44 variants MaxPool2d = 0, MaxPool2dBackward = 1, AvgPool2dIncludePad = 2, AvgPool2dIncludePadBackward = 3, AvgPool2dExcludePad = 4, AvgPool2dExcludePadBackward = 5, MaxPool1d = 6, AvgPool1d = 7, MaxPool3d = 8, AvgPool3d = 9, AdaptiveMaxPool = 10, AdaptiveAvgPool = 11, LpPool = 12, FractionalMaxPool = 13, MaxPool1dBackward = 14, AvgPool1dIncludePadBackward = 15, AvgPool1dIncludePad = 16, AvgPool1dExcludePad = 17, AvgPool1dExcludePadBackward = 18, MaxPool3dBackward = 19, AvgPool3dIncludePad = 20, AvgPool3dIncludePadBackward = 21, AvgPool3dExcludePad = 22, AvgPool3dExcludePadBackward = 23, AdaptiveAvgPool1d = 24, AdaptiveAvgPool1dBackward = 25, AdaptiveAvgPool2d = 26, AdaptiveAvgPool2dBackward = 27, AdaptiveAvgPool3d = 28, AdaptiveAvgPool3dBackward = 29, AdaptiveMaxPool1d = 30, AdaptiveMaxPool1dBackward = 31, AdaptiveMaxPool2d = 32, AdaptiveMaxPool2dBackward = 33, AdaptiveMaxPool3d = 34, AdaptiveMaxPool3dBackward = 35, LpPool1d = 36, LpPool2d = 37, FractionalMaxPool2d = 38, FractionalMaxPool3d = 39, LpPool1dBackward = 40, LpPool2dBackward = 41, FractionalMaxPool2dBackward = 42, FractionalMaxPool3dBackward = 43,
}
Expand description

Pooling-family op discriminant — Category J from the comprehensive plan.

Stored as u16 in crate::KernelSku::op when category == OpCategory::Pooling. Each variant maps to a distinct cuDNN pooling exec path (forward / backward) for one of three pooling modes: max, average-include-padding, average-exclude-padding. PyTorch’s nn.MaxPool2d corresponds to Self::MaxPool2d; nn.AvgPool2d defaults to count_include_pad=False which maps to Self::AvgPool2dExcludePad.

Today wired: {MaxPool2d, AvgPool2d} × {f32, f64, f16, bf16} (FW + BW) via cuDNN. 1-D / 3-D pooling, adaptive pooling, LP-pool, and fractional-max-pool are reserved discriminants for fanout milestones.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

MaxPool2d = 0

2-D max-pool forward. PyTorch torch.nn.functional.max_pool2d. Trailblazer for Phase 7 Milestone 7.2.

§

MaxPool2dBackward = 1

2-D max-pool backward (data-gradient). PyTorch’s autograd- internal max_pool2d_with_indices_backward.

§

AvgPool2dIncludePad = 2

2-D average-pool forward, count-include-padding denominator. Matches cuDNN’s *_COUNT_INCLUDE_PADDING mode.

§

AvgPool2dIncludePadBackward = 3

2-D average-pool backward, count-include-padding.

§

AvgPool2dExcludePad = 4

2-D average-pool forward, count-exclude-padding denominator (PyTorch default — nn.AvgPool2d with count_include_pad=False).

§

AvgPool2dExcludePadBackward = 5

2-D average-pool backward, count-exclude-padding.

§

MaxPool1d = 6

1-D max-pool forward (Phase 11.8). NCL layout via cuDNN’s Nd pool descriptor with W = 1.

§

AvgPool1d = 7

1-D average-pool forward. Reserved.

§

MaxPool3d = 8

3-D max-pool forward (Phase 11.8). NCDHW layout via cuDNN’s Nd pool descriptor.

§

AvgPool3d = 9

3-D average-pool forward. Reserved.

§

AdaptiveMaxPool = 10

torch.nn.functional.adaptive_max_pool* — reserved.

§

AdaptiveAvgPool = 11

torch.nn.functional.adaptive_avg_pool* — reserved.

§

LpPool = 12

torch.nn.functional.lp_pool* — reserved.

§

FractionalMaxPool = 13

torch.nn.functional.fractional_max_pool* — reserved.

§

MaxPool1dBackward = 14

1-D max-pool backward.

§

AvgPool1dIncludePadBackward = 15

1-D average-pool backward (count-include-padding).

§

AvgPool1dIncludePad = 16

1-D average-pool forward (count-include-padding).

§

AvgPool1dExcludePad = 17

1-D average-pool forward (count-exclude-padding — PyTorch default).

§

AvgPool1dExcludePadBackward = 18

1-D average-pool backward (count-exclude-padding).

§

MaxPool3dBackward = 19

3-D max-pool backward.

§

AvgPool3dIncludePad = 20

3-D average-pool forward (count-include-padding).

§

AvgPool3dIncludePadBackward = 21

3-D average-pool backward (count-include-padding).

§

AvgPool3dExcludePad = 22

3-D average-pool forward (count-exclude-padding).

§

AvgPool3dExcludePadBackward = 23

3-D average-pool backward (count-exclude-padding).

§

AdaptiveAvgPool1d = 24

Adaptive average-pool 1-D (Phase 11.8 — cuDNN approximation).

§

AdaptiveAvgPool1dBackward = 25

Adaptive average-pool 1-D backward.

§

AdaptiveAvgPool2d = 26

Adaptive average-pool 2-D.

§

AdaptiveAvgPool2dBackward = 27

Adaptive average-pool 2-D backward.

§

AdaptiveAvgPool3d = 28

Adaptive average-pool 3-D.

§

AdaptiveAvgPool3dBackward = 29

Adaptive average-pool 3-D backward.

§

AdaptiveMaxPool1d = 30

Adaptive max-pool 1-D.

§

AdaptiveMaxPool1dBackward = 31

Adaptive max-pool 1-D backward.

§

AdaptiveMaxPool2d = 32

Adaptive max-pool 2-D.

§

AdaptiveMaxPool2dBackward = 33

Adaptive max-pool 2-D backward.

§

AdaptiveMaxPool3d = 34

Adaptive max-pool 3-D.

§

AdaptiveMaxPool3dBackward = 35

Adaptive max-pool 3-D backward.

§

LpPool1d = 36

LP-pool 1-D (Phase 16.2 — bespoke fused kernel: y = (Σ |x|^p)^(1/p) over each pool window in one launch).

§

LpPool2d = 37

LP-pool 2-D (Phase 16.2 — bespoke fused kernel).

§

FractionalMaxPool2d = 38

Fractional max-pool 2-D (Phase 16.3 — bespoke kernel; cuDNN has no fractional-pool primitive).

§

FractionalMaxPool3d = 39

Fractional max-pool 3-D (Phase 16.3 — bespoke kernel).

§

LpPool1dBackward = 40

LP-pool 1-D backward (Phase 16.2 — atomicAdd scatter from each output cell over its source window).

§

LpPool2dBackward = 41

LP-pool 2-D backward (Phase 16.2 — atomicAdd scatter).

§

FractionalMaxPool2dBackward = 42

Fractional max-pool 2-D backward (Phase 16.3 — atomicAdd scatter from each output cell into dx[indices[cell]] via saved argmax). half / bf16 atomicAdd routes through atomicCAS.

§

FractionalMaxPool3dBackward = 43

Fractional max-pool 3-D backward (Phase 16.3 — atomicAdd scatter).

Trait Implementations§

Source§

impl Clone for PoolKind

Source§

fn clone(&self) -> PoolKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PoolKind

Source§

impl Debug for PoolKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for PoolKind

Source§

impl Hash for PoolKind

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for PoolKind

Source§

fn eq(&self, other: &PoolKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for PoolKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.