Write a custom CUDA kernel to optimize the `NIPUNA` activation function.

Formula: f(x) = max( x / (1 + exp(-beta*x)), x )

Problem Analysis:
1. Memory Bound: This is an element-wise activation. Performance is limited by memory bandwidth.
2. Operator Chaining: The PyTorch implementation `torch.max(x * torch.sigmoid(beta * x), x)` involves multiple kernel launches and intermediate tensors.

Optimization Strategy: Fused Element-wise Kernel with Vectorization

1. One-Thread-per-Element: Map each element to a CUDA thread.

2. Vectorized Loads (float4): Use `float4` to process 128 bits per memory transaction.

3. Fused In-Register Math:
   - For each element `x`:
     `swish_part = x / (1.0f + __expf(-beta * x))`
     `result = fmaxf(swish_part, x)`
   - All computations are fused in registers.

4. One-Pass: Fuse all steps into a single read-compute-write kernel.
  
Here's an example to show you the syntax of inline embedding custom CUDA operators in torch: The example given architecture is:   
  
```python
import torch
import torch.nn as nn

BATCH_SIZE = 4096
HIDDEN_DIM = 4096
SHAPE = (BATCH_SIZE, HIDDEN_DIM)

BETA_VALUE = 1.0

class NIPUNA(nn.Module):
    """
    NIPUNA Activation.
    https://www.mdpi.com/2075-1680/12/3/246
    f(x) = max(x / (1 + exp(-beta*x)), x)
    """
    def __init__(self, beta=1.0):
        super(NIPUNA, self).__init__()
        self.beta = beta

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        swish_part = x * torch.sigmoid(self.beta * x)
        return torch.max(swish_part, x)

class Model(nn.Module):
    def __init__(self, beta=1.0):
        super(Model, self).__init__()
        self.act = NIPUNA(beta=beta)
    
    def forward(self, x):
        return self.act(x)

def get_inputs():
    input_tensor = torch.randn(SHAPE, dtype=torch.float32) * 5.0
    return [input_tensor.contiguous()]

def get_init_inputs():
    return [BETA_VALUE]