Skip to content

Commit 52a7e07

Browse files
Support runtime parameter input bindings
Signed-off-by: yoshifuminakamura <nakamura@riken.jp>
1 parent f3ff69b commit 52a7e07

13 files changed

Lines changed: 695 additions & 76 deletions

‎docs/cx/BENCHKIT_SPEC.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ Benchkit は、pre-staged input、restart、学習済みモデル、公開 archi
484484
- manifest digest または content digest
485485
- 生成 recipe または取得 recipe
486486
- 公開 URL または archive reference
487+
- self-contained な runtime parameters
487488
- 検証状態
488489

489490
入力が top-level app repository 内に含まれ、その repository の `source_info.resolved_commit` で固定される場合は、別の manifest や content digest を必須にしない。
@@ -493,6 +494,9 @@ Benchkit は、pre-staged input、restart、学習済みモデル、公開 archi
493494
入力が別の public input repository や public archive から来る場合は、`input_info` 側に公開URL、ref、resolved commit または digest、取得/生成 recipe を置く。
494495
この場合も、入力が記録済み source commit で固定されるなら `verification_status: "public_source_commit"` として `Covered` に分類できる。
495496

497+
入力が実ファイルではなく、公開可能な command と arguments だけで完全に表せる場合は、`kind: "runtime-parameters"`、`source: "inline"`、`arguments`、`verification_status: "self_contained"` を使える。
498+
同じ job から複数 result が出る場合は、`result_exp` などの result scope を添えて、各 result と対応する入力指定を明示してよい。
499+
496500
site-local path は所在情報であり、長期的な input identity ではない。
497501
巨大データや共同研究由来データを site-local shared storage に置くことは許容されるが、Result provenance では path より dataset identity、recipe、manifest、digest を優先する。
498502
public surface では、必要がない限り detailed local path を表示しない。
@@ -511,6 +515,7 @@ When an application passes input metadata through the Benchkit input metadata he
511515
- manifest digest or content digest
512516
- generation or acquisition recipe
513517
- public URL or archive reference
518+
- self-contained runtime parameters
514519
- verification status
515520

516521
When the input is already stored in the top-level application repository and is fixed by `source_info.resolved_commit`, a separate manifest or content digest is not mandatory.
@@ -520,6 +525,9 @@ In that case, `source_info` is the fixed point for both the application source a
520525
When the input comes from a separate public input repository or public archive, `input_info` should carry the public URL, ref, resolved commit or digest, and acquisition or generation recipe.
521526
If the input is fixed by a recorded source commit, it may use `verification_status: "public_source_commit"` and be classified as `Covered`.
522527

528+
When the input is not a file and can be fully represented by public command arguments, `input_info` may use `kind: "runtime-parameters"`, `source: "inline"`, `arguments`, and `verification_status: "self_contained"`.
529+
When one job emits multiple results, a result scope such as `result_exp` may be attached so each Result JSON is evaluated against the matching input declaration.
530+
523531
A site-local path is location information, not a durable input identity.
524532
Large datasets and collaboration-derived inputs may still be staged on site-local shared storage, but Result provenance should prefer dataset identity, recipe, manifest, and digest over paths.
525533
Detailed local paths should not be exposed on the public surface unless they are necessary.

‎programs/qws/run.sh‎

Lines changed: 62 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ numproc_node="$3"
66
nthreads="$4"
77
export OMP_NUM_THREADS=$nthreads
88

9+
REPO_URL="https://github.com/RIKEN-LQCD/qws.git"
10+
REPO_DIR="qws"
11+
BRANCH="${QWS_BRANCH:-master}"
12+
SOURCE_COMMIT="${QWS_SOURCE_COMMIT:-}"
13+
qws_case0_args=(32 6 4 3 1 1 1 1 -1 -1 6 50)
14+
qws_case1_args=(32 6 4 3 1 1 1 2 -1 -1 6 50)
15+
qws_case7_args=(32 6 4 3 1 2 2 2 -1 -1 6 50)
16+
917
source "${PWD}/scripts/bk_functions.sh"
1018
qws_profiler_tool=$(bk_resolve_profiler_tool fapp QWS_PROFILER_TOOL)
1119
qws_profiler_level=$(bk_resolve_profiler_level detailed QWS_PROFILER_LEVEL)
@@ -14,7 +22,32 @@ qws_profiler_level=$(bk_resolve_profiler_level detailed QWS_PROFILER_LEVEL)
1422
# app-side section timings and artifacts.
1523
# source "${PWD}/programs/qws/estimate.sh"
1624

17-
mkdir -p results && > results/result
25+
mkdir -p results && : > results/result
26+
27+
record_qws_runtime_parameter_inputs() {
28+
rm -f results/.input_info_items.jsonl
29+
bk_record_runtime_parameter_input \
30+
--dataset-id qws-case0-parameters \
31+
--dataset-version "${BK_SOURCE_REF_NAME:-$BRANCH}" \
32+
--parameter-set-id CASE0 \
33+
--result-exp CASE0 \
34+
--command ./main \
35+
-- "${qws_case0_args[@]}"
36+
bk_record_runtime_parameter_input \
37+
--dataset-id qws-case1-parameters \
38+
--dataset-version "${BK_SOURCE_REF_NAME:-$BRANCH}" \
39+
--parameter-set-id CASE1 \
40+
--result-exp CASE1 \
41+
--command ./main \
42+
-- "${qws_case1_args[@]}"
43+
bk_record_runtime_parameter_input \
44+
--dataset-id qws-case7-parameters \
45+
--dataset-version "${BK_SOURCE_REF_NAME:-$BRANCH}" \
46+
--parameter-set-id CASE7 \
47+
--result-exp CASE7 \
48+
--command ./main \
49+
-- "${qws_case7_args[@]}"
50+
}
1851

1952
# print_results: extract FOM from the benchmark output and append a result line.
2053
print_results() {
@@ -41,36 +74,37 @@ print_results() {
4174
# tar -czf "$1" ./pa
4275
# }
4376

44-
[[ -d qws ]] || git clone https://github.com/RIKEN-LQCD/qws.git
77+
bk_fetch_recorded_source "${REPO_URL}" "${REPO_DIR}" "${BRANCH}" "${SOURCE_COMMIT}"
78+
record_qws_runtime_parameter_inputs
4579

4680
if [[ -f artifacts/main ]]; then
47-
cp artifacts/main qws
81+
cp artifacts/main "${REPO_DIR}"
4882
else
4983
echo "ERROR: artifacts/main not found"
5084
exit 1
5185
fi
5286

53-
cd qws
87+
cd "${REPO_DIR}"
5488

5589
case "$system" in
5690
Fugaku|FugakuCN)
5791
case "$nodes" in
5892
1)
59-
mpiexec -n 1 ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
93+
mpiexec -n 1 ./main "${qws_case0_args[@]}" > CASE0
6094
print_results output.${PJM_JOBID}/0/1/stdout.1.0 CASE0 1 >> ../results/result
61-
mpiexec -n 2 ./main 32 6 4 3 1 1 1 2 -1 -1 6 50 > CASE1
95+
mpiexec -n 2 ./main "${qws_case1_args[@]}" > CASE1
6296
print_results output.${PJM_JOBID}/0/2/stdout.2.0 CASE1 2 >> ../results/result
6397
if bk_profiler_enabled "$qws_profiler_tool"; then
64-
bk_profiler "$qws_profiler_tool" --level "$qws_profiler_level" --archive ../results/padata0.tgz --raw-dir pa -- mpiexec -n 1 ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0.profile
98+
bk_profiler "$qws_profiler_tool" --level "$qws_profiler_level" --archive ../results/padata0.tgz --raw-dir pa -- mpiexec -n 1 ./main "${qws_case0_args[@]}" > CASE0.profile
6599
# else
66100
# emit_qws_dummy_padata ../results/padata0.tgz
67101
fi
68102
;;
69103
2)
70-
mpiexec -n 8 ./main 32 6 4 3 1 2 2 2 -1 -1 6 50 > CASE7
104+
mpiexec -n 8 ./main "${qws_case7_args[@]}" > CASE7
71105
print_results output.${PJM_JOBID}/0/1/stdout.1.0 CASE7 4 >> ../results/result
72106
if bk_profiler_enabled "$qws_profiler_tool"; then
73-
bk_profiler "$qws_profiler_tool" --level "$qws_profiler_level" --archive ../results/padata0.tgz --raw-dir pa -- mpiexec -n 8 ./main 32 6 4 3 1 2 2 2 -1 -1 6 50 > CASE7.profile
107+
bk_profiler "$qws_profiler_tool" --level "$qws_profiler_level" --archive ../results/padata0.tgz --raw-dir pa -- mpiexec -n 8 ./main "${qws_case7_args[@]}" > CASE7.profile
74108
# else
75109
# emit_qws_dummy_padata ../results/padata0.tgz
76110
fi
@@ -92,38 +126,38 @@ case "$system" in
92126
export OMP_NUM_THREADS="$nthreads"
93127
export OMP_PLACES=cores
94128
export OMP_PROC_BIND=close
95-
mpirun --bind-to none -n 1 ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
129+
mpirun --bind-to none -n 1 ./main "${qws_case0_args[@]}" > CASE0
96130
print_results CASE0 CASE0 1 >> ../results/result
97131
;;
98132
RC_GH200)
99133
module load system/qc-gh200 nvhpc-hpcx/25.9
100-
mpirun -n 1 --bind-to core --map-by ppr:1:node:PE=72 ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
134+
mpirun -n 1 --bind-to core --map-by ppr:1:node:PE=72 ./main "${qws_case0_args[@]}" > CASE0
101135
print_results CASE0 CASE0 1 >> ../results/result
102136
;;
103137
RC_GENOA)
104138
module load system/genoa mpi/openmpi-x86_64
105-
mpirun -n 1 --bind-to core --map-by ppr:1:node:PE=96 ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
139+
mpirun -n 1 --bind-to core --map-by ppr:1:node:PE=96 ./main "${qws_case0_args[@]}" > CASE0
106140
print_results CASE0 CASE0 1 >> ../results/result
107141
;;
108142
RC_DGXSP)
109143
source /etc/profile.d/modules.sh
110144
module load system/ng-dgx nvhpc-hpcx/26.3
111-
mpirun -n 1 --bind-to core --map-by ppr:1:node:PE=20 ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
145+
mpirun -n 1 --bind-to core --map-by ppr:1:node:PE=20 ./main "${qws_case0_args[@]}" > CASE0
112146
print_results CASE0 CASE0 1 >> ../results/result
113147
;;
114148
RC_FX700)
115149
module load system/fx700 FJSVstclanga
116-
mpirun -n 1 --bind-to core --map-by ppr:1:node:PE=12 ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
150+
mpirun -n 1 --bind-to core --map-by ppr:1:node:PE=12 ./main "${qws_case0_args[@]}" > CASE0
117151
print_results CASE0 CASE0 1 >> ../results/result
118152
;;
119153
MiyabiG|MiyabiC)
120-
mpirun -n 1 ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
154+
mpirun -n 1 ./main "${qws_case0_args[@]}" > CASE0
121155
print_results CASE0 CASE0 1 >> ../results/result
122156
;;
123157
GenkaiA|GenkaiB|GenkaiC)
124158
qws_numproc=$((nodes * numproc_node))
125159
module load intel/2023.2 mvapich/3.0-intel2023.2
126-
mpirun -n ${qws_numproc} ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
160+
mpirun -n ${qws_numproc} ./main "${qws_case0_args[@]}" > CASE0
127161
print_results CASE0 CASE0 ${numproc_node} >> ../results/result
128162
;;
129163
Grand_C|Grand_G)
@@ -144,12 +178,12 @@ case "$system" in
144178
env | sort >&2
145179
exit 1
146180
fi
147-
"$qws_mpi_launcher" -n ${qws_numproc} ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
181+
"$qws_mpi_launcher" -n ${qws_numproc} ./main "${qws_case0_args[@]}" > CASE0
148182
print_results CASE0 CASE0 ${numproc_node} >> ../results/result
149183
;;
150184
AOBA_A|AOBA_B|AOBA_S)
151185
qws_numproc=$((nodes * numproc_node))
152-
mpirun -np ${qws_numproc} ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
186+
mpirun -np ${qws_numproc} ./main "${qws_case0_args[@]}" > CASE0
153187
print_results CASE0 CASE0 ${numproc_node} >> ../results/result
154188
;;
155189
SQUID_CPU)
@@ -160,7 +194,7 @@ case "$system" in
160194
fi
161195
module load BaseCPU
162196
export OMP_NUM_THREADS="${nthreads}"
163-
mpirun "${qws_mpi_opts[@]}" -np ${qws_numproc} ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
197+
mpirun "${qws_mpi_opts[@]}" -np ${qws_numproc} ./main "${qws_case0_args[@]}" > CASE0
164198
print_results CASE0 CASE0 ${numproc_node} >> ../results/result
165199
;;
166200
SQUID_GPU)
@@ -171,7 +205,7 @@ case "$system" in
171205
fi
172206
module load BaseGPU
173207
export OMP_NUM_THREADS="${nthreads}"
174-
mpirun "${qws_mpi_opts[@]}" -np ${qws_numproc} --bind-to none ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
208+
mpirun "${qws_mpi_opts[@]}" -np ${qws_numproc} --bind-to none ./main "${qws_case0_args[@]}" > CASE0
175209
print_results CASE0 CASE0 ${numproc_node} >> ../results/result
176210
;;
177211
SQUID_VECTOR)
@@ -182,7 +216,7 @@ case "$system" in
182216
fi
183217
module load BaseVEC
184218
export OMP_NUM_THREADS="${nthreads}"
185-
mpirun "${qws_mpi_opts[@]}" -np ${qws_numproc} ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
219+
mpirun "${qws_mpi_opts[@]}" -np ${qws_numproc} ./main "${qws_case0_args[@]}" > CASE0
186220
print_results CASE0 CASE0 ${numproc_node} >> ../results/result
187221
;;
188222
Odyssey)
@@ -195,7 +229,7 @@ case "$system" in
195229
module load odyssey fj fjmpi
196230
export OMP_NUM_THREADS=12
197231
export PLE_MPI_STD_EMPTYFILE=off
198-
mpiexec -n 1 -ofout CASE0 ./main 32 6 4 3 1 1 1 1 -1 -1 6 50
232+
mpiexec -n 1 -ofout CASE0 ./main "${qws_case0_args[@]}"
199233
print_results CASE0 CASE0 1 >> ../results/result
200234
;;
201235
Aquarius)
@@ -204,26 +238,26 @@ case "$system" in
204238
source /work/opt/local/x86_64/cores/intel/2023.0.0/mpi/latest/env/vars.sh
205239
export OMP_NUM_THREADS=8
206240
export I_MPI_PIN=1
207-
mpiexec -n 1 ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
241+
mpiexec -n 1 ./main "${qws_case0_args[@]}" > CASE0
208242
print_results CASE0 CASE0 1 >> ../results/result
209243
;;
210244
Pegasus)
211245
qws_numproc=$((nodes * numproc_node))
212246
module load intel/2025.3.1 intmpi/2025.3.1
213-
mpirun -n ${qws_numproc} ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
247+
mpirun -n ${qws_numproc} ./main "${qws_case0_args[@]}" > CASE0
214248
print_results CASE0 CASE0 ${numproc_node} >> ../results/result
215249
;;
216250
Sirius)
217251
qws_numproc=$((nodes * numproc_node))
218252
module load aocc/5.0.0 openmpi/5.0.10/aocc5.0.0
219-
mpirun -n ${qws_numproc} ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
253+
mpirun -n ${qws_numproc} ./main "${qws_case0_args[@]}" > CASE0
220254
print_results CASE0 CASE0 ${numproc_node} >> ../results/result
221255
;;
222256
TSUBAME4)
223257
qws_numproc=$((nodes * numproc_node))
224258
module load openmpi/5.0.10-gcc aocc/4.1.0
225259
export OMPI_CC=clang OMPI_CXX=clang++ OMPI_FC=flang
226-
mpirun -n ${qws_numproc} ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
260+
mpirun -n ${qws_numproc} ./main "${qws_case0_args[@]}" > CASE0
227261
print_results CASE0 CASE0 ${numproc_node} >> ../results/result
228262
;;
229263
OCTOPUS)
@@ -232,7 +266,7 @@ case "$system" in
232266
export OMP_NUM_THREADS="${nthreads}"
233267
export OMP_PROC_BIND=close
234268
export OMP_PLACES=cores
235-
mpirun -n ${qws_numproc} ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
269+
mpirun -n ${qws_numproc} ./main "${qws_case0_args[@]}" > CASE0
236270
print_results CASE0 CASE0 ${numproc_node} >> ../results/result
237271
;;
238272
Camphor3)
@@ -257,7 +291,7 @@ case "$system" in
257291
if [[ "${SLURM_CONF:-}" == /etc/slurm/sysA/* ]]; then
258292
unset SLURM_CONF
259293
fi
260-
srun -n 1 -c "${nthreads}" ./main 32 6 4 3 1 1 1 1 -1 -1 6 50 > CASE0
294+
srun -n 1 -c "${nthreads}" ./main "${qws_case0_args[@]}" > CASE0
261295
print_results CASE0 CASE0 1 >> ../results/result
262296
;;
263297
*)

0 commit comments

Comments
 (0)