Module copies

Module copies 

Source
Expand description

2026-10-02: Load-time derived weight copies (kernels/circuits/COPIES.toml): every device allocation the loader makes for a weight beyond the checkpoint tensors it stores (requantized serving copies, transposed prefill twins, repacks, widened scales, and the leaked intermediates nothing reads). A rule matches nodes by op, by the checkpoint’s declared weight format, by the served format and by serve settings, and states the byte law of its copy.

Owner: metrale-circuit (memory). Invariants:

  • A copy’s bytes come from the node’s own shape (out x k, per expert for routed experts) and the rule’s law; nothing is sized from a measured total.
  • Every rule cites the loader site that allocates it; a rule that matches no node of a circuit is not an error (it belongs to another checkpoint), but an unknown op, format, law or setting spelling is refused at parse.

Structs§

CopyError
2026-10-02: Why the copy rules did not load.
CopyRule
2026-10-02: One copy rule.

Enums§

CopyLaw
2026-10-02: How a copy’s bytes follow from the weight’s out x k shape.

Constants§

COPY_SETTINGS
2026-10-02: The settings a rule’s when may read: the serve facts the loader branches on. latent_moe is on when the checkpoint’s MoE runs through a latent projection (moe_latent_size > 0, Nemotron-3-Super), off otherwise. moe_expert_tables is the serve’s plan-based decision on the MoE’s transposed prefill tables (build or skip).

Functions§

parse_copies
2026-10-02: Parse the rules text.