(weight)
| 22 | """ |
| 23 | |
| 24 | def quantize_weight(weight): |
| 25 | return weight.to(torch.int8) |
| 26 | |
| 27 | def megatron_layer_quantize(layer): |
| 28 | layer.attention.query_key_value.weight.data = quantize_weight(layer.attention.query_key_value.weight.data) |
no test coverage detected