[HIP][GW] Support large context: global flash scores + raise MAX_CONTEXT to 32768
The GUI (strata-ctl agent session) sends a ~2648-token prompt plus max_new=16384;
the old MAX_CONTEXT=8192 refused it ('prompt + max_new exceeds context window'),
so the chat returned 0 tokens. Two fixes:
- Flash attention stored per-head scores[n_win] in dynamic shared memory. SWA is
window-capped (1024) but full-attn is global, so beyond ~16K positions it
exceeded the 64 KB LDS limit. Scores now live in a global scratch buffer
([n_head, n_win], allocated by the Rust wrapper, pool-reused); only the [nt]
reduction stays in shared. Math unchanged -> parity EXACT (16 tok) preserved.
- MAX_CONTEXT 8192 -> 32768, sized for the consumer's max_new budget plus a large
agent prompt; per-request KV (prompt+max_new) fits the 48 GiB HIP VRAM.
Verified live: 3113-token prompt -> correct 'Parigi' (finish stop). NOTE: prefill
is still sequential (~140 ms/token), so a large agent prompt takes minutes to
first token — batched prefill / prefix cache / expert-GEMV speedup is the next
(perf) step. Small prompts are fast.
Suite: workspace -D warnings green; 18 ld + 18 hip + 5 gw GPU; 5 Lean 0 sorryAx.
This commit is contained in:
1 parent
7790f48c27
commit
59c41cb613
4 files changed
+38
-20
No files matched your search
@@ -43,8 +43,12 @@ const REL_CLIP: f32 = 8.0;
|
||||
const SITU_BETA: f32 = 4.0;
|
||||
const SITU_LB: f32 = 25.0;
|
||||
/// Declared resident context window advertised in `READY` (SWA window is 1024;
|
||||
/// full-attn layers attend globally up to this cap).
|
||||
const MAX_CONTEXT: usize = 8192;
|
||||
/// full-attn layers attend globally up to this cap). Sized to accommodate the
|
||||
/// consumer's default generation budget (strata-ctl max_new=16384) plus a large
|
||||
/// agent prompt; KV is allocated per request at prompt+max_new, well within the
|
||||
/// 48 GiB HIP-visible VRAM. Flash scores live in global memory, so full-attn is
|
||||
/// not limited by the 64 KB LDS cap.
|
||||
const MAX_CONTEXT: usize = 32768;
|
||||
|
||||
/// A loaded Inkling model ready to run autoregressive forwards.
|
||||
pub struct InklingEngine {
|
||||
|
||||
Reference in new issue
Block a user