expertBytes method
Per-expert byte count on disk (sum of the 3 SwiGLU tensors). Cheap — reads header entries only.
Implementation
int expertBytes({int probeExpert = 0}) {
int size(String name) {
final entry = reader.entry(name);
if (entry == null) {
throw StateError('no such tensor: $name');
}
return entry.dataEnd - entry.dataStart;
}
return size(routedExpertGateKey(probeExpert)) +
size(routedExpertUpKey(probeExpert)) +
size(routedExpertDownKey(probeExpert));
}