Commit 063f8a5
Add comprehensive concurrent and multi-threaded testing for AT-102
- Create test-concurrent-stress.cpp: Sustained concurrent load testing with rapid context lifecycle, sustained inference, concurrent sequences, and memory operations stress tests
- Create test-kv-cache-concurrent.cpp: Dedicated KV cache race condition testing including slot allocation/deallocation, sequence copy operations, cache clear operations, and mixed concurrent operations
- Enhance test-thread-safety.cpp: Added race condition detection patterns with thread barrier synchronization, atomic counters for tracking operations, and performance monitoring for slow initializations
- Update CMakeLists.txt: Added new test targets with 'stress' label and ThreadSanitizer configuration option (LLAMA_SANITIZE_THREAD) for race detection builds
- Extend test_completion.py: Added high-volume concurrent request tests (32-128 requests), concurrent streaming tests, cache consistency validation, and parallel sequence processing tests
These tests target critical concurrent systems:
- KV cache prepare() and update() operations
- Context initialization and parameter setup under concurrent access
- Server task queue and slot management under high load
- Backend resource allocation and cleanup patterns
- Parallel batch processing with overlapping sequences
Tests include proper ThreadSanitizer support via CMake option for automated race condition detection in CI/CD pipelines.
Co-Authored-By: Alex Peng <[email protected]>1 parent 661ae31 commit 063f8a5
File tree
5 files changed
+1119
-1
lines changed- tests
- tools/server/tests/unit
5 files changed
+1119
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
3 | 18 | | |
4 | 19 | | |
5 | 20 | | |
| |||
187 | 202 | | |
188 | 203 | | |
189 | 204 | | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
190 | 209 | | |
191 | 210 | | |
192 | 211 | | |
| |||
0 commit comments