jose-compu / jose-compu/funes.cpp

[Tests] Add allocator stress tests for large graphs

Open
#6 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
Extend `tests/test-alloc.cpp` with stress tests for large/complex computation graphs.

## Current State
- `test-alloc.cpp` has 12 tests covering basic scenarios
- Tests use small buffer sizes (16-64 bytes)
- Limited coverage for complex graph topologies

## Missing Stress Tests
1. **Deep graph chains**: 100+ node sequential dependencies
2. **Wide graphs**: Many parallel branches merging at end
3. **Diamond patterns**: Common in residual connections (A -> B -> D, A -> C -> D)
4. **View-heavy graphs**: Heavy use of reshape/permute/view operations
5. **Memory pressure**: Near-full cache eviction scenarios

## Test Requirements
- Use realistic tensor sizes (MB range)
- Verify no memory overlap violations
- Verify all tensors are allocated
- Check allocator performance (time bounds)

## Acceptance Criteria
- [ ] Add `test_deep_chain()` - 100+ sequential ops
- [ ] Add `test_wide_merge()` - many parallel branches
- [ ] Add `test_diamond_pattern()` - residual-like topology
- [ ] Add `test_view_chains()` - complex view operations
- [ ] Add `test_memory_pressure()` - near-full scenarios

## Related Files
- `tests/test-alloc.cpp`
- `ggml/include/ggml-alloc.h`

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.