| 17 | #include <limits> |
| 18 | #include <mutex> |
| 19 | #include <numeric> |
| 20 | #include <set> |
| 21 | #include <sstream> |
| 22 | #include <stdexcept> |
| 23 | #include <unordered_map> |
| 24 | #include <unordered_set> |
| 25 | |
| 26 | namespace engine::assets { |
| 27 | namespace { |
| 28 | |
| 29 | constexpr int64_t kParallelF32ConvertElements = 1ll << 20; |
| 30 | constexpr int64_t kF32ConvertChunkElements = 1ll << 16; |
| 31 | // Quantization chunks are whole ROWS, so this is a budget rounded down to a row |
| 32 | // count rather than an exact split. A row of a large tensor is a few thousand |
| 33 | // elements, which puts a chunk in the same size range as the conversions above. |
| 34 | constexpr int64_t kQuantizeChunkElements = 1ll << 20; |
| 35 | |
| 36 | bool tensor_type_override_matches(std::string_view name, std::string_view pattern) { |
| 37 | if (pattern.empty()) { |
| 38 | return false; |
no test coverage detected