| 44 | } |
| 45 | |
| 46 | Spec bf16_matrix(const std::string& name, uint64_t cols, uint64_t rows) { |
| 47 | Spec s{name, fnx::T_BF16, {cols, rows}, {}}; |
| 48 | s.data.resize((size_t) (cols * rows * 2)); |
| 49 | for (size_t i = 0; i < cols * rows; ++i) { |
| 50 | const uint16_t b = bf16_of((float) ((int) (rnd() % 2001) - 1000) / 250.0f); |
| 51 | std::memcpy(&s.data[i * 2], &b, 2); |
| 52 | } |
| 53 | return s; |
| 54 | } |
| 55 | Spec q6k_matrix(const std::string& name, uint64_t cols, uint64_t rows) { |
| 56 | const size_t blocks = (size_t) (cols * rows / 256); |
| 57 | Spec s{name, fnx::T_Q6_K, {cols, rows}, std::vector<uint8_t>(blocks * 210)}; |