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


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

torch::Tensor fused_pool_softmax_swish_max(
    torch::Tensor input,
    torch::Tensor subtract);
"""

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

__global__ void fused_kernel(
    const float* __restrict__ input,
    const float* __restrict__ subtract,
    float* __restrict__ output,
    int depth,
    int height,
    int width,
    int out_depth,
    int out_height,
    int out_width,
    int64_t count)
{
    const int64_t index =
        static_cast<int64_t>(blockIdx.x) * blockDim.x + threadIdx.x;
    if (index >= count) return;

    const int64_t output_volume =
        static_cast<int64_t>(out_depth) * out_height * out_width;
    const int batch = index / output_volume;
    const int spatial = index % output_volume;

    const int ow = spatial % out_width;
    const int oh = (spatial / out_width) % out_height;
    const int od = spatial / (out_width * out_height);

    const int64_t plane = static_cast<int64_t>(height) * width;
    const int64_t volume = static_cast<int64_t>(depth) * plane;
    const int64_t base =
        static_cast<int64_t>(batch) * 16 * volume +
        static_cast<int64_t>(2 * od) * plane +
        static_cast<int64_t>(2 * oh) * width + 2 * ow;

    float values[16];
    float maximum = -CUDART_INF_F;

    #pragma unroll
    for (int channel = 0; channel < 16; ++channel) {
        const float* p = input + base + channel * volume;
        float pooled = -CUDART_INF_F;

        #pragma unroll
        for (int dz = 0; dz < 2; ++dz) {
            #pragma unroll
            for (int dy = 0; dy < 2; ++dy) {
                #pragma unroll
                for (int dx = 0; dx < 2; ++dx) {
                    const float value = p[dz * plane + dy * width + dx];
                    if (isnan(value) || value > pooled) {
                        pooled = value;
                    }
                }
            }
        }

        values[channel] = pooled;
        if (isnan(pooled) || pooled > maximum) {
            maximum = pooled;
        }
    }

    float denominator = 0.0f;
    #pragma unroll
    for (int channel = 0; channel < 16; ++channel) {
        values[channel] = __expf(values[channel] - maximum);
        denominator += values[channel];
    }

    const float inverse_denominator = 1.0f / denominator;
    float result = -CUDART_INF_F;

    #pragma unroll
    for (int channel = 0; channel < 16; ++channel) {
        const float shifted =
            values[channel] * inverse_denominator - subtract[channel];
        const float sigmoid = 1.0f / (1.0f + __expf(-shifted));
        const float activated = shifted * sigmoid;

        if (isnan(activated) || activated > result) {
            result = activated;
        }
    }

    output[index] = result;
}

torch::Tensor fused_pool_softmax_swish_max(
    torch::Tensor input,
    torch::Tensor subtract)
{
    TORCH_CHECK(input.is_cuda(), "input must be a CUDA tensor");
    TORCH_CHECK(subtract.device() == input.device(),
                "input and subtract must be on the same device");
    TORCH_CHECK(input.scalar_type() == at::kFloat &&
                subtract.scalar_type() == at::kFloat,
                "expected float32 tensors");
    TORCH_CHECK(input.is_contiguous() && subtract.is_contiguous(),
                "expected contiguous tensors");
    TORCH_CHECK(input.dim() == 5 && input.size(1) == 16,
                "expected NCDHW input with 16 channels");
    TORCH_CHECK(subtract.numel() == 16, "expected 16 subtraction values");
    TORCH_CHECK(input.size(2) >= 2 &&
                input.size(3) >= 2 &&
                input.size(4) >= 2,
                "spatial dimensions must be at least 2");

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

    const int depth = input.size(2);
    const int height = input.size(3);
    const int width = input.size(4);
    const int out_depth = depth / 2;
    const int out_height = height / 2;
    const int out_width = width / 2;

    auto output = torch::empty(
        {input.size(0), out_depth, out_height, out_width},
        input.options());

    const int64_t count = output.numel();
    if (count > 0) {
        constexpr int threads = 256;
        const int blocks = static_cast<int>((count + threads - 1) / threads);

        fused_kernel<<<blocks, threads, 0,
            at::cuda::getCurrentCUDAStream()>>>(
                input.data_ptr<float>(),
                subtract.data_ptr<float>(),
                output.data_ptr<float>(),
                depth, height, width,
                out_depth, out_height, out_width,
                count);

        C10_CUDA_KERNEL_LAUNCH_CHECK();
    }

    return output;
}
"""

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


def _triple(value):
    if isinstance(value, int):
        return (value, value, value)
    return tuple(value)


class ModelNew(nn.Module):
    def __init__(
        self,
        in_channels,
        out_channels,
        kernel_size,
        stride,
        padding,
        output_padding,
        pool_kernel_size,
        pool_stride,
        pool_padding,
    ):
        super().__init__()
        self.conv_transpose = nn.ConvTranspose3d(
            in_channels,
            out_channels,
            kernel_size,
            stride=stride,
            padding=padding,
            output_padding=output_padding,
        )
        self.max_pool = nn.MaxPool3d(
            kernel_size=pool_kernel_size,
            stride=pool_stride,
            padding=pool_padding,
        )
        self.subtract = nn.Parameter(torch.randn(out_channels))

        effective_pool_stride = (
            pool_kernel_size if pool_stride is None else pool_stride
        )
        self._use_fused = (
            out_channels == 16
            and _triple(pool_kernel_size) == (2, 2, 2)
            and _triple(effective_pool_stride) == (2, 2, 2)
            and _triple(pool_padding) == (0, 0, 0)
        )

    def forward(self, x):
        x = self.conv_transpose(x)

        if (
            self._use_fused
            and x.is_cuda
            and x.dtype == torch.float32
            and self.subtract.dtype == torch.float32
        ):
            return _fused_ops.fused_pool_softmax_swish_max(
                x.contiguous(), self.subtract.contiguous()
            )

        x = self.max_pool(x)
        x = torch.softmax(x, dim=1)
        x = x - self.subtract.view(1, -1, 1, 1, 1)
        x = torch.sigmoid(x) * x
        return torch.max(x, dim=1)[0]
```