library:ml: tile the 1x1 convolutions through shared memory
- Commit
78b1f5c119a3446bf7e28cfa266d17aaedda45df- Author
- vayun-mathur <[email protected]>
- When
- 2026-08-28 03:50 UTC (3 months ago)
- Parents
9ea84d2
Diff
library/ml/src/main/rust/shaders/conv_point.comp
diff --git a/library/ml/src/main/rust/shaders/conv_point.comp b/library/ml/src/main/rust/shaders/conv_point.compnew file mode 100644index 0000000000..5bc20fd09a--- /dev/null+++ b/library/ml/src/main/rust/shaders/conv_point.comp@@ -0,0 +1,116 @@+#version 450+//! A `1 x 1` convolution as a tiled matrix multiply, staging weights through shared memory.+//!+//! `out[o][p] = act(sum_i W[o][i] * in[i][p] + bias[o])`, where `p` runs over positions.+//!+//! # Why this exists+//!+//! `conv.comp` gives every output element its own invocation and reads that element's weights+//! straight from global memory, with no reuse between invocations. For a spatial kernel that is+//! survivable: a 3x3 is small and the cache serves it to the many pixels that share it.+//!+//! It is not survivable for a **wide** `1 x 1` over a **short** sequence, which is what every+//! projection in a transformer is. Measured on a Tensor G4: the runtime achieved 15.2 GFLOP/s+//! against a device peak of order 1000, because a 1024-to-1024 projection over 54 positions was+//! moving about 113 MB of weights to do 113 MFLOP of work — every one of the 55,296 output+//! elements re-reading a whole 1024-wide row.+//!+//! # The tiling+//!+//! One workgroup owns a [`TILE`] x [`TILE`] block of the output. It walks the input channels in+//! steps of [`TILE`], staging the weight block and the activation block into shared memory once+//! per step, and every invocation then reads those from shared memory instead of global. A weight+//! element is fetched once per workgroup rather than once per position, so traffic falls by up to+//! `TILE`.+//!+//! There are 64 invocations and `TILE * TILE` outputs in a tile, so each invocation owns a 2 x 2+//! block. That register blocking is what lets a 16-wide tile run in a 64-invocation workgroup, and+//! `local_size_x` is fixed at 64 in `common.glsl` for every shader.+//!+//! # Where it is not used+//!+//! Grouped convolutions, and anything whose kernel is not `1 x 1`. `Builder::conv` routes to this+//! only when both hold; everything else keeps `conv.comp`. The two want opposite memory layouts+//! and one shader serving both would be worse at each.++#include "common.glsl"++/// Output channels and positions per workgroup, and input channels per staging step.+#define TILE 16u++/// The staged blocks. `TILE * TILE` each, so 2 KB of shared memory at fp32.+shared float weight_tile[TILE][TILE];+shared float input_tile[TILE][TILE];++void main() {+ // The tile this workgroup owns. Uniform across the workgroup, so returning early cannot+ // strand a barrier — every invocation takes the same branch.+ uint tile = gl_WorkGroupID.y * gl_NumWorkGroups.x + gl_WorkGroupID.x;+ if (tile >= p.count) {+ return;+ }+ uint positions = p.out_h * p.out_w;+ uint tiles_across = (positions + TILE - 1u) / TILE;+ uint channel_base = (tile / tiles_across) * TILE;+ uint position_base = (tile % tiles_across) * TILE;++ // This invocation's 2 x 2 corner of the tile.+ uint lid = gl_LocalInvocationID.x;+ uint local_row = (lid >> 3u) * 2u;+ uint local_col = (lid & 7u) * 2u;++ float acc[2][2] = { { 0.0, 0.0 }, { 0.0, 0.0 } };++ for (uint k0 = 0u; k0 < p.in_c; k0 += TILE) {+ // Stage both blocks. 256 elements each, 64 invocations, so four apiece. Out-of-range+ // entries are zeroed rather than skipped, which lets the inner loop run unguarded.+ for (uint n = 0u; n < 4u; n++) {+ uint slot = lid + n * 64u;+ uint r = slot >> 4u;+ uint c = slot & 15u;++ uint channel = channel_base + r;+ uint k_weight = k0 + c;+ weight_tile[r][c] = (channel < p.out_c && k_weight < p.in_c)+ ? float(weights[p.weight + channel * p.in_c + k_weight])+ : 0.0;++ uint k_input = k0 + r;+ uint position = position_base + c;+ input_tile[r][c] = (k_input < p.in_c && position < positions)+ ? float(arena[p.in0 + k_input * positions + position])+ : 0.0;+ }+ barrier();++ for (uint k = 0u; k < TILE; k++) {+ float a0 = weight_tile[local_row][k];+ float a1 = weight_tile[local_row + 1u][k];+ float b0 = input_tile[k][local_col];+ float b1 = input_tile[k][local_col + 1u];+ acc[0][0] += a0 * b0;+ acc[0][1] += a0 * b1;+ acc[1][0] += a1 * b0;+ acc[1][1] += a1 * b1;+ }+ // Both barriers are needed: the second stops the next step's staging from overwriting+ // tiles an invocation is still reading.+ barrier();+ }++ for (uint i = 0u; i < 2u; i++) {+ uint channel = channel_base + local_row + i;+ if (channel >= p.out_c) {+ continue;+ }+ float offset = float(weights[p.bias + channel]);+ for (uint j = 0u; j < 2u; j++) {+ uint position = position_base + local_col + j;+ if (position >= positions) {+ continue;+ }+ float value = activate(acc[i][j] + offset, p.act, channel);+ arena[p.out_at + channel * positions + position] = float16_t(value);+ }+ }+}
library/ml/src/main/rust/src/nets/mobilefacenet.rs
diff --git a/library/ml/src/main/rust/src/nets/mobilefacenet.rs b/library/ml/src/main/rust/src/nets/mobilefacenet.rsindex 394276f996..042b72aeb1 100644--- a/library/ml/src/main/rust/src/nets/mobilefacenet.rs+++ b/library/ml/src/main/rust/src/nets/mobilefacenet.rs@@ -204,10 +204,19 @@ mod tests { build(&source).expect("mobilefacenet builds") } + /// Whether two kinds are the same graph operation, folding `Conv`''s tiled lowering in.+ fn same_op(found: Kind, wanted: Kind) -> bool {+ let fold = |k: Kind| if matches!(k, Kind::ConvPoint) { Kind::Conv } else { k };+ fold(found) == fold(wanted)+ }+ fn dispatches(plan: &Plan, kind: Kind) -> usize { plan.ops .iter()- .filter(|op| matches!(op, Op::Dispatch { kind: k, .. } if *k == kind))+ // `ConvPoint` is a lowering of `Conv`, not a different graph op: an ungrouped 1x1+ // goes to the tiled shader. These tests are about what the network contains, so the+ // two are counted as one.+ .filter(|op| matches!(op, Op::Dispatch { kind: k, .. } if same_op(*k, kind))) .count() }
library/ml/src/main/rust/src/nets/mod.rs
diff --git a/library/ml/src/main/rust/src/nets/mod.rs b/library/ml/src/main/rust/src/nets/mod.rsindex 6cd36498e6..45cd819938 100644--- a/library/ml/src/main/rust/src/nets/mod.rs+++ b/library/ml/src/main/rust/src/nets/mod.rs@@ -243,6 +243,16 @@ pub enum Kind { GatedTanh, /// `out[c] = in[C - 1 - c]`, a channel reversal. VITS''s `Flip` between coupling layers. FlipChannels,+ /// A `1 x 1` convolution as a tiled matrix multiply, staging weights through shared memory.+ ///+ /// [`Kind::Conv`] reads each output element''s weights from global memory with no reuse, which+ /// costs nothing for a spatial kernel and everything for a wide `1 x 1` over a short+ /// sequence - measured at 15.2 GFLOP/s on a Tensor G4 against a device peak of order 1000.+ /// This stages a tile of weights once per workgroup instead. `Builder::conv` routes here+ /// automatically for an ungrouped `1 x 1`; see `conv_point.comp`.+ ///+ /// [`Push::count`] is the **tile** count for this kind, not the output element count.+ ConvPoint, /// [`Kind::Conv`] with int8 weights and one per-tensor dequantisation scale. /// /// Only for a network where the weights dominate the download. The scale multiplies the@@ -1399,6 +1409,44 @@ impl<'a> Builder<'a> { transpose, } => { let (si, so) = (shape(*input), shape(*out));+ // An ungrouped 1x1 goes to the tiled path. Its geometry is a matrix multiply+ // over `out_h * out_w` positions, so stride, dilation and padding are all+ // trivially identity and nothing else in the push block changes meaning.+ let tiled = !*transpose+ && *group == 1+ && kernel == &(1, 1)+ && stride == &(1, 1)+ && pad == &(0, 0)+ && si.h == so.h+ && si.w == so.w+ && !matches!(act, Act::PRelu(_));+ if tiled {+ const TILE: u32 = 16;+ let positions = so.h * so.w;+ let tiles = so.c.div_ceil(TILE) * positions.div_ceil(TILE);+ ops.push(Op::Dispatch {+ kind: Kind::ConvPoint,+ push: Push {+ in0: at(*input)?,+ out: at(*out)?,+ weight: *weight,+ bias: *bias,+ in_c: si.c,+ in_h: si.h,+ in_w: si.w,+ out_c: so.c,+ out_h: so.h,+ out_w: so.w,+ act: act.code(),+ // Tiles, not elements: one workgroup per tile.+ count: tiles,+ ..Push::default()+ },+ // 64 invocations a workgroup, so this asks for exactly `tiles` of them.+ invocations: tiles * 64,+ });+ return Ok(());+ } ops.push(Op::Dispatch { kind: if *transpose { Kind::ConvTranspose } else { Kind::Conv }, push: Push {@@ -1978,6 +2026,19 @@ pub(crate) mod tests { } } + /// A dispatch kind''s name, with `Conv`''s tiled lowering folded back into `Conv`.+ ///+ /// The op-inventory tests state what a network contains. Whether an ungrouped `1 x 1` is+ /// served by `conv.comp` or the tiled `conv_point.comp` is a lowering decision that those+ /// tests should not see, and folding it here keeps the assertions readable as counts of+ /// convolutions rather than counts of shaders.+ pub fn name_of(kind: super::Kind) -> String {+ match kind {+ super::Kind::ConvPoint => "Conv".to_string(),+ other => format!("{other:?}"),+ }+ }+ /// Assert that no op reads a region of the arena that it also writes. /// /// Every op reads and writes the same `VkBuffer`, and a convolution invocation reads@@ -2019,6 +2080,8 @@ pub(crate) mod tests { Kind::Embed => vec![(push.in0, push.out_w)], // As `Conv`: the whole input plane, whatever the kernel touches. Kind::ConvInt8 => vec![(push.in0, dense)],+ // count is tiles here, so the read span is the input plane.+ Kind::ConvPoint => vec![(push.in0, dense)], // Twice what it writes: the filter half and the gate half. Kind::GatedTanh => vec![(push.in0, written * 2)], _ => vec![(push.in0, dense)],
library/ml/src/main/rust/src/nets/ppocr_det.rs
diff --git a/library/ml/src/main/rust/src/nets/ppocr_det.rs b/library/ml/src/main/rust/src/nets/ppocr_det.rsindex 5c8c11d3b4..88046217b9 100644--- a/library/ml/src/main/rust/src/nets/ppocr_det.rs+++ b/library/ml/src/main/rust/src/nets/ppocr_det.rs@@ -338,10 +338,19 @@ mod tests { build(&source, 960, 960).expect("ppocr_det builds at 960x960") } + /// Whether two kinds are the same graph operation, folding `Conv`''s tiled lowering in.+ fn same_op(found: Kind, wanted: Kind) -> bool {+ let fold = |k: Kind| if matches!(k, Kind::ConvPoint) { Kind::Conv } else { k };+ fold(found) == fold(wanted)+ }+ fn dispatches(plan: &Plan, kind: Kind) -> usize { plan.ops .iter()- .filter(|op| matches!(op, Op::Dispatch { kind: k, .. } if *k == kind))+ // `ConvPoint` is a lowering of `Conv`, not a different graph op: an ungrouped 1x1+ // goes to the tiled shader. These tests are about what the network contains, so the+ // two are counted as one.+ .filter(|op| matches!(op, Op::Dispatch { kind: k, .. } if same_op(*k, kind))) .count() }
library/ml/src/main/rust/src/nets/ppocr_rec.rs
diff --git a/library/ml/src/main/rust/src/nets/ppocr_rec.rs b/library/ml/src/main/rust/src/nets/ppocr_rec.rsindex 03fe48c194..e274973022 100644--- a/library/ml/src/main/rust/src/nets/ppocr_rec.rs+++ b/library/ml/src/main/rust/src/nets/ppocr_rec.rs@@ -391,7 +391,7 @@ mod tests { let mut copies = 0; for op in &plan.ops { match op {- Op::Dispatch { kind, .. } => *counts.entry(format!("{kind:?}")).or_insert(0) += 1,+ Op::Dispatch { kind, .. } => *counts.entry(super::super::tests::name_of(*kind)).or_insert(0) += 1, Op::Copy { .. } => copies += 1, } }
library/ml/src/main/rust/src/nets/reference.rs
diff --git a/library/ml/src/main/rust/src/nets/reference.rs b/library/ml/src/main/rust/src/nets/reference.rsindex a09785ccdf..e3a760300a 100644--- a/library/ml/src/main/rust/src/nets/reference.rs+++ b/library/ml/src/main/rust/src/nets/reference.rs@@ -194,6 +194,7 @@ impl Reference { // The reference interpreter holds its weights as `f32`, so there is no // byte view to unpack: an int8 plan can be built and inspected on the // host but not run. `scripts/ml/onnx_parity.py` checks it on a device.+ Kind::ConvPoint => self.conv_point(push), Kind::ConvInt8 => Err("int8 convolution has no host reference".into()), Kind::FlipChannels => self.flip_channels(push), },@@ -471,6 +472,30 @@ impl Reference { Ok(()) } + /// `out[o][p] = act(sum_i W[o][i] * in[i][p] + bias[o])`, a `1 x 1` convolution.+ ///+ /// The same arithmetic as [`Self::conv`] at kernel `1 x 1`, written separately because the+ /// device shader tiles it and carries a **tile** count in `push.count` rather than an+ /// element count. Every `1 x 1` in every net module now routes here, so the existing+ /// fixtures cover it.+ fn conv_point(&mut self, p: &Push) -> Result<(), String> {+ let positions = p.out_h * p.out_w;+ for channel in 0..p.out_c {+ let bias = self.weight(p.bias, channel)?;+ for position in 0..positions {+ let mut total = 0.0f32;+ for input in 0..p.in_c {+ total += self.weight(p.weight, channel * p.in_c + input)?+ * self.load(p.in0, input * positions + position)?;+ }+ // `Builder::conv` refuses to route a PRelu here, so the slope is never read.+ let value = activate(total + bias, p.act, 0.0);+ self.store(p.out, channel * positions + position, value)?;+ }+ }+ Ok(())+ }+ /// `out[c] = tanh(in[c]) * sigmoid(in[c + C])`, WaveNet''s gated activation. fn gated_tanh(&mut self, p: &Push) -> Result<(), String> { let gate_at = p.out_c * p.out_h * p.out_w;@@ -2267,8 +2292,11 @@ mod tests { let weights = crate::weights::Weights::parse(&bytes, crate::weights::graph::VITS_ENC) .expect("the encoder asset parses"); let plan = vits_enc::build(&weights, width).expect("vits_enc builds");- let stats = run(&plan, weights.data(), &input).expect("the encoder runs");- write(&dir.join("reference.f32"), &stats);+ // Two outputs since the duration predictor needed the pre-projection hidden state;+ // the probe is the first, the prior''s statistics.+ let outputs = run_multi(&plan, weights.data(), &[&input]).expect("the encoder runs");+ let stats = outputs.first().expect("the statistics output");+ write(&dir.join("reference.f32"), stats); println!("vits_enc at {width} phonemes: wrote {} values", stats.len()); return; }
library/ml/src/main/rust/src/nets/scrfd.rs
diff --git a/library/ml/src/main/rust/src/nets/scrfd.rs b/library/ml/src/main/rust/src/nets/scrfd.rsindex c8e43a88ab..9d74cdddd0 100644--- a/library/ml/src/main/rust/src/nets/scrfd.rs+++ b/library/ml/src/main/rust/src/nets/scrfd.rs@@ -247,10 +247,19 @@ mod tests { build(&source, 640, 640).expect("scrfd builds at 640x640") } + /// Whether two kinds are the same graph operation, folding `Conv`''s tiled lowering in.+ fn same_op(found: Kind, wanted: Kind) -> bool {+ let fold = |k: Kind| if matches!(k, Kind::ConvPoint) { Kind::Conv } else { k };+ fold(found) == fold(wanted)+ }+ fn dispatches(plan: &Plan, kind: Kind) -> usize { plan.ops .iter()- .filter(|op| matches!(op, Op::Dispatch { kind: k, .. } if *k == kind))+ // `ConvPoint` is a lowering of `Conv`, not a different graph op: an ungrouped 1x1+ // goes to the tiled shader. These tests are about what the network contains, so the+ // two are counted as one.+ .filter(|op| matches!(op, Op::Dispatch { kind: k, .. } if same_op(*k, kind))) .count() }
library/ml/src/main/rust/src/nets/selfie.rs
diff --git a/library/ml/src/main/rust/src/nets/selfie.rs b/library/ml/src/main/rust/src/nets/selfie.rsindex 862af3642b..9ea58201eb 100644--- a/library/ml/src/main/rust/src/nets/selfie.rs+++ b/library/ml/src/main/rust/src/nets/selfie.rs@@ -195,10 +195,19 @@ mod tests { build(&source).expect("selfie builds") } + /// Whether two kinds are the same graph operation, folding `Conv`''s tiled lowering in.+ fn same_op(found: Kind, wanted: Kind) -> bool {+ let fold = |k: Kind| if matches!(k, Kind::ConvPoint) { Kind::Conv } else { k };+ fold(found) == fold(wanted)+ }+ fn dispatches(plan: &Plan, kind: Kind) -> usize { plan.ops .iter()- .filter(|op| matches!(op, Op::Dispatch { kind: k, .. } if *k == kind))+ // `ConvPoint` is a lowering of `Conv`, not a different graph op: an ungrouped 1x1+ // goes to the tiled shader. These tests are about what the network contains, so the+ // two are counted as one.+ .filter(|op| matches!(op, Op::Dispatch { kind: k, .. } if same_op(*k, kind))) .count() }
library/ml/src/main/rust/src/nets/u2netp.rs
diff --git a/library/ml/src/main/rust/src/nets/u2netp.rs b/library/ml/src/main/rust/src/nets/u2netp.rsindex e49d7a47d6..62b24d0f63 100644--- a/library/ml/src/main/rust/src/nets/u2netp.rs+++ b/library/ml/src/main/rust/src/nets/u2netp.rs@@ -289,10 +289,19 @@ mod tests { build(&source).expect("u2netp builds") } + /// Whether two kinds are the same graph operation, folding `Conv`''s tiled lowering in.+ fn same_op(found: Kind, wanted: Kind) -> bool {+ let fold = |k: Kind| if matches!(k, Kind::ConvPoint) { Kind::Conv } else { k };+ fold(found) == fold(wanted)+ }+ fn dispatches(plan: &Plan, kind: Kind) -> usize { plan.ops .iter()- .filter(|op| matches!(op, Op::Dispatch { kind: k, .. } if *k == kind))+ // `ConvPoint` is a lowering of `Conv`, not a different graph op: an ungrouped 1x1+ // goes to the tiled shader. These tests are about what the network contains, so the+ // two are counted as one.+ .filter(|op| matches!(op, Op::Dispatch { kind: k, .. } if same_op(*k, kind))) .count() }
library/ml/src/main/rust/src/nets/vits_dec.rs
diff --git a/library/ml/src/main/rust/src/nets/vits_dec.rs b/library/ml/src/main/rust/src/nets/vits_dec.rsindex 7bb55861fb..ce697ddad9 100644--- a/library/ml/src/main/rust/src/nets/vits_dec.rs+++ b/library/ml/src/main/rust/src/nets/vits_dec.rs@@ -281,7 +281,7 @@ mod tests { let mut counts = std::collections::BTreeMap::new(); for op in &plan.ops { if let Op::Dispatch { kind, .. } = op {- *counts.entry(format!("{kind:?}")).or_insert(0) += 1;+ *counts.entry(super::super::tests::name_of(*kind)).or_insert(0) += 1; } } // 19 convolutions: `conv_pre`, 18 in the residual blocks, and `conv_post`. That is
library/ml/src/main/rust/src/nets/vits_enc.rs
diff --git a/library/ml/src/main/rust/src/nets/vits_enc.rs b/library/ml/src/main/rust/src/nets/vits_enc.rsindex 632c61a12c..7f690fb924 100644--- a/library/ml/src/main/rust/src/nets/vits_enc.rs+++ b/library/ml/src/main/rust/src/nets/vits_enc.rs@@ -224,7 +224,7 @@ mod tests { let mut counts = std::collections::BTreeMap::new(); for op in &plan.ops { if let Op::Dispatch { kind, .. } = op {- *counts.entry(format!("{kind:?}")).or_insert(0) += 1;+ *counts.entry(super::super::tests::name_of(*kind)).or_insert(0) += 1; } } // Four projections and two feed-forward convolutions per layer, plus the output
library/ml/src/main/rust/src/nets/vits_flow.rs
diff --git a/library/ml/src/main/rust/src/nets/vits_flow.rs b/library/ml/src/main/rust/src/nets/vits_flow.rsindex a34d5390f9..c134e5e63b 100644--- a/library/ml/src/main/rust/src/nets/vits_flow.rs+++ b/library/ml/src/main/rust/src/nets/vits_flow.rs@@ -215,7 +215,7 @@ mod tests { let mut counts = std::collections::BTreeMap::new(); for op in &plan.ops { if let Op::Dispatch { kind, .. } = op {- *counts.entry(format!("{kind:?}")).or_insert(0) += 1;+ *counts.entry(super::super::tests::name_of(*kind)).or_insert(0) += 1; } } assert_eq!(counts.get("Conv"), Some(&40), "{counts:?}");
library/ml/src/main/rust/src/vulkan/pipeline.rs
diff --git a/library/ml/src/main/rust/src/vulkan/pipeline.rs b/library/ml/src/main/rust/src/vulkan/pipeline.rsindex ce61391bdd..5fdcaee509 100644--- a/library/ml/src/main/rust/src/vulkan/pipeline.rs+++ b/library/ml/src/main/rust/src/vulkan/pipeline.rs@@ -47,12 +47,13 @@ const ATTN_APPLY_RELATIVE: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/attn_apply_relative.comp.spv")); const EMBED: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/embed.comp.spv")); const GATED_TANH: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/gated_tanh.comp.spv"));+const CONV_POINT: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/conv_point.comp.spv")); const CONV_INT8: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/conv_int8.comp.spv")); const FLIP_CHANNELS: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/flip_channels.comp.spv")); /// Every shader, in the order [`Pipelines::create`] destructures them.-const SPIRV: [&[u8]; 21] = [+const SPIRV: [&[u8]; 22] = [ CONV, CONV_TRANSPOSE, MAXPOOL,@@ -74,6 +75,7 @@ const SPIRV: [&[u8]; 21] = [ GATED_TANH, FLIP_CHANNELS, CONV_INT8,+ CONV_POINT, ]; /// `local_size_x` in `shaders/common.glsl`. A dispatch covers `ceil(invocations / this)`@@ -118,6 +120,7 @@ pub struct Pipelines { gated_tanh: vk::Pipeline, flip_channels: vk::Pipeline, conv_int8: vk::Pipeline,+ conv_point: vk::Pipeline, } impl Pipelines {@@ -275,6 +278,7 @@ impl Pipelines { gated_tanh, flip_channels, conv_int8,+ conv_point, ] = match <[vk::Pipeline; SPIRV.len()]>::try_from(built) { Ok(all) => all, Err(built) => {@@ -312,6 +316,7 @@ impl Pipelines { gated_tanh, flip_channels, conv_int8,+ conv_point, }) } @@ -339,6 +344,7 @@ impl Pipelines { Kind::GatedTanh => self.gated_tanh, Kind::FlipChannels => self.flip_channels, Kind::ConvInt8 => self.conv_int8,+ Kind::ConvPoint => self.conv_point, } } @@ -368,6 +374,7 @@ impl Pipelines { self.gated_tanh, self.flip_channels, self.conv_int8,+ self.conv_point, ] { device.destroy_pipeline(pipeline, None); }