[HIP][Core] Zero-VRAM PrefixCache in pinned host RAM (PinnedBuf) + DSpark SWA ring
Close Punto 3 of the flat-VRAM plan:
- Add PinnedBuf (hipHostMallocDefault / hipHostFree with stream 0 sync on drop) and pipelined async 1D/2D D2H/H2D copy helpers in vetta_kernels.{h,hip} and vetta-infer-hip.
- Migrate LayerSnapshot (KV + ShortConv hist) and DsparkSnapshot (drafter KV + frnn_last) from VRAM DeviceBuf to host PinnedBuf (0 bytes VRAM per checkpoint).
- Size DSpark SWA layers 0/2 in DsparkContext to DS_SWA_RING=1280 (-258 MiB VRAM at 32k context).
- Add GPU regression tests: pinned_buf_zero_vram_and_roundtrip_2d (+0.00 MiB VRAM on 64 MiB alloc) and serve_gen_pinned_prefix_cache_vram_flat (4 turns up to 2100 tok, 8/8 checkpoints full, VETTA_SPEC=1: 20674->20672->20676->20676 MiB, +2.00 MiB delta).
- Update README.md, docs/ORIENTATION.md, and review/2026-12-02-fix-drafter-e-ottimizzazioni.md.
This commit is contained in:
1 parent
c1c5221642
commit
1772050087
9 files changed
+370
-88
No files matched your search
@@ -34,10 +34,20 @@ int vetta_buf_alloc(void** out, size_t bytes);
|
||||
int vetta_buf_free(void* p);
|
||||
int vetta_buf_h2d(void* dst, const void* src, size_t bytes);
|
||||
int vetta_buf_d2h(void* dst, const void* src, size_t bytes);
|
||||
// Device-to-device copies (prefix-checkpoint snapshot/restore).
|
||||
// Device-to-device copies (legacy/internal).
|
||||
int vetta_buf_copy(void* dst, const void* src, size_t bytes);
|
||||
int vetta_buf_copy2d(void* dst, size_t dpitch, const void* src, size_t spitch,
|
||||
size_t width, size_t height);
|
||||
// Pinned host RAM lifecycle + async D2H/H2D copies for zero-VRAM PrefixCache
|
||||
// checkpoints (hipHostMallocDefault / hipHostFree with stream sync on free).
|
||||
int vetta_host_alloc(void** out, size_t bytes);
|
||||
int vetta_host_free(void* p);
|
||||
int vetta_buf_d2h_async(void* dst_host, const void* src_dev, size_t bytes);
|
||||
int vetta_buf_h2d_async(void* dst_dev, const void* src_host, size_t bytes);
|
||||
int vetta_buf_copy2d_d2h_async(void* dst_host, size_t dpitch, const void* src_dev,
|
||||
size_t spitch, size_t width, size_t height);
|
||||
int vetta_buf_copy2d_h2d_async(void* dst_dev, size_t dpitch, const void* src_host,
|
||||
size_t spitch, size_t width, size_t height);
|
||||
|
||||
// k_rms_norm (kernel #2): y[row] = x[row] * rsqrt(mean(x^2)+eps) * w.
|
||||
int vetta_rms_norm_f32(const float* x, const float* w, float* y,
|
||||
|
||||
Reference in new issue
Block a user