| 872 | } |
| 873 | |
| 874 | void Model::forward(InferenceState& s, int token, int pos, InferenceMode mode) { |
| 875 | if (s.device() != _device) { |
| 876 | std::cerr << "FATAL: inference state device mismatch" << std::endl; |
| 877 | assert(false); |
| 878 | return; |
| 879 | } |
| 880 | if (_device == Device::CPU) { |
| 881 | _forward_cpu(s, token, pos, mode); |
| 882 | } |
| 883 | } |
| 884 | |
| 885 | double Model::active_bytes(size_t pos) const { |
| 886 | double bytes_per_weight = bits_per_weight(config->weight_quant, config->block_size[0] * config->block_size[1]) / 8.0; |
no test coverage detected