```python
import torch
import torch.nn as nn
from torch.utils.cpp_extension import load_inline


_cpp_source = """
#include <torch/extension.h>

torch::Tensor fused_pool_sum_cuda(torch::Tensor x);
"""

_cuda_source = r"""
#include <torch/extension.h>
#include <ATen/AccumulateType.h>
#include <ATen/cuda/CUDAContext.h>
#include <c10/cuda/CUDAGuard.h>
#include <c10/cuda/CUDAException.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <cmath>

template <typename T>
__device__ __forceinline__ T nan_max(T a, T b) {
    return isnan(a) ? a : (a > b ? a : b);
}

template <typename scalar_t>
__global__ void fused_pool_sum_kernel(
    const scalar_t* __restrict__ x,
    scalar_t* __restrict__ out,
    int channels,
    int depth,
    int height,
    int width,
    int out_depth,
    int out_height,
    int out_width,
    int64_t output_count
) {
    using acc_t = at::acc_type<scalar_t, true>;

    constexpr int WARPS = 8;
    const int lane = threadIdx.x & 31;
    const int warp = threadIdx.x >> 5;
    __shared__ acc_t channel_sums[WARPS];

    for (int64_t index = blockIdx.x;
         index < output_count;
         index += gridDim.x) {
        int64_t position = index;
        const int ow = position % out_width;
        position /= out_width;
        const int oh = position % out_height;
        position /= out_height;
        const int od = position % out_depth;
        const int64_t batch = position / out_depth;

        const int64_t channel_stride =
            static_cast<int64_t>(depth) * height * width;
        const int64_t spatial_start =
            (static_cast<int64_t>(od * 6) * height + oh * 6) * width
            + ow * 6;

        acc_t channel_sum = acc_t(0);

        for (int channel = warp; channel < channels; channel += WARPS) {
            const scalar_t* base =
                x + (batch * channels + channel) * channel_stride
                  + spatial_start;

            acc_t maximum = -static_cast<acc_t>(INFINITY);

            // MaxPool3d(2), followed by MaxPool3d(3), is exactly
            // a maximum over a 6 x 6 x 6 region with stride 6.
            #pragma unroll
            for (int step = 0; step < 7; ++step) {
                const int q = lane + step * 32;
                if (q < 216) {
                    const int dz = q / 36;
                    const int dy = (q / 6) % 6;
                    const int dx = q % 6;
                    const int64_t offset =
                        (static_cast<int64_t>(dz) * height + dy) * width
                        + dx;
                    maximum = nan_max(
                        maximum, static_cast<acc_t>(base[offset]));
                }
            }

            #pragma unroll
            for (int offset = 16; offset > 0; offset >>= 1) {
                maximum = nan_max(
                    maximum,
                    __shfl_down_sync(0xffffffff, maximum, offset));
            }

            if (lane == 0) {
                channel_sum += maximum;
            }
        }

        if (lane == 0) {
            channel_sums[warp] = channel_sum;
        }
        __syncthreads();

        if (warp == 0) {
            acc_t total = lane < WARPS ? channel_sums[lane] : acc_t(0);

            #pragma unroll
            for (int offset = 16; offset > 0; offset >>= 1) {
                total += __shfl_down_sync(0xffffffff, total, offset);
            }

            if (lane == 0) {
                out[index] = static_cast<scalar_t>(total);
            }
        }
        __syncthreads();
    }
}

torch::Tensor fused_pool_sum_cuda(torch::Tensor x) {
    TORCH_CHECK(x.is_cuda(), "Expected a CUDA tensor");
    TORCH_CHECK(x.dim() == 5, "Expected an NCDHW tensor");
    TORCH_CHECK(x.is_contiguous(), "Expected contiguous NCDHW storage");
    TORCH_CHECK(
        x.size(2) >= 6 && x.size(3) >= 6 && x.size(4) >= 6,
        "Spatial dimensions must be at least 6");

    const c10::cuda::CUDAGuard device_guard(x.device());

    const int channels = static_cast<int>(x.size(1));
    const int depth = static_cast<int>(x.size(2));
    const int height = static_cast<int>(x.size(3));
    const int width = static_cast<int>(x.size(4));
    const int out_depth = depth / 6;
    const int out_height = height / 6;
    const int out_width = width / 6;

    auto out = torch::empty(
        {x.size(0), 1, out_depth, out_height, out_width},
        x.options());

    const int64_t output_count = out.numel();
    if (output_count == 0) {
        return out;
    }

    const int blocks = static_cast<int>(
        output_count < 65535 ? output_count : 65535);
    const auto stream = at::cuda::getCurrentCUDAStream();

    AT_DISPATCH_FLOATING_TYPES_AND2(
        at::ScalarType::Half,
        at::ScalarType::BFloat16,
        x.scalar_type(),
        "fused_pool_sum_cuda",
        [&] {
            fused_pool_sum_kernel<scalar_t>
                <<<blocks, 256, 0, stream>>>(
                    x.data_ptr<scalar_t>(),
                    out.data_ptr<scalar_t>(),
                    channels,
                    depth,
                    height,
                    width,
                    out_depth,
                    out_height,
                    out_width,
                    output_count);
        });

    C10_CUDA_KERNEL_LAUNCH_CHECK();
    return out;
}
"""

_fused_ops = load_inline(
    name="convtranspose3d_fused_pool6_channel_sum",
    cpp_sources=_cpp_source,
    cuda_sources=_cuda_source,
    functions=["fused_pool_sum_cuda"],
    extra_cflags=["-O3"],
    extra_cuda_cflags=["-O3"],
    verbose=False,
)


class ModelNew(nn.Module):
    def __init__(
        self, in_channels, out_channels, kernel_size, stride, padding
    ):
        super().__init__()
        self.conv_transpose = nn.ConvTranspose3d(
            in_channels,
            out_channels,
            kernel_size,
            stride=stride,
            padding=padding,
        )
        self.max_pool1 = nn.MaxPool3d(kernel_size=2)
        self.max_pool2 = nn.MaxPool3d(kernel_size=3)

    def forward(self, x):
        x = self.conv_transpose(x)
        if not x.is_cuda:
            return self.max_pool2(self.max_pool1(x)).sum(
                dim=1, keepdim=True
            )
        return _fused_ops.fused_pool_sum_cuda(x.contiguous())
```