jose-compu / jose-compu/funes.cpp

[Memory] Add unit tests for llama_memory_hybrid cross-memory operations

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
stale
Dominant language
C++
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Summary
Hybrid memory combines attention-based KV cache and recurrent memory but lacks dedicated tests.

## Current State
- `llama_memory_hybrid` manages two sub-memory instances:
- `mem_attn`: Standard KV cache for attention layers
- `mem_recr`: Recurrent memory for RNN layers

## Missing Test Coverage
1. **Batch splitting**: Verify ubatches are correctly routed to appropriate memory type
2. **Cross-memory coherence**: Ensure position indices stay synchronized
3. **Buffer type isolation**: Verify each memory type uses correct backend buffers
4. **Hybrid context operations**: Test `next()` and `apply()` across memory boundaries

## Test Scenarios
- Model with alternating attention/recurrent layers
- Model with early recurrent layers + late attention layers
- State operations spanning both memory types

## Acceptance Criteria
- [ ] Create `tests/test-memory-hybrid.cpp`
- [ ] Test all `llama_memory_i` interface methods
- [ ] Verify `memory_breakdown()` correctly aggregates from both sub-memories

## Related Files
- `src/llama-memory-hybrid.h/cpp`
- `src/llama-memory-hybrid-iswa.h/cpp`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.