Skip to content

Commit 05538fd

Browse files
Fix shard one inference and DNS contracts
1 parent 091c0a0 commit 05538fd

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

extension/src/inference/runtime/policy/thermal_policy.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,10 +542,10 @@ static zend_result king_inference_check_gpu_policy_during_run(
542542
check_interval_sec = king_inference_gpu_thermal_check_interval_seconds(&model->config);
543543
stream->gpu_policy_during_run_checks++;
544544
stream->gpu_thermal_check_interval_seconds = check_interval_sec;
545-
thermal_due = check_interval_sec > 0
546-
&& (stream->gpu_thermal_last_check_at <= 0
547-
|| now < stream->gpu_thermal_last_check_at
548-
|| now - stream->gpu_thermal_last_check_at >= check_interval_sec);
545+
thermal_due = check_interval_sec <= 0
546+
|| stream->gpu_thermal_last_check_at <= 0
547+
|| now < stream->gpu_thermal_last_check_at
548+
|| now - stream->gpu_thermal_last_check_at >= check_interval_sec;
549549
power_check_interval_sec = king_inference_gpu_power_check_interval_seconds(&model->config);
550550
stream->gpu_power_check_interval_seconds = power_check_interval_sec;
551551
power_due = king_inference_gpu_power_max_watts(&model->config) > 0.0

extension/tests/331-smart-dns-config-surface-honesty.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Semantic-DNS v1 does not support init option 'health_check_interval_ms'.
8282
King\ValidationException
8383
Semantic-DNS v1 does not support init option 'mothernode_sync_interval_sec'.
8484
bool(true)
85-
array(9) {
85+
array(10) {
8686
[0]=>
8787
string(13) "server_enable"
8888
[1]=>
@@ -101,4 +101,6 @@ array(9) {
101101
string(24) "live_probe_allowed_hosts"
102102
[8]=>
103103
string(14) "mothernode_uri"
104+
[9]=>
105+
string(10) "state_path"
104106
}

extension/tests/767-inference-gpu-thermal-refusal-contract.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ function thermalModelConfig(string $modelPath, string $sensor): array
5454
'thermal' => [
5555
'sensor_path' => $sensor,
5656
'max_temperature_c' => 80.0,
57+
'check_interval_seconds' => 0,
5758
'allow_unmonitored_gpu' => false,
5859
],
5960
],
@@ -97,6 +98,7 @@ function thermalModelConfig(string $modelPath, string $sensor): array
9798
'thermal' => [
9899
'sensor_path' => $sensor,
99100
'max_temperature_c' => 80.0,
101+
'check_interval_seconds' => 0,
100102
'allow_unmonitored_gpu' => false,
101103
],
102104
],

0 commit comments

Comments
 (0)