| 5 | |
| 6 | |
| 7 | class FTLlamaRMSNorm(nn.Module): |
| 8 | def __init__(self, weight, eps=1e-6): |
| 9 | """ |
| 10 | LlamaRMSNorm is equivalent to T5LayerNorm |
| 11 | """ |
| 12 | super().__init__() |
| 13 | self.weight = weight |
| 14 | self.variance_epsilon = eps |
| 15 | |
| 16 | def forward(self, x): |
| 17 | output = torch.empty_like(x) |
| 18 | awq_inference_engine.layernorm_forward_cuda( |
| 19 | x, self.weight, output, self.variance_epsilon |
| 20 | ) |
| 21 | return output |
| 22 | |
| 23 | |
| 24 | def make_quant_norm(model): |