Compute the headline numbers of a gpt-oss model from its configuration. gptoss_accounting(cfg, context_len) receives a dict with the keys vocab_size, hidden_size (), num_hidden_layers (), num_attention_heads (), num_key_value_heads (), head_dim (), num_local_experts (), experts_per_token (), intermediate_size () and sliding_window (). Count parameters the way the reference implementation stores them:
mlp1 with weight and bias , and mlp2 with weight and bias .Return a dict with four integers:
total_params: everything above.active_params: the parameters used to produce one token: the total minus the input embedding (a table lookup, not compute) minus the experts per layer that the router did not select (weights and biases).kv_cache_bytes: the bf16 KV cache (2 bytes per value) for one sequence of context_len tokens. Each layer stores a key and a value vector of size per cached token. Layers alternate: layer 0, 2, 4, ... use the sliding window and cache tokens; odd layers cache all context_len.checkpoint_bytes: the size of the weights with every expert mlp1/mlp2 weight in MXFP4 (4 bits per value plus one scale byte per 32 values) and every other parameter, expert biases included, in bf16.