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


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

torch::Tensor chunked_conv_activation_cuda(
    torch::Tensor input,
    torch::Tensor weight,
    torch::Tensor bias,
    torch::Tensor addition);
"""

_cuda_source = r"""
#include <torch/extension.h>
#include <ATen/ops/conv3d.h>
#include <c10/cuda/CUDAGuard.h>
#include <c10/cuda/CUDAStream.h>
#include <c10/cuda/CUDAException.h>
#include <cuda_runtime.h>
#include <algorithm>
#include <cstdint>

__device__ __forceinline__ float activate(
    float x, float bias, float addition
) {
    x = __fadd_rn(x, bias);
    x = x > 0.0f ? x : __fmul_rn(0.2f, x);
    x = __fadd_rn(x, addition);
    x = x < -1.0f ? -1.0f : x;
    x = x >  1.0f ?  1.0f : x;

    const float z = x * x;
    float p = -1.0f / 9676800.0f;
    p = fmaf(p, z,  1.0f / 599040.0f);
    p = fmaf(p, z, -1.0f / 42240.0f);
    p = fmaf(p, z,  1.0f / 3456.0f);
    p = fmaf(p, z, -1.0f / 336.0f);
    p = fmaf(p, z,  1.0f / 40.0f);
    p = fmaf(p, z, -1.0f / 6.0f);
    p = fmaf(p, z,  1.0f);
    return fmaf(0.3989422804014327f * z, p, 0.5f * x);
}

template<int CHANNELS>
__global__ void activation_vector_kernel(
    const float4* __restrict__ input,
    float4* __restrict__ output,
    const float4* __restrict__ bias,
    const float4* __restrict__ addition,
    int64_t vectors,
    int channels4
) {
    const int64_t step = int64_t(blockDim.x) * gridDim.x;
    int64_t i = int64_t(blockIdx.x) * blockDim.x + threadIdx.x;

    if (CHANNELS == 64) {
        const int c = threadIdx.x & 15;
        const float4 b = bias[c];
        const float4 a = addition[c];

        for (; i < vectors; i += step) {
            const float4 v = input[i];
            output[i] = make_float4(
                activate(v.x, b.x, a.x),
                activate(v.y, b.y, a.y),
                activate(v.z, b.z, a.z),
                activate(v.w, b.w, a.w));
        }
    } else {
        for (; i < vectors; i += step) {
            const int c = i % channels4;
            const float4 b = bias[c];
            const float4 a = addition[c];
            const float4 v = input[i];
            output[i] = make_float4(
                activate(v.x, b.x, a.x),
                activate(v.y, b.y, a.y),
                activate(v.z, b.z, a.z),
                activate(v.w, b.w, a.w));
        }
    }
}

__global__ void activation_scalar_kernel(
    const float* __restrict__ input,
    float* __restrict__ output,
    const float* __restrict__ bias,
    const float* __restrict__ addition,
    int64_t count,
    int channels
) {
    const int64_t step = int64_t(blockDim.x) * gridDim.x;
    for (int64_t i = int64_t(blockIdx.x) * blockDim.x + threadIdx.x;
         i < count; i += step) {
        const int c = i % channels;
        output[i] = activate(input[i], bias[c], addition[c]);
    }
}

torch::Tensor chunked_conv_activation_cuda(
    torch::Tensor input,
    torch::Tensor weight,
    torch::Tensor bias,
    torch::Tensor addition
) {
    TORCH_CHECK(input.is_cuda() && weight.is_cuda() &&
                bias.is_cuda() && addition.is_cuda(),
                "Expected CUDA tensors");
    TORCH_CHECK(input.device() == weight.device() &&
                input.device() == bias.device() &&
                input.device() == addition.device(),
                "Device mismatch");
    TORCH_CHECK(input.scalar_type() == at::kFloat &&
                weight.scalar_type() == at::kFloat &&
                bias.scalar_type() == at::kFloat &&
                addition.scalar_type() == at::kFloat,
                "Expected float32 tensors");
    TORCH_CHECK(input.dim() == 5 && weight.dim() == 5,
                "Expected five-dimensional input and weight");
    TORCH_CHECK(input.size(1) == weight.size(1),
                "Input channel mismatch");

    const c10::cuda::CUDAGuard guard(input.device());
    const cudaStream_t stream =
        c10::cuda::getCurrentCUDAStream(input.get_device()).stream();

    const int64_t batch = input.size(0);
    const int channels = static_cast<int>(weight.size(0));
    const int64_t depth = input.size(2) - weight.size(2) + 1;
    const int64_t height = input.size(3) - weight.size(3) + 1;
    const int64_t width = input.size(4) - weight.size(4) + 1;

    TORCH_CHECK(depth > 0 && height > 0 && width > 0,
                "Kernel exceeds input dimensions");
    TORCH_CHECK(bias.numel() == channels &&
                addition.numel() == channels,
                "Expected one bias and addition value per channel");

    auto output = torch::empty(
        {batch, channels, depth, height, width},
        input.options().memory_format(at::MemoryFormat::ChannelsLast3d));

    if (batch == 0) return output;

    weight = weight.contiguous(at::MemoryFormat::ChannelsLast3d);
    bias = bias.contiguous();
    addition = addition.contiguous();

    const int64_t elements_per_sample =
        int64_t(channels) * depth * height * width;

    // Keep each convolution intermediate small enough for substantial
    // cache reuse by the immediately following activation kernel.
    constexpr int64_t target_bytes = 28LL * 1024 * 1024;
    const int64_t chunk_size = std::min<int64_t>(
        batch,
        std::max<int64_t>(
            1, std::min<int64_t>(
                16, target_bytes / (elements_per_sample * sizeof(float)))));

    const std::vector<int64_t> stride{1, 1, 1};
    const std::vector<int64_t> padding{0, 0, 0};
    const std::vector<int64_t> dilation{1, 1, 1};
    const c10::optional<at::Tensor> no_bias = c10::nullopt;

    constexpr int threads = 256;

    for (int64_t first = 0; first < batch; first += chunk_size) {
        const int64_t size = std::min<int64_t>(chunk_size, batch - first);

        auto chunk = input.narrow(0, first, size).contiguous(
            at::MemoryFormat::ChannelsLast3d);
        auto convolved = at::conv3d(
            chunk, weight, no_bias, stride, padding, dilation, 1);
        convolved = convolved.contiguous(
            at::MemoryFormat::ChannelsLast3d);

        const int64_t count = size * elements_per_sample;
        float* destination =
            output.data_ptr<float>() + first * elements_per_sample;

        const bool vectorized =
            channels % 4 == 0 &&
            reinterpret_cast<uintptr_t>(convolved.data_ptr<float>()) % 16 == 0 &&
            reinterpret_cast<uintptr_t>(destination) % 16 == 0 &&
            reinterpret_cast<uintptr_t>(bias.data_ptr<float>()) % 16 == 0 &&
            reinterpret_cast<uintptr_t>(addition.data_ptr<float>()) % 16 == 0;

        const int64_t work = vectorized ? count / 4 : count;
        const int blocks = static_cast<int>(
            std::min<int64_t>((work + threads - 1) / threads, 2048));

        if (vectorized) {
            const auto source =
                reinterpret_cast<const float4*>(convolved.data_ptr<float>());
            auto dest = reinterpret_cast<float4*>(destination);
            const auto b =
                reinterpret_cast<const float4*>(bias.data_ptr<float>());
            const auto a =
                reinterpret_cast<const float4*>(addition.data_ptr<float>());

            if (channels == 64) {
                activation_vector_kernel<64>
                    <<<blocks, threads, 0, stream>>>(
                        source, dest, b, a, work, channels / 4);
            } else {
                activation_vector_kernel<0>
                    <<<blocks, threads, 0, stream>>>(
                        source, dest, b, a, work, channels / 4);
            }
        } else {
            activation_scalar_kernel<<<blocks, threads, 0, stream>>>(
                convolved.data_ptr<float>(), destination,
                bias.data_ptr<float>(), addition.data_ptr<float>(),
                count, channels);
        }
        C10_CUDA_KERNEL_LAUNCH_CHECK();
    }

    return output;
}
"""

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


class ModelNew(nn.Module):
    def __init__(self, in_channels, out_channels, kernel_size, sum_tensor_shape):
        super().__init__()
        self.conv = nn.Conv3d(in_channels, out_channels, kernel_size)
        self.sum_tensor = nn.Parameter(torch.randn(sum_tensor_shape))
        self.conv.to(memory_format=torch.channels_last_3d)

    def forward(self, x):
        use_custom = (
            x.is_cuda
            and x.dtype == torch.float32
            and self.conv.weight.dtype == torch.float32
            and self.conv.bias is not None
            and self.conv.bias.dtype == torch.float32
            and self.sum_tensor.dtype == torch.float32
            and tuple(self.sum_tensor.shape)
            == (self.conv.out_channels, 1, 1, 1)
            and not torch.is_autocast_enabled()
        )

        if use_custom:
            return _fused_ops.chunked_conv_activation_cuda(
                x, self.conv.weight, self.conv.bias, self.sum_tensor
            )

        x = self.conv(x)
        x = F.leaky_relu(x, negative_slope=0.2)
        x = torch.clamp(x + self.sum_tensor, min=-1.0, max=1.0)
        return F.gelu(x)
```