Phase 26: Adaptive Runtime Agent & Hybrid Execution#39
Conversation
- Introduced Adaptive Runtime Agent in `libtfmbs_device.c` to dynamically switch between Fabric and CPU. - Implemented sparsity-based decision logic using Exponential Moving Average (EMA). - Added CPU fallback path for GEMV. - Implemented hysteresis/probing to prevent stuck fallback states. - Refactored Mock Driver (Phase 22 Prep) with new IOCTLs (Residency Query, Pinning). - Extended telemetry with `fallback_count` and `offload_count`. - Added comprehensive test case `tests/test_adaptive.c`. - Updated `ROADMAP.md` and `BENCHMARKS.md`. Co-authored-by: t81dev <207451414+t81dev@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR implements Phase 26 of the TFMBS roadmap: the Adaptive Runtime Agent and Hybrid Execution paths.
Key features:
src/libtfmbs_device.c, the agent monitors kernel sparsity in real-time using an EMA and decides whether to offload to the Ternary Fabric or fallback to the host CPU.test_adaptive.c) to verify the switching logic.Configuration is handled via environment variables:
TFMBS_ADAPTIVE_POLICY:offload,fallback, orsparsity.TFMBS_SPARSITY_THRESHOLD: Float value (default 0.3).TFMBS_EMA_ALPHA: Smoothing factor for sparsity tracking.Verified with
test_adaptiveand existingtest_devicesuites.PR created automatically by Jules for task 8366195443512061802 started by @t81dev