Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/result-server-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:
bash scripts/tests/test_scheduler_extra_args.sh
bash scripts/tests/test_send_results_profile_data.sh
bash scripts/tests/test_send_estimate_artifacts.sh
bash scripts/tests/test_estimation_run_timing.sh
bash scripts/tests/test_estimation_gpu_kernel_ensemble_average.sh
bash scripts/tests/test_estimation_gpu_kernel_lightgbm_v10.sh
bash scripts/tests/test_estimation_gpu_kernel_mlp_v15.sh
Expand Down
41 changes: 36 additions & 5 deletions docs/cx/ESTIMATE_JSON_SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ In addition, `target_nodes` represents the estimated node count on each system s
将来拡張として、Estimate JSON は以下の項目を持ってよい。

- `estimate_metadata`
- `estimation_timing`
- `measurement`
- `assumptions`
- `input_artifacts`
Expand Down Expand Up @@ -310,7 +311,37 @@ When the source benchmark Result JSON carries `input_info`, that auxiliary input
`estimation_package` and `estimation_package_version` identify the package that was actually applied.
`requested_estimation_package` and `requested_estimation_package_version` identify the package initially requested before any fallback.

### 6.2 measurement
### 6.2 estimation_timing

推定処理自体の実行時間を保持する任意項目。

想定項目:

- `schema_version`
- `elapsed_time`
- `unit`
- `recorded_by`

例:

```json
{
"estimation_timing": {
"schema_version": 1,
"elapsed_time": 42,
"unit": "s",
"recorded_by": "scripts/estimation/run.sh"
}
}
```

`elapsed_time` は推定ジョブ内で app の `estimate.sh` 実行に要した wall-clock 秒数を表す。
これは推定された benchmark 実行時間ではなく、推定処理そのものの運用コストを観測するための値である。

`elapsed_time` records wall-clock seconds spent running the app's `estimate.sh` inside the estimate job.
It is the operational cost of producing the estimate, not the estimated benchmark runtime.

### 6.3 measurement

推定入力となった計測方法や採取方式を保持する。

Expand Down Expand Up @@ -338,7 +369,7 @@ When the source benchmark Result JSON carries `input_info`, that auxiliary input

This field stores how the measurement inputs used for estimation were obtained.

### 6.3 model
### 6.4 model

推定モデルの識別情報を保持する。

Expand Down Expand Up @@ -378,7 +409,7 @@ For example, `current_system.model` may retain either an `intra_system_scaling_m

When needed, a side-specific `model` may contain `source_system`, `target_system`, and `system_compatibility_rule`.

### 6.4 assumptions
### 6.5 assumptions

推定時の仮定を保持する。

Expand Down Expand Up @@ -409,7 +440,7 @@ This field may include assumptions such as:
- whether a communication-cost adjustment is applied
- how problem size is increased

### 6.5 applicability
### 6.6 applicability

推定方式に必要な入力が十分だったか、不足があったか、フォールバックが行われたかを保持する。

Expand Down Expand Up @@ -462,7 +493,7 @@ In such a case, `estimate_metadata.requested_estimation_package` identifies the

This field records the final applicability state of the estimate, whether fallback was used, and what was missing.

### 6.6 confidence
### 6.7 confidence

推定結果の信頼度や品質指標を保持する。

Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,48 @@
{% set performance_telemetry = performance_telemetry|default({
"summary": {
"result_count": 0,
"ignored_result_count": 0,
"timing_record_count": 0,
"profiled_result_count": 0,
"regular_run_timing_count": 0,
"profiled_run_timing_count": 0,
"estimate_record_count": 0,
"estimate_timing_record_count": 0,
"build_cache_record_count": 0,
"build_cache_hit_count": 0,
"build_cache_miss_count": 0,
"build_cache_store_count": 0,
"avg_build_time": "-",
"avg_queue_time": "-",
"avg_run_time": "-"
"avg_run_time": "-",
"avg_regular_run_time": "-",
"avg_profiled_run_time": "-",
"avg_estimate_time": "-"
},
"rows": []
}, true) %}

<section class="page-card table-card">
<h2 class="section-title">Execution Timing Overview</h2>
<p class="section-intro">Best-effort timing and build-cache telemetry from stored Result JSON. These values summarize observed CI stages; profiler overhead requires a paired non-profile run.</p>
<p class="section-intro">Operator view for choosing trigger scope/frequency and improving CI and build-cache flow. It summarizes observed timing and build-cache telemetry from benchmark Result JSON; profiler overhead requires a paired non-profile run.</p>

<div class="diagnostic-grid">
<div class="diagnostic-card">
<h3>Timing Records</h3>
<p>{{ performance_telemetry.summary.timing_record_count }} with timing / {{ performance_telemetry.summary.result_count }} results</p>
<p>{{ performance_telemetry.summary.timing_record_count }} with timing / {{ performance_telemetry.summary.result_count }} benchmark results</p>
</div>
<div class="diagnostic-card">
<h3>Average Timing</h3>
<p>build {{ performance_telemetry.summary.avg_build_time }} / queue {{ performance_telemetry.summary.avg_queue_time }} / run {{ performance_telemetry.summary.avg_run_time }}</p>
</div>
<div class="diagnostic-card">
<h3>Run Split</h3>
<p>regular {{ performance_telemetry.summary.avg_regular_run_time }} / profiled {{ performance_telemetry.summary.avg_profiled_run_time }}</p>
</div>
<div class="diagnostic-card">
<h3>Estimation Runtime</h3>
<p>{{ performance_telemetry.summary.estimate_timing_record_count }} with timing / {{ performance_telemetry.summary.estimate_record_count }} estimates; avg {{ performance_telemetry.summary.avg_estimate_time }}</p>
</div>
<div class="diagnostic-card">
<h3>Build Cache</h3>
<p>{{ performance_telemetry.summary.build_cache_hit_count }} hit / {{ performance_telemetry.summary.build_cache_miss_count }} miss / {{ performance_telemetry.summary.build_cache_store_count }} stored</p>
Expand All @@ -43,6 +59,8 @@ <h3>Build Cache</h3>
<th>Results</th>
<th>Average Timing</th>
<th>Latest Timing</th>
<th>Run Split</th>
<th>Estimation</th>
<th>Build Cache</th>
<th>Latest Result</th>
</tr>
Expand All @@ -65,7 +83,19 @@ <h3>Build Cache</h3>
<td>
build {{ row.latest_build_time }}
<span class="profile-usage-subline">queue {{ row.latest_queue_time }}</span>
<span class="profile-usage-subline">run {{ row.latest_run_time }}</span>
<span class="profile-usage-subline">{{ row.latest_run_kind }} run {{ row.latest_run_time }}</span>
</td>
<td>
regular {{ row.avg_regular_run_time }}
<span class="profile-usage-subline">{{ row.regular_run_timing_count }} timing records</span>
<span class="profile-usage-subline">profiled {{ row.avg_profiled_run_time }}</span>
<span class="profile-usage-subline">{{ row.profiled_run_timing_count }} timing records</span>
</td>
<td>
{{ row.estimate_count }} estimates
<span class="profile-usage-subline">{{ row.estimate_timing_count }} timing records</span>
<span class="profile-usage-subline">avg {{ row.avg_estimate_time }}</span>
<span class="profile-usage-subline">latest {{ row.latest_estimate_elapsed_time }}</span>
</td>
<td>
{{ row.build_cache_hit_count }} hit / {{ row.build_cache_miss_count }} miss
Expand Down
8 changes: 5 additions & 3 deletions result_server/templates/usage_report.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,18 @@
white-space: normal;
}
.performance-telemetry-table {
min-width: 1080px;
min-width: 1420px;
table-layout: fixed;
}
.performance-telemetry-table th:nth-child(1) { width: 140px; }
.performance-telemetry-table th:nth-child(2) { width: 140px; }
.performance-telemetry-table th:nth-child(3) { width: 150px; }
.performance-telemetry-table th:nth-child(4) { width: 180px; }
.performance-telemetry-table th:nth-child(5) { width: 180px; }
.performance-telemetry-table th:nth-child(6) { width: 170px; }
.performance-telemetry-table th:nth-child(7) { width: 220px; }
.performance-telemetry-table th:nth-child(6) { width: 190px; }
.performance-telemetry-table th:nth-child(7) { width: 160px; }
.performance-telemetry-table th:nth-child(8) { width: 170px; }
.performance-telemetry-table th:nth-child(9) { width: 220px; }
.performance-telemetry-table td {
vertical-align: top;
white-space: normal;
Expand Down
87 changes: 80 additions & 7 deletions result_server/tests/test_performance_telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ def _write_json(path, data):


def test_performance_telemetry_summarizes_timing_and_build_cache(tmp_path):
estimated_dir = tmp_path / "estimated"
estimated_dir.mkdir()
_write_json(
tmp_path / "result_20260902_010101_aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee.json",
{
Expand Down Expand Up @@ -45,46 +47,117 @@ def test_performance_telemetry_summarizes_timing_and_build_cache(tmp_path):
"FOM": 1.0,
},
)
_write_json(
tmp_path / "result_20260901_030303_dddddddd-bbbb-cccc-dddd-eeeeeeeeeeee.json",
{
"code": "mtls-docker-runner",
"system": None,
},
)
_write_json(
tmp_path / "result_20260901_040404_eeeeeeee-bbbb-cccc-dddd-eeeeeeeeeeee.json",
{
"code": "diagnostic-tool",
"system": "Fugaku",
"pipeline_timing": {"build_time": 1},
},
)
_write_json(
tmp_path / "result_20260901_050505_ffffffff-bbbb-cccc-dddd-eeeeeeeeeeee.json",
{
"code": "../qws",
"system": "Fugaku",
"pipeline_timing": {"build_time": 1},
},
)
_write_json(
estimated_dir / "estimate_20260903_010101_11111111-bbbb-cccc-dddd-eeeeeeeeeeee.json",
{
"code": "qws",
"exp": "CASE1",
"estimate_metadata": {
"source_result": {
"system": "Fugaku",
},
},
"estimation_timing": {
"elapsed_time": 42,
"unit": "s",
},
},
)
_write_json(
estimated_dir / "estimate_20260903_020202_22222222-bbbb-cccc-dddd-eeeeeeeeeeee.json",
{
"code": "diagnostic-tool",
"exp": "CASE0",
"estimate_metadata": {
"source_result": {
"system": "Fugaku",
},
},
"estimation_timing": {
"elapsed_time": 999,
"unit": "s",
},
},
)

telemetry = build_performance_telemetry(str(tmp_path))
telemetry = build_performance_telemetry(str(tmp_path), str(estimated_dir))

assert telemetry["summary"]["result_count"] == 3
assert telemetry["summary"]["result_count"] == 2
assert telemetry["summary"]["ignored_result_count"] == 4
assert telemetry["summary"]["timing_record_count"] == 2
assert telemetry["summary"]["profiled_result_count"] == 1
assert telemetry["summary"]["regular_run_timing_count"] == 1
assert telemetry["summary"]["profiled_run_timing_count"] == 1
assert telemetry["summary"]["estimate_record_count"] == 1
assert telemetry["summary"]["estimate_timing_record_count"] == 1
assert telemetry["summary"]["build_cache_record_count"] == 2
assert telemetry["summary"]["build_cache_hit_count"] == 1
assert telemetry["summary"]["build_cache_miss_count"] == 1
assert telemetry["summary"]["build_cache_store_count"] == 1
assert telemetry["summary"]["avg_build_time"] == "1m"
assert telemetry["summary"]["avg_queue_time"] == "1m"
assert telemetry["summary"]["avg_run_time"] == "3.5m"
assert telemetry["summary"]["avg_regular_run_time"] == "5m"
assert telemetry["summary"]["avg_profiled_run_time"] == "2m"
assert telemetry["summary"]["avg_estimate_time"] == "42s"

rows = {(row["code"], row["system"]): row for row in telemetry["rows"]}
assert set(rows) == {("qws", "Fugaku")}
qws = rows[("qws", "Fugaku")]
assert qws["result_count"] == 2
assert qws["timing_count"] == 2
assert qws["profiled_count"] == 1
assert qws["avg_build_time"] == "1m"
assert qws["avg_run_time"] == "3.5m"
assert qws["avg_regular_run_time"] == "5m"
assert qws["avg_profiled_run_time"] == "2m"
assert qws["latest_exp"] == "CASE1"
assert qws["latest_build_time"] == "30s"
assert qws["latest_queue_time"] == "1m"
assert qws["latest_run_time"] == "2m"
assert qws["latest_run_kind"] == "profiled"
assert qws["estimate_count"] == 1
assert qws["estimate_timing_count"] == 1
assert qws["avg_estimate_time"] == "42s"
assert qws["latest_estimate_elapsed_time"] == "42s"
assert qws["latest_estimate_exp"] == "CASE1"
assert qws["latest_build_cache_status"] == "hit"
assert qws["build_cache_hit_count"] == 1
assert qws["build_cache_miss_count"] == 1
assert qws["build_cache_store_count"] == 1

genesis = rows[("genesis", "RIKYU")]
assert genesis["timing_count"] == 0
assert genesis["avg_build_time"] == "-"
assert genesis["latest_build_cache_status"] == "-"


def test_performance_telemetry_handles_missing_directory(tmp_path):
telemetry = build_performance_telemetry(str(tmp_path / "missing"))

assert telemetry["summary"]["result_count"] == 0
assert telemetry["summary"]["ignored_result_count"] == 0
assert telemetry["summary"]["timing_record_count"] == 0
assert telemetry["summary"]["estimate_record_count"] == 0
assert telemetry["summary"]["estimate_timing_record_count"] == 0
assert telemetry["summary"]["avg_build_time"] == "-"
assert telemetry["summary"]["avg_estimate_time"] == "-"
assert telemetry["rows"] == []
20 changes: 20 additions & 0 deletions result_server/tests/test_portal_list_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,13 +669,20 @@ def test_usage_report_evidence_snapshot_consolidates_coverage_and_quality():
"result_count": 1,
"timing_record_count": 1,
"profiled_result_count": 0,
"regular_run_timing_count": 1,
"profiled_run_timing_count": 0,
"estimate_record_count": 1,
"estimate_timing_record_count": 1,
"build_cache_record_count": 1,
"build_cache_hit_count": 1,
"build_cache_miss_count": 0,
"build_cache_store_count": 0,
"avg_build_time": "30s",
"avg_queue_time": "1m",
"avg_run_time": "2m",
"avg_regular_run_time": "2m",
"avg_profiled_run_time": "-",
"avg_estimate_time": "42s",
},
"rows": [
{
Expand All @@ -684,12 +691,22 @@ def test_usage_report_evidence_snapshot_consolidates_coverage_and_quality():
"result_count": 1,
"timing_count": 1,
"profiled_count": 0,
"regular_run_timing_count": 1,
"profiled_run_timing_count": 0,
"estimate_count": 1,
"estimate_timing_count": 1,
"avg_build_time": "30s",
"avg_queue_time": "1m",
"avg_run_time": "2m",
"avg_regular_run_time": "2m",
"avg_profiled_run_time": "-",
"avg_estimate_time": "42s",
"latest_build_time": "30s",
"latest_queue_time": "1m",
"latest_run_time": "2m",
"latest_run_kind": "regular",
"latest_estimate_elapsed_time": "42s",
"latest_estimate_exp": "CASE0",
"build_cache_hit_count": 1,
"build_cache_miss_count": 0,
"build_cache_store_count": 0,
Expand Down Expand Up @@ -735,7 +752,10 @@ def test_usage_report_evidence_snapshot_consolidates_coverage_and_quality():

assert "Evidence Snapshot" in html
assert "Execution Timing Overview" in html
assert "Operator view for choosing trigger scope/frequency and improving CI and build-cache flow" in html
assert "build 30s / queue 1m / run 2m" in html
assert "regular 2m / profiled -" in html
assert "1 with timing / 1 estimates; avg 42s" in html
assert "1 hit / 0 miss" in html
assert "Result / Quality" in html
assert "Application/System Coverage" not in html
Expand Down
Loading
Loading