Expand description
GPT-2 model assembly and generation.
Structs§
- Attn
Step - One block’s attention probabilities for one decode step, read back from the device.
- Gpt2
- Gpt2
Config - KvCache
- Preallocated per-layer K/V tensors (
[n_head, n_ctx, head_dim]) for incremental decode.lenpositions are filled; new tokens append. - Layer
Detail - One block’s Q/K/V, MLP and output tensors for one step, read back from the
device. Captured only for the first
detail_layersblocks — the expensive kinds — whileAttnStepis captured for every block. - Step
Trace - Everything one decode step computed, read back in a single batched round
trip. A strict superset of
AttnStep:attnis exactly whatGpt2::logits_step_attn_asyncreports for the same step.