MCPcopy Create free account
hub / github.com/Niko1221/Strata / valid

Method valid

engine/src/mgpu/placement.cpp:38–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38bool ExpertGeom::valid(std::string& err) const {
39 if (n_layers <= 0 || n_experts <= 0 || top_k <= 0) { err = "geometry needs n_layers, n_experts and top_k above zero"; return false; }
40 if (top_k > n_experts) { err = "top_k is larger than n_experts"; return false; }
41 if (layer_blob_bytes.empty() && expert_bytes.empty()) { err = "geometry has no expert byte table"; return false; }
42 if (layer_blob_bytes.size() > 1 && layer_blob_bytes.size() != (size_t) n_layers) { err = "layer_blob_bytes must have one entry per layer"; return false; }
43 if (!expert_bytes.empty() && expert_bytes.size() != (size_t) n_layers * (size_t) n_experts) { err = "expert_bytes must have n_layers x n_experts entries"; return false; }
44 if (n_layers > 4096 || n_experts > 65536 || (uint64_t) n_layers * (uint64_t) n_experts > 4u * 1024u * 1024u) { err = "geometry is larger than the planner supports"; return false; }
45 return true;
46}
47
48RankedPairs synthetic_ranking(const ExpertGeom& g, uint32_t seed) {
49 RankedPairs r;

Callers 15

mainFunction · 0.45
buildFunction · 0.45
shape_of_familyFunction · 0.45
_cached_shape_offersFunction · 0.45
_shape_engine_packageFunction · 0.45
mainFunction · 0.45
conversation_park_joinFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
join_lockedFunction · 0.45

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by 7

mainFunction · 0.36
mainFunction · 0.36
mainFunction · 0.36
mainFunction · 0.36
mainFunction · 0.36