Repository navigation
Commit 2d090bb
authored
[executorch][muse-glimmer] Bound the CUDA prefill logits selector by the sampler rows
Stack from [ghstack](https://github.com/ezyang/ghstack/tree/0.15.0) (oldest at bottom):
* #24076
* __->__ #24107
* #24075
* #24074
* #24073
* #24072
`forward_others` and `forward_from_embeddings` take up to `max_step_tokens`
(4096) tokens and select which rows' logits to return. The selector's dynamic
bound was also `max_step_tokens`, so memory planning sized each method's FP32
logits output at `4096 x 202048 x 4 B = 3157 MiB`, allocated at load whether or
not a request ever uses it.
A step never selects more rows than the device samplers take
(`MAX_SAMPLE_ROWS = 64`: one row per prefilling session, or `max_owners x
block` for DFlash verify), and the executor already rejects a step with more.
Bound the selector at `min(max_step_tokens, MAX_SAMPLE_ROWS)`. Each planned
logits output drops to 49 MiB; token width and the DFlash taps keep their
`max_step_tokens` bound.
Differential Revision: D127114350
Pull Request resolved: #241071 parent 63a3e6d commit 2d090bb
1 file changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
530 | | - | |
531 | | - | |
532 | | - | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
533 | 536 | | |
534 | 537 | | |
535 | 538 | | |
536 | | - | |
| 539 | + | |
537 | 540 | | |
538 | 541 | | |
539 | 542 | | |
| |||
0 commit comments