Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#2 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
cpp
Domain
testing

Research direction

Start by reading src/llama-memory-hybrid.h/cpp and src/llama-memory-hybrid-iswa.h/cpp to understand the llama_memory_i interface and existing memory tests. Add tests/test-memory-hybrid.cpp using models with alternating and grouped attention/recurrent layers, covering routing, synchronization, buffer isolation, next(), apply(), and memory_breakdown(). Run the repository's C++ test suite and confirm both sub-memories are covered.

Written by the indexing model from the issue text.

Description

stale

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
Dominant language
C++
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jose-compu/funes.cpp

All issues in jose-compu/funes.cpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.