jose-compu / jose-compu/funes.cpp

[Memory] Document memory architecture and data flow

Open
#5 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
Create comprehensive documentation for the memory subsystem architecture.

## Current State
- Memory code exists but lacks architectural documentation
- Interface in `llama-memory.h` has minimal comments
- No high-level overview of how memory types interact

## Documentation Needs
1. **Architecture Overview**
- `llama_memory_i` base interface design
- Memory type hierarchy: KV cache, Recurrent, Hybrid, Hybrid-iSWA
- When to use each memory type

2. **Data Flow Documentation**
- How `llama_memory_context_i` manages batch processing
- State transitions during `init_batch()` -> `next()` -> `apply()`
- Cross-memory synchronization in hybrid setups

3. **Developer Guide**
- How to add a new memory type
- Implementing custom `llama_memory_i` subclass
- Testing requirements for new memory types

## Deliverables
- [ ] `docs/memory_architecture.md` - High-level design
- [ ] `docs/memory_interface.md` - API reference for `llama_memory_i`
- [ ] `docs/memory_testing.md` - Testing guide for memory implementations
- [ ] Inline code comments in `llama-memory.h`

## Related Files
- `src/llama-memory.h/cpp`
- `src/llama-memory-recurrent.h/cpp`
- `src/llama-memory-hybrid.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.