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
2 changes: 2 additions & 0 deletions src/libkernelbot/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,11 @@ def generate_system_info(system: SystemInfo):
Running on:
* GPU: `{system.gpu}`
* CPU: `{system.cpu}`
* Device count: `{system.device_count}`
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of device_count to the report output is not mentioned in the PR description and appears to be an undocumented change. Consider adding this to the PR description or splitting it into a separate PR if it's intended behavior. This also lacks test coverage - the test_generate_system_info test should be updated to verify device_count appears in the output.

Copilot uses AI. Check for mistakes.
* Runtime: `{system.runtime}`
* Platform: `{system.platform}`
* Torch: `{system.torch}`
* Hostname: `{system.hostname}`
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new hostname field in the system information output lacks test coverage. The test_generate_system_info test in tests/test_report.py should be updated to include hostname in the sample_system_info fixture and verify it appears in the generated output.

Copilot uses AI. Check for mistakes.
"""


Expand Down
4 changes: 4 additions & 0 deletions src/libkernelbot/run_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import shlex
import shutil
import socket
import subprocess
import tempfile
import time
Expand Down Expand Up @@ -66,6 +67,7 @@ class SystemInfo:
runtime: str = '' # Whether CUDA or ROCm
platform: str = '' # Platform string of the machine
torch: str = '' # Torch version
hostname: str = '' # Hostname of the machine
# fmt: on


Expand Down Expand Up @@ -631,6 +633,8 @@ def make_system_info() -> SystemInfo: # noqa: C901
pass
import platform

info.hostname = socket.gethostname()

info.platform = platform.platform()

return info
Expand Down
2 changes: 1 addition & 1 deletion src/libkernelbot/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def compute_score(result: FullResult, task: LeaderboardTask, submission_id: int)
num_benchmarks,
)
raise KernelBotError(
f"Expected submission to have exactly one benchmark," f"got {num_benchmarks}."
f"Expected submission to have exactly one benchmark, got {num_benchmarks}."
)
score = float(result.runs["leaderboard"].run.result["benchmark.0.mean"]) / 1e9
else:
Expand Down
5 changes: 5 additions & 0 deletions tests/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ async def test_handle_submission(bot: backend.KernelBackend, task_directory):
"Running on:\n"
"* GPU: `NVIDIA RTX 4090`\n"
"* CPU: `Intel i9-12900K`\n"
"* Device count: `1`\n"
"* Runtime: `CUDA`\n"
"* Platform: `Linux-5.15.0`\n"
"* Torch: `2.0.1+cu118`\n"
"* Hostname: `test-hostname`\n"
),
Log(
header="✅ Passed 3/3 tests",
Expand Down Expand Up @@ -213,6 +215,7 @@ async def test_submit_leaderboard(bot: backend.KernelBackend, task_directory):
"platform": "Linux-5.15.0",
"runtime": "CUDA",
"torch": "2.0.1+cu118",
"hostname": "test-hostname",
},
}
],
Expand Down Expand Up @@ -319,6 +322,7 @@ async def test_submit_full(bot: backend.KernelBackend, task_directory):
"platform": "Linux-5.15.0",
"runtime": "CUDA",
"torch": "2.0.1+cu118",
"hostname": "test-hostname",
},
},
{
Expand Down Expand Up @@ -362,6 +366,7 @@ async def test_submit_full(bot: backend.KernelBackend, task_directory):
"platform": "Linux-5.15.0",
"runtime": "CUDA",
"torch": "2.0.1+cu118",
"hostname": "test-hostname",
},
},
],
Expand Down
25 changes: 17 additions & 8 deletions tests/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def sample_system_info() -> SystemInfo:
runtime="CUDA",
platform="Linux-5.15.0",
torch="2.0.1+cu118",
hostname="test-hostname",
device_count=1,
)


Expand Down Expand Up @@ -504,9 +506,11 @@ def test_generate_report_test_failure(sample_full_result: FullResult):
"Running on:\n"
"* GPU: `NVIDIA RTX 4090`\n"
"* CPU: `Intel i9-12900K`\n"
"* Device count: `1`\n"
"* Runtime: `CUDA`\n"
"* Platform: `Linux-5.15.0`\n"
"* Torch: `2.0.1+cu118`\n"
"* Hostname: `test-hostname`\n"
),
Text(
text="# Testing failed\n"
Expand Down Expand Up @@ -536,9 +540,11 @@ def test_generate_report_benchmark_failure(sample_full_result: FullResult):
"Running on:\n"
"* GPU: `NVIDIA RTX 4090`\n"
"* CPU: `Intel i9-12900K`\n"
"* Device count: `1`\n"
"* Runtime: `CUDA`\n"
"* Platform: `Linux-5.15.0`\n"
"* Torch: `2.0.1+cu118`\n"
"* Hostname: `test-hostname`\n"
),
Log(
header="✅ Passed 3/3 tests",
Expand Down Expand Up @@ -571,9 +577,11 @@ def test_generate_report_benchmark_failure(sample_full_result: FullResult):
"Running on:\n"
"* GPU: `NVIDIA RTX 4090`\n"
"* CPU: `Intel i9-12900K`\n"
"* Device count: `1`\n"
"* Runtime: `CUDA`\n"
"* Platform: `Linux-5.15.0`\n"
"* Torch: `2.0.1+cu118`\n"
"* Hostname: `test-hostname`\n"
),
Log(
header="✅ Passed 3/3 tests",
Expand Down Expand Up @@ -607,9 +615,11 @@ def test_generate_report_leaderboard_failure(sample_full_result: FullResult):
"Running on:\n"
"* GPU: `NVIDIA RTX 4090`\n"
"* CPU: `Intel i9-12900K`\n"
"* Device count: `1`\n"
"* Runtime: `CUDA`\n"
"* Platform: `Linux-5.15.0`\n"
"* Torch: `2.0.1+cu118`\n"
"* Hostname: `test-hostname`\n"
),
Log(
header="✅ Passed 3/3 tests",
Expand All @@ -633,9 +643,11 @@ def test_generate_report_leaderboard_failure(sample_full_result: FullResult):
"Running on:\n"
"* GPU: `NVIDIA RTX 4090`\n"
"* CPU: `Intel i9-12900K`\n"
"* Device count: `1`\n"
"* Runtime: `CUDA`\n"
"* Platform: `Linux-5.15.0`\n"
"* Torch: `2.0.1+cu118`\n"
"* Hostname: `test-hostname`\n"
),
Log(
header="✅ Passed 3/3 tests",
Expand All @@ -646,10 +658,7 @@ def test_generate_report_leaderboard_failure(sample_full_result: FullResult):
"> Division by zero",
),
Text(
text="# Running failed\n"
"Command ```bash\n"
"./test```\n"
"**timed out** after 10.00 seconds."
text="# Running failed\nCommand ```bash\n./test```\n**timed out** after 10.00 seconds."
),
Log(header="Program stdout", content="log stdout"),
]
Expand All @@ -676,9 +685,11 @@ def test_generate_report_profile(sample_full_result: FullResult):
"Running on:\n"
"* GPU: `NVIDIA RTX 4090`\n"
"* CPU: `Intel i9-12900K`\n"
"* Device count: `1`\n"
"* Runtime: `CUDA`\n"
"* Platform: `Linux-5.15.0`\n"
"* Torch: `2.0.1+cu118`\n"
"* Hostname: `test-hostname`\n"
),
Log(
header="✅ Passed 3/3 tests",
Expand All @@ -688,11 +699,9 @@ def test_generate_report_profile(sample_full_result: FullResult):
"❌ Test division\n"
"> Division by zero",
),
Log(header='Profiling Benchmark', content=' Profile report\n'),
Log(header="Profiling Benchmark", content=" Profile report\n"),
Link("NSight profiling output", "Download from GitHub", "https://example.com"),
File(name='profile-Benchmark.zip',
message='NSight report - Benchmark',
content=b''),
File(name="profile-Benchmark.zip", message="NSight report - Benchmark", content=b""),
]


Expand Down
Loading