Repository navigation
v0.0.13 - GPU Memory Fix
What's Changed
Fixed - GPU Memory Leak and Duplicate Model Runs
Critical: Prevents OOM errors and eliminates redundant inference calls
-
GPU Memory Cleanup: Added
_cleanup_gpu_memory()function that runsgc.collect()andtorch.cuda.empty_cache()between test iterations to prevent out-of-memory errors with local models- Only activates for
transformersprovider (GPU models) - Optional verbose mode shows memory stats after cleanup
- Only activates for
-
Eliminate Duplicate Model Runs:
analyze_streamed_steps()now captures the response directly fromFinalAnswerStep.output, removing the redundantagent.run()call- Previously, the model was invoked twice per test case — once via streaming and once via
agent.run() - This halves inference time and GPU memory usage per test
- Function now returns a 4-tuple:
(tools_used, final_answer_called, steps_count, response)
- Previously, the model was invoked twice per test case — once via streaming and once via
Files Modified
smoltrace/core.py- GPU cleanup + response capture from streamingtests/test_core.py- Updated mocks for 4-tuple returntests/test_core_additional.py- Updated mocks for 4-tuple returntests/test_final_coverage_push.py- Updated mocks for 4-tuple return
Full Changelog: v0.0.12...v0.0.13