You write custom CUDA kernels to replace the pytorch operators in the given architecture to get speedups. 

    You have complete freedom to choose the set of operators you want to replace. You may make the decision to replace some operators with custom CUDA kernels and leave others unchanged. You may replace multiple operators with custom implementations, consider operator fusion opportunities (combining multiple operators into a single kernel, for example, combining matmul+relu), or algorithmic changes (such as online softmax). You are only limited by your imagination.


        Here's an example to show you the syntax of inline embedding custom CUDA operators in torch: The example given architecture is: 

        ``` 

        # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.

import torch
import torch.nn as nn
import torch.nn.functional as F


class Model(nn.Module):
    def __init__(self) -> None:
        super().__init__()

    def forward(self, a, b):
        return a + b


def get_inputs():
    # randomly generate input tensors based on the model architecture
    a = torch.randn(1, 128).cuda()
    b = torch.randn(1, 128).cuda()
    return [a, b]


def get_init_inputs():
    # randomly generate tensors required for initialization based on the model architecture
    return []

        ``` 

        The example new arch with custom CUDA kernels looks like this:
        ```
        # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.

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

# Define the custom CUDA kernel for element-wise addition
elementwise_add_source = """
#include <torch/extension.h>
#include <cuda_runtime.h>

__global__ void elementwise_add_kernel(const float* a, const float* b, float* out, int size) {
    int idx = blockIdx.x * blockDim.x + threadIdx.x;
    if (idx < size) {
        out[idx] = a[idx] + b[idx];
    }
}

torch::Tensor elementwise_add_cuda(torch::Tensor a, torch::Tensor b) {
    auto size = a.numel();
    auto out = torch::zeros_like(a);

    const int block_size = 256;
    const int num_blocks = (size + block_size - 1) / block_size;

    elementwise_add_kernel<<<num_blocks, block_size>>>(a.data_ptr<float>(), b.data_ptr<float>(), out.data_ptr<float>(), size);

    return out;
}
"""

elementwise_add_cpp_source = (
    "torch::Tensor elementwise_add_cuda(torch::Tensor a, torch::Tensor b);"
)

# Compile the inline CUDA code for element-wise addition
elementwise_add = load_inline(
    name="elementwise_add",
    cpp_sources=elementwise_add_cpp_source,
    cuda_sources=elementwise_add_source,
    functions=["elementwise_add_cuda"],
    verbose=True,
    extra_cflags=[""],
    extra_ldflags=[""],
)


class ModelNew(nn.Module):
    def __init__(self) -> None:
        super().__init__()
        self.elementwise_add = elementwise_add

    def forward(self, a, b):
        return self.elementwise_add.elementwise_add_cuda(a, b)

        ``` 

        
    You are given the following architecture: 

    ```
    # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.

import torch
import torch.nn as nn

class Model(nn.Module):
    """
    Model that performs a GEMM, GroupNorm, Swish, Multiply, and Swish operations.
    """
    def __init__(self, in_features, out_features, num_groups, multiply_weight_shape):
        super(Model, self).__init__()
        self.gemm = nn.Linear(in_features, out_features)
        self.group_norm = nn.GroupNorm(num_groups, out_features)
        self.multiply_weight = nn.Parameter(torch.randn(multiply_weight_shape)) 

    def forward(self, x):
        # (batch_size, in_features) -> (batch_size, out_features)
        x = self.gemm(x)
        # (batch_size, out_features) -> (batch_size, out_features)
        x = self.group_norm(x)
        # (batch_size, out_features) -> (batch_size, out_features)
        x = x * torch.sigmoid(x)
        # (batch_size, out_features) -> (batch_size, out_features)
        x = x * self.multiply_weight
        # (batch_size, out_features) -> (batch_size, out_features)
        x = x * torch.sigmoid(x)
        return x

batch_size = 1024
in_features = 8192
out_features = 8192
num_groups = 256
multiply_weight_shape = (out_features,)

def get_inputs():
    return [torch.rand(batch_size, in_features)]

def get_init_inputs():
    return [in_features, out_features, num_groups, multiply_weight_shape]
    ```
    
Optimize the architecture named Model with custom CUDA operators! Name your optimized output architecture ModelNew. Output the new code in codeblocks. Please generate real code, NOT pseudocode, make sure the code compiles and is fully functional. Just output the new model code, no other text, and NO testing code! 



This is turn 6 of 6 for this task. Your previous solution (turn 5) was:
```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_forward_cuda(
    torch::Tensor input,
    torch::Tensor weight,
    torch::Tensor bias,
    torch::Tensor gamma,
    torch::Tensor beta,
    torch::Tensor multiplier,
    double eps);
"""

_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 <cublas_v2.h>

__device__ __forceinline__ float sum8(float value) {
    value += __shfl_xor_sync(0xffffffffu, value, 4, 8);
    value += __shfl_xor_sync(0xffffffffu, value, 2, 8);
    value += __shfl_xor_sync(0xffffffffu, value, 1, 8);
    return value;
}

__device__ __forceinline__ float activate(
    float centered,
    float inv_std,
    float gamma,
    float beta,
    float multiplier)
{
    const float normalized = (centered * inv_std) * gamma + beta;
    const float swish = normalized / (1.0f + __expf(-normalized));
    const float weighted = swish * multiplier;
    return weighted / (1.0f + __expf(-weighted));
}

__global__ void bias_groupnorm32_swish_kernel(
    const float4* __restrict__ input,
    const float4* __restrict__ bias,
    const float4* __restrict__ gamma,
    const float4* __restrict__ beta,
    const float4* __restrict__ multiplier,
    float4* __restrict__ output,
    int64_t vector_count,
    int channel_vectors,
    float eps)
{
    const int64_t index =
        static_cast<int64_t>(blockIdx.x) * blockDim.x + threadIdx.x;
    const bool valid = index < vector_count;
    const int channel = static_cast<int>(index % channel_vectors);

    float4 value = make_float4(0.f, 0.f, 0.f, 0.f);
    if (valid) {
        value = input[index];
        const float4 b = bias[channel];
        value.x += b.x;
        value.y += b.y;
        value.z += b.z;
        value.w += b.w;
    }

    const float mean =
        sum8((value.x + value.y) + (value.z + value.w)) * 0.03125f;

    value.x -= mean;
    value.y -= mean;
    value.z -= mean;
    value.w -= mean;

    const float squares =
        (value.x * value.x + value.y * value.y) +
        (value.z * value.z + value.w * value.w);
    const float inv_std = rsqrtf(sum8(squares) * 0.03125f + eps);

    if (valid) {
        const float4 g = gamma[channel];
        const float4 b = beta[channel];
        const float4 m = multiplier[channel];

        float4 result;
        result.x = activate(value.x, inv_std, g.x, b.x, m.x);
        result.y = activate(value.y, inv_std, g.y, b.y, m.y);
        result.z = activate(value.z, inv_std, g.z, b.z, m.z);
        result.w = activate(value.w, inv_std, g.w, b.w, m.w);
        output[index] = result;
    }
}

torch::Tensor fused_forward_cuda(
    torch::Tensor input,
    torch::Tensor weight,
    torch::Tensor bias,
    torch::Tensor gamma,
    torch::Tensor beta,
    torch::Tensor multiplier,
    double eps)
{
    TORCH_CHECK(input.is_cuda() && input.scalar_type() == at::kFloat);
    const c10::cuda::CUDAGuard guard(input.device());

    TORCH_CHECK(input.dim() == 2 && input.is_contiguous());
    TORCH_CHECK(weight.dim() == 2);
    const int64_t batch64 = input.size(0);
    const int64_t features64 = input.size(1);
    const int64_t channels64 = weight.size(0);

    TORCH_CHECK(features64 > 0 && weight.size(1) == features64);
    TORCH_CHECK(channels64 > 0 && channels64 % 32 == 0);
    TORCH_CHECK(batch64 <= INT_MAX && features64 <= INT_MAX &&
                channels64 <= INT_MAX);

    for (const auto& tensor : {weight, bias, gamma, beta, multiplier}) {
        TORCH_CHECK(tensor.device() == input.device());
        TORCH_CHECK(tensor.scalar_type() == at::kFloat);
        TORCH_CHECK(tensor.is_contiguous());
    }
    TORCH_CHECK(bias.numel() == channels64);
    TORCH_CHECK(gamma.numel() == channels64);
    TORCH_CHECK(beta.numel() == channels64);
    TORCH_CHECK(multiplier.numel() == channels64);

    const int batch = static_cast<int>(batch64);
    const int features = static_cast<int>(features64);
    const int channels = static_cast<int>(channels64);

    auto output = torch::empty({batch64, channels64}, input.options());
    if (batch == 0)
        return output;

    auto intermediate = torch::empty_like(output);
    const auto stream = at::cuda::getCurrentCUDAStream();
    auto handle = at::cuda::getCurrentCUDABlasHandle();

    cublasMath_t original_math;
    TORCH_CHECK(
        cublasGetMathMode(handle, &original_math) == CUBLAS_STATUS_SUCCESS,
        "Could not read cuBLAS math mode");

    TORCH_CHECK(
        cublasSetMathMode(handle, CUBLAS_TF32_TENSOR_OP_MATH) ==
            CUBLAS_STATUS_SUCCESS,
        "Could not enable TF32 tensor cores");

    const float alpha = 1.0f;
    const float zero = 0.0f;

    // Row-major X @ W.T is column-major W.T @ X.
    const cublasStatus_t gemm_status = cublasGemmEx(
        handle,
        CUBLAS_OP_T,
        CUBLAS_OP_N,
        channels,
        batch,
        features,
        &alpha,
        weight.data_ptr<float>(),
        CUDA_R_32F,
        features,
        input.data_ptr<float>(),
        CUDA_R_32F,
        features,
        &zero,
        intermediate.data_ptr<float>(),
        CUDA_R_32F,
        channels,
        CUBLAS_COMPUTE_32F_FAST_TF32,
        CUBLAS_GEMM_DEFAULT_TENSOR_OP);

    const cublasStatus_t restore_status =
        cublasSetMathMode(handle, original_math);

    TORCH_CHECK(
        gemm_status == CUBLAS_STATUS_SUCCESS,
        "TF32 GEMM failed: ", static_cast<int>(gemm_status));
    TORCH_CHECK(
        restore_status == CUBLAS_STATUS_SUCCESS,
        "Could not restore cuBLAS math mode");

    constexpr int threads = 256;
    const int64_t vector_count = output.numel() / 4;
    const int blocks =
        static_cast<int>((vector_count + threads - 1) / threads);

    bias_groupnorm32_swish_kernel<<<blocks, threads, 0, stream>>>(
        reinterpret_cast<const float4*>(intermediate.data_ptr<float>()),
        reinterpret_cast<const float4*>(bias.data_ptr<float>()),
        reinterpret_cast<const float4*>(gamma.data_ptr<float>()),
        reinterpret_cast<const float4*>(beta.data_ptr<float>()),
        reinterpret_cast<const float4*>(multiplier.data_ptr<float>()),
        reinterpret_cast<float4*>(output.data_ptr<float>()),
        vector_count,
        channels / 4,
        static_cast<float>(eps));

    C10_CUDA_KERNEL_LAUNCH_CHECK();
    return output;
}
"""

_fused_ops = load_inline(
    name="tf32_gemm_bias_groupnorm_double_swish_v5",
    cpp_sources=_cpp_source,
    cuda_sources=_cuda_source,
    functions=["fused_forward_cuda"],
    extra_cflags=["-O3"],
    extra_cuda_cflags=["-O3"],
    extra_ldflags=["-lcublas"],
    verbose=False,
)


class ModelNew(nn.Module):
    def __init__(
        self, in_features, out_features, num_groups, multiply_weight_shape
    ):
        super().__init__()
        self.gemm = nn.Linear(in_features, out_features)
        self.group_norm = nn.GroupNorm(num_groups, out_features)
        self.multiply_weight = nn.Parameter(torch.randn(multiply_weight_shape))

    def forward(self, x):
        if (
            x.is_cuda
            and x.dtype == torch.float32
            and x.ndim == 2
            and x.shape[1] == self.gemm.in_features
            and self.gemm.in_features > 0
            and self.gemm.out_features // self.group_norm.num_groups == 32
            and self.gemm.weight.dtype == torch.float32
            and self.gemm.bias.dtype == torch.float32
            and self.group_norm.weight.dtype == torch.float32
            and self.group_norm.bias.dtype == torch.float32
            and self.multiply_weight.dtype == torch.float32
            and self.multiply_weight.shape == (self.gemm.out_features,)
            and not torch.is_autocast_enabled()
        ):
            return _fused_ops.fused_forward_cuda(
                x.contiguous(),
                self.gemm.weight.contiguous(),
                self.gemm.bias.contiguous(),
                self.group_norm.weight.contiguous(),
                self.group_norm.bias.contiguous(),
                self.multiply_weight.contiguous(),
                self.group_norm.eps,
            )

        x = self.gemm(x)
        x = self.group_norm(x)
        x = x * torch.sigmoid(x)
        x = x * self.multiply_weight
        return x * torch.sigmoid(x)
```
Result of evaluating it:
The solution compiled and ran but its output did not match the reference. Details:
```
{"avg_difference": ["0.000047", "0.000047", "0.000047", "0.000047", "0.000047"], "correctness_issue": "Output mismatch", "correctness_trials": "(0 / 5)", "max_difference": ["0.003496", "0.003567", "0.003987", "0.003476", "0.003743"]}
```

The fastest correct solution so far (0.696x speedup) is:
```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_forward_cuda(
    torch::Tensor input,
    torch::Tensor weight,
    torch::Tensor bias,
    torch::Tensor gamma,
    torch::Tensor beta,
    torch::Tensor multiplier,
    int64_t groups,
    double eps);
"""

_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 <cuda_fp16.h>
#include <cublas_v2.h>

template<bool INPUT>
__global__ void split_pack_kernel(
    const float* __restrict__ source,
    __half* __restrict__ packed,
    int64_t count,
    int features)
{
    for (int64_t i = int64_t(blockIdx.x) * blockDim.x + threadIdx.x;
         i < count;
         i += int64_t(blockDim.x) * gridDim.x) {
        const float value = source[i];
        const __half high = __float2half_rn(value);
        const __half low =
            __float2half_rn((value - __half2float(high)) * 4096.0f);

        const int64_t row = i / features;
        const int col = i - row * features;
        const int64_t offset = row * (2LL * features) + col;

        if (INPUT) {
            packed[offset] = low;
            packed[offset + features] = high;
        } else {
            packed[offset] = high;
            packed[offset + features] = low;
        }
    }
}

__device__ __forceinline__ float warp_sum(float value) {
    #pragma unroll
    for (int offset = 16; offset > 0; offset >>= 1)
        value += __shfl_down_sync(0xffffffff, value, offset);
    return __shfl_sync(0xffffffff, value, 0);
}

__device__ __forceinline__ float finish(
    float value,
    float mean,
    float inv_std,
    float gamma,
    float beta,
    float multiplier)
{
    float normalized = ((value - mean) * inv_std) * gamma + beta;
    float activated = normalized * (1.0f / (1.0f + expf(-normalized)));
    float weighted = activated * multiplier;
    return weighted * (1.0f / (1.0f + expf(-weighted)));
}

template<bool SIZE_32>
__global__ void norm_activation_kernel(
    const float* __restrict__ input,
    const float* __restrict__ bias,
    const float* __restrict__ gamma,
    const float* __restrict__ beta,
    const float* __restrict__ multiplier,
    float* __restrict__ output,
    int channels,
    int groups,
    int group_size,
    int total_groups,
    float eps)
{
    const int lane = threadIdx.x & 31;
    const int group = blockIdx.x * (blockDim.x / 32) + threadIdx.x / 32;
    if (group >= total_groups) return;

    const int channel_start = (group % groups) * group_size;
    const int64_t base =
        int64_t(group / groups) * channels + channel_start;

    if (SIZE_32) {
        const int channel = channel_start + lane;
        const float value = input[base + lane] + bias[channel];
        const float mean = warp_sum(value) * 0.03125f;
        const float centered = value - mean;
        const float variance = warp_sum(centered * centered) * 0.03125f;
        const float inv_std = rsqrtf(variance + eps);

        output[base + lane] = finish(
            value, mean, inv_std,
            gamma[channel], beta[channel], multiplier[channel]);
    } else {
        float sum = 0.0f;
        for (int i = lane; i < group_size; i += 32)
            sum += input[base + i] + bias[channel_start + i];

        const float mean = warp_sum(sum) / float(group_size);
        float squared_sum = 0.0f;
        for (int i = lane; i < group_size; i += 32) {
            const float centered =
                input[base + i] + bias[channel_start + i] - mean;
            squared_sum += centered * centered;
        }
        const float inv_std =
            rsqrtf(warp_sum(squared_sum) / float(group_size) + eps);

        for (int i = lane; i < group_size; i += 32) {
            const int channel = channel_start + i;
            output[base + i] = finish(
                input[base + i] + bias[channel],
                mean, inv_std,
                gamma[channel], beta[channel], multiplier[channel]);
        }
    }
}

torch::Tensor fused_forward_cuda(
    torch::Tensor input,
    torch::Tensor weight,
    torch::Tensor bias,
    torch::Tensor gamma,
    torch::Tensor beta,
    torch::Tensor multiplier,
    int64_t groups,
    double eps)
{
    const c10::cuda::CUDAGuard guard(input.device());

    TORCH_CHECK(input.is_cuda() && input.scalar_type() == at::kFloat);
    TORCH_CHECK(input.dim() == 2 && input.is_contiguous());
    TORCH_CHECK(weight.dim() == 2);

    const int batch = static_cast<int>(input.size(0));
    const int features = static_cast<int>(input.size(1));
    const int channels = static_cast<int>(weight.size(0));

    TORCH_CHECK(features > 0 && weight.size(1) == features);
    TORCH_CHECK(groups > 0 && channels % groups == 0);

    for (const auto& tensor : {weight, bias, gamma, beta, multiplier}) {
        TORCH_CHECK(tensor.device() == input.device());
        TORCH_CHECK(tensor.scalar_type() == at::kFloat);
        TORCH_CHECK(tensor.is_contiguous());
    }
    TORCH_CHECK(bias.numel() == channels);
    TORCH_CHECK(gamma.numel() == channels);
    TORCH_CHECK(beta.numel() == channels);
    TORCH_CHECK(multiplier.numel() == channels);

    auto output = torch::empty({batch, channels}, input.options());
    if (batch == 0) return output;

    auto intermediate = torch::empty_like(output);
    auto half_options = input.options().dtype(at::kHalf);
    auto packed_input = torch::empty({batch, 2LL * features}, half_options);
    auto packed_weight = torch::empty({channels, 2LL * features}, half_options);

    const auto stream = at::cuda::getCurrentCUDAStream();
    constexpr int threads = 256;

    const int64_t input_count = input.numel();
    const int64_t weight_count = weight.numel();
    const int input_blocks =
        static_cast<int>(std::min<int64_t>((input_count + 255) / 256, 8192));
    const int weight_blocks =
        static_cast<int>(std::min<int64_t>((weight_count + 255) / 256, 8192));

    auto* xp = reinterpret_cast<__half*>(packed_input.data_ptr<at::Half>());
    auto* wp = reinterpret_cast<__half*>(packed_weight.data_ptr<at::Half>());

    split_pack_kernel<true><<<input_blocks, threads, 0, stream>>>(
        input.data_ptr<float>(), xp, input_count, features);
    split_pack_kernel<false><<<weight_blocks, threads, 0, stream>>>(
        weight.data_ptr<float>(), wp, weight_count, features);
    C10_CUDA_KERNEL_LAUNCH_CHECK();

    auto handle = at::cuda::getCurrentCUDABlasHandle();

    cublasMath_t original_math;
    TORCH_CHECK(cublasGetMathMode(handle, &original_math) ==
                CUBLAS_STATUS_SUCCESS);

    const auto precise_math = static_cast<cublasMath_t>(
        static_cast<int>(original_math) |
        static_cast<int>(CUBLAS_MATH_DISALLOW_REDUCED_PRECISION_REDUCTION));

    TORCH_CHECK(cublasSetMathMode(handle, precise_math) ==
                CUBLAS_STATUS_SUCCESS);

    const float correction_scale = 1.0f / 4096.0f;
    const float zero = 0.0f;
    const float one = 1.0f;
    const int leading_dim = 2 * features;

    // Packed GEMM computes both cross terms:
    // W_high @ X_low.T + W_low @ X_high.T.
    const cublasStatus_t correction_status = cublasGemmEx(
        handle,
        CUBLAS_OP_T, CUBLAS_OP_N,
        channels, batch, 2 * features,
        &correction_scale,
        wp, CUDA_R_16F, leading_dim,
        xp, CUDA_R_16F, leading_dim,
        &zero,
        intermediate.data_ptr<float>(), CUDA_R_32F, channels,
        CUBLAS_COMPUTE_32F,
        CUBLAS_GEMM_DEFAULT_TENSOR_OP);

    // Accumulate the dominant product in FP32.
    cublasStatus_t main_status = correction_status;
    if (correction_status == CUBLAS_STATUS_SUCCESS) {
        main_status = cublasGemmEx(
            handle,
            CUBLAS_OP_T, CUBLAS_OP_N,
            channels, batch, features,
            &one,
            wp, CUDA_R_16F, leading_dim,
            xp + features, CUDA_R_16F, leading_dim,
            &one,
            intermediate.data_ptr<float>(), CUDA_R_32F, channels,
            CUBLAS_COMPUTE_32F,
            CUBLAS_GEMM_DEFAULT_TENSOR_OP);
    }

    const cublasStatus_t restore_status =
        cublasSetMathMode(handle, original_math);

    TORCH_CHECK(correction_status == CUBLAS_STATUS_SUCCESS,
                "Correction GEMM failed: ", int(correction_status));
    TORCH_CHECK(main_status == CUBLAS_STATUS_SUCCESS,
                "Main GEMM failed: ", int(main_status));
    TORCH_CHECK(restore_status == CUBLAS_STATUS_SUCCESS,
                "Could not restore cuBLAS math mode");

    const int group_size = channels / static_cast<int>(groups);
    const int total_groups = batch * static_cast<int>(groups);
    const int blocks = (total_groups + 7) / 8;

    if (group_size == 32) {
        norm_activation_kernel<true><<<blocks, threads, 0, stream>>>(
            intermediate.data_ptr<float>(),
            bias.data_ptr<float>(),
            gamma.data_ptr<float>(),
            beta.data_ptr<float>(),
            multiplier.data_ptr<float>(),
            output.data_ptr<float>(),
            channels, static_cast<int>(groups), group_size,
            total_groups, static_cast<float>(eps));
    } else {
        norm_activation_kernel<false><<<blocks, threads, 0, stream>>>(
            intermediate.data_ptr<float>(),
            bias.data_ptr<float>(),
            gamma.data_ptr<float>(),
            beta.data_ptr<float>(),
            multiplier.data_ptr<float>(),
            output.data_ptr<float>(),
            channels, static_cast<int>(groups), group_size,
            total_groups, static_cast<float>(eps));
    }

    C10_CUDA_KERNEL_LAUNCH_CHECK();
    return output;
}
"""

_fused_ops = load_inline(
    name="compensated_half_gemm_fused_gn_swish_v3",
    cpp_sources=_cpp_source,
    cuda_sources=_cuda_source,
    functions=["fused_forward_cuda"],
    extra_cflags=["-O3"],
    extra_cuda_cflags=["-O3"],
    extra_ldflags=["-lcublas"],
    verbose=False,
)


class ModelNew(nn.Module):
    def __init__(
        self, in_features, out_features, num_groups, multiply_weight_shape
    ):
        super().__init__()
        self.gemm = nn.Linear(in_features, out_features)
        self.group_norm = nn.GroupNorm(num_groups, out_features)
        self.multiply_weight = nn.Parameter(torch.randn(multiply_weight_shape))

    def forward(self, x):
        if (
            x.is_cuda
            and x.dtype == torch.float32
            and x.ndim == 2
            and x.shape[1] > 0
            and x.shape[1] % 8 == 0
            and self.gemm.out_features % 8 == 0
            and self.gemm.weight.dtype == torch.float32
            and self.gemm.bias.dtype == torch.float32
            and self.group_norm.weight.dtype == torch.float32
            and self.group_norm.bias.dtype == torch.float32
            and self.multiply_weight.dtype == torch.float32
            and self.multiply_weight.shape == (self.gemm.out_features,)
            and not torch.is_autocast_enabled()
        ):
            return _fused_ops.fused_forward_cuda(
                x.contiguous(),
                self.gemm.weight.contiguous(),
                self.gemm.bias.contiguous(),
                self.group_norm.weight.contiguous(),
                self.group_norm.bias.contiguous(),
                self.multiply_weight.contiguous(),
                self.group_norm.num_groups,
                self.group_norm.eps,
            )

        x = self.gemm(x)
        x = self.group_norm(x)
        x = x * torch.sigmoid(x)
        x = x * self.multiply_weight
        return x * torch.sigmoid(x)
```

Write an improved complete ModelNew: fix any error, and if the solution is already correct, make it faster. Output the new code in one ```python codeblock. Just the model code, no other text, and NO testing code.
