rugnux: record in the report how the run was invoked, what it cost and what it ran on
The results report said what the run determined but nothing about how it was produced, so a report read next to a lost shell history could not be reproduced or compared. Four keys in the header block, all new, none renamed - a consumer that greps for what it needs is unaffected, so REPORT_VERSION does not move: COMMAND_LINE= rugnux -o myrun --model model.pdb dataset_master.h5 WALL_TIME= 262.41 GPU_COUNT= 4 GPU= 4x NVIDIA A100-SXM4-80GB The command line is argv as one shell-ready line; an argument that would not survive being pasted back into a shell is single-quoted, so a file prefix with a space comes back as the one argument it was. It replaces the raw argv echo at the top of the run, which had no quoting at all. WALL_TIME is the whole invocation, timed from the top of the CLI. It is deliberately not result.total_time_s, which starts inside Rugnux::Run and so counts neither opening the file nor setting up the analysis - and which --mode scale never sets at all, having no ProcessResult of its own. It is printed on stdout as well, next to the processing time it is slightly larger than. The GPUs are the reason rugnux is fast, and until now nothing said whether any were being used. get_gpu_names() reports them per device and get_gpu_description() collapses repeats, so four identical cards read as one line rather than the same name four times and a mixed machine keeps one group per model. Both have a CPU-only implementation, so the JFJOCH_USE_CUDA=OFF build reports GPU_COUNT= 0 rather than failing to link. The same line is printed at startup, before the run rather than after it: a machine that turns out to have no GPU - a driver mismatch, a CUDA_VISIBLE_DEVICES left over from another job - is worth knowing about while there is still time to stop, not once the run has taken an order of magnitude longer than it should. GPU_COUNT= 0 is written with no GPU= line beside it, because the absence is the statement. The header comment claiming timing is deliberately absent from the report is now wrong and says so: rates and per-image costs stay on stdout, the total does not. Verified on the rotation test dataset in both build configurations, with and without CUDA_VISIBLE_DEVICES, in --mode mx and --mode scale. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WmryXe8ASbNi632sUMfsa
This commit is contained in:
+27
-2
@@ -1,14 +1,39 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#ifndef JFJOCH_USE_CUDA
|
||||
|
||||
#include "CUDAWrapper.h"
|
||||
|
||||
// Build-independent: the CUDA build gets get_gpu_names() from CUDAWrapper.cu, the CPU-only build from
|
||||
// the stub below, and this collapses whichever list came back. Four identical cards read better as
|
||||
// "4x <name>" than as the same name four times, and a mixed machine keeps one group per model.
|
||||
std::string get_gpu_description() {
|
||||
const auto names = get_gpu_names();
|
||||
|
||||
std::string out;
|
||||
for (size_t i = 0; i < names.size();) {
|
||||
size_t n = 1;
|
||||
while (i + n < names.size() && names[i + n] == names[i])
|
||||
n++;
|
||||
if (!out.empty())
|
||||
out += ", ";
|
||||
if (n > 1)
|
||||
out += std::to_string(n) + "x ";
|
||||
out += names[i];
|
||||
i += n;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
#ifndef JFJOCH_USE_CUDA
|
||||
|
||||
int32_t get_gpu_count() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<std::string> get_gpu_names() {
|
||||
return {};
|
||||
}
|
||||
|
||||
void set_gpu(int32_t dev_id) {}
|
||||
|
||||
void pin_gpu() {}
|
||||
|
||||
Reference in New Issue
Block a user