Repository navigation
feat(thermal,r-iif): add generic thermal power models, profile overlays, and directional handoff - #49
Merged
Conversation
…ys, and directional handoff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds generic, SoC-agnostic temperature-compensated power modeling, runtime JSON profile overlay loading, and asymmetric directional cross-accelerator handoff costing across both the C11/C++17
freeschedruntime (libfreesched.a) and Pythonfreesilicon-twin:Generic Thermal Power Models (
include/freesched.h,src/fs_{internal.h,topology.cpp,router.cpp,executor.cpp}&python/freesilicon_twin/roofline.py):fs_thermal_model_kind_t(FS_THERMAL_NONE,FS_THERMAL_LINEAR,FS_THERMAL_EXP),fs_thermal_power_model_t(p_dyn_w,p_leak0_w,coeff,ref_temp_c,tj_ceiling_c), andfs_eval_device_watts(dev, junction_temp_c)with zero-init backward compatibility totypical_watts,0/NaN fallback toref_temp_c, optionaltj_ceiling_cclamping, and non-negative output guards.fs_resolve_device_watts_internal()intofs_router.cppenergy estimation andfs_executor.cpptelemetry (est_watts,total_energy_mj), alongside Pythoneval_thermal_rail_watts()andeval_profile_thermal_watts()(preserving non-double-countedVSYS_ALLvs additive sub-rails) and optionalest_watts/rail_wattsschema support.External Profile Overlay Loader (
python/freesilicon_twin/{profiles.py,cli.py}):--profile-overlay <path>andFREESILICON_TWIN_OVERLAYruntime overlay loading (load_profile_overlay,apply_profile_overlay) with deep-copy isolation of bundled profiles and fail-closed schema validation (schema_target,thermal_power_model,directional_handoff_us,iif_kthread_quirk).--temp-c/--temps-jsonCLI overrides while keeping bundled default profiles untouched and free of private calibration payloads.Directional
R-IIFHandoff Costing &iif_kthread_quirkGuard (fs_topology.cpp,fs_router.cpp,roofline.py):fs_handoff_policy_t(directional_us[FS_DEV_COUNT][FS_DEV_COUNT],iif_kthread_quirk,iif_kthread_penalty_us,FS_DEFAULT_IIF_KTHREAD_PENALTY_US),fs_topology_handoff_us(), and matching Pythoneval_directional_handoff_us().TPU -> GPUvsGPU -> TPUsync-file bridge latency and selectively appliesiif_kthread_penalty_usto non-TPU ->FS_DEV_TPUtransitions wheniif_kthread_quirkis active.Verification
make verify-headers(-std=c11&-std=c++17 -Wall -Wextra -Werror): PASSFREESCHED_MOCK=1 ./build/test_c11_abi(-std=c11 -Wall -Wextra -Werror -pedantic): PASSFREESCHED_MOCK=1 ./build/test_freesched(11 suites incl. syntheticthermal_power_model_and_telemetry&directional_handoff_and_iif_kthread_quirk): All 11 PASSFREESCHED_MOCK=1 ./build/bench_heterogeneous&./build/freesched_dmabuf_smoke --profile malibu --mock --json: PASS (zero_copy_handoffs=3,fallback_copies=0)python3 -m unittest -v tests/test_twin.py tests/test_sdk.py tests/test_evolve_runner.py tests/test_map_elites.py tests/test_twin_qcs9075.py: Ran 41 tests - OK./twin/freesilicon-twin self-test: PASS (schema_errors=0,native_bench_verified=2)./scripts/clean-room-audit.sh: Clean-room audit PASSED across 122 files (0 errors)