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
7 changes: 7 additions & 0 deletions docs/benchmarks/heliodor.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ host vCPU (`HELIODOR_CELOX_THREADS`, default `nproc`). Its own job keeps the
comparison groups' time budgets unchanged. The dashboard shows it as
"multi-threaded" next to single-threaded native execution.

`celox-tiered` also uses `HELIODOR_CELOX_THREADS` on both AArch64 and x86-64.
It starts on the interpreter and adopts native kernels with parallel execution
enabled once compilation finishes. The scheduler can keep sequential kernels
when parallel execution is not worthwhile. Set `HELIODOR_CELOX_THREADS=1` for
the previous single-threaded tiered configuration. Earlier tiered measurements
used one simulation thread; account for this when comparing historical timings.

Recent complete eight-hart runs total 10–13 hours on x86-64 and 17–18 hours on
AArch64. AArch64 four-hart runs total 5–7 hours, so splitting them into equivalent
execution modes preserves useful same-CPU comparisons with time for builds.
Expand Down
6 changes: 6 additions & 0 deletions docs/ja/benchmarks/heliodor.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ Linux バージョンはシミュレーション内で起動するゲストの
別ジョブにすることで、比較グループの実行時間の上限は変わりません。ダッシュボードでは
シングルスレッドの native 実行と並べて「multi-threaded」として表示します。

`celox-tiered` も AArch64・x86-64 の両方で `HELIODOR_CELOX_THREADS` を使います。
インタープリターで実行を始め、コンパイル完了後に並列実行を有効にした native カーネルへ移行します。
並列化の効果が小さい処理には、スケジューラーが逐次カーネルを選ぶことがあります。
従来のシングルスレッド設定で測定する場合は `HELIODOR_CELOX_THREADS=1` を指定してください。
過去の tiered 計測はシミュレーションを1スレッドで実行していたため、履歴との比較ではこの違いに注意してください。

直近の完走結果では、8 hart の合計は x86-64 で 10〜13 時間、AArch64 で 17〜18 時間です。
AArch64 の 4 hart も合計 5〜7 時間なので、同じ実行方式のペアに分け、ビルド時間を確保しつつ
Celox と Veryl-CC を同じ CPU で比較します。別グループ間では同じ CPU を保証しません。
Expand Down
4 changes: 2 additions & 2 deletions scripts/heliodor-suite.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export const workloads = [
"test_soc_71v_linux_boot",
];
export const runners = ["veryl-cc-sync", "celox", "celox-tiered", "veryl-cc-tiered"];
// Multi-threaded Celox runs only on SMP workloads, in its own group so the
// existing comparison groups keep their time budgets.
// The synchronous multi-threaded Celox runner runs only on SMP workloads,
// in its own group so the existing comparison groups keep their time budgets.
export const parallelRunner = "celox-parallel";
export const allRunners = [...runners, parallelRunner];
const isSmp = test => /_smp_linux_boot_\d+hart$/.test(test);
Expand Down
15 changes: 11 additions & 4 deletions scripts/run-heliodor-bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Environment:
HELIODOR_CELOX_TIMEOUT_MULTIPLIER
timeout Celox after N times the fastest successful Veryl baseline
HELIODOR_CELOX_THREADS
simulation threads of the celox-parallel runner (default: nproc)
simulation threads of celox-parallel and celox-tiered (default: nproc)
CELOX_OPT_LEVEL O0, O1, or O2 for the Celox runner (default: O2)
CELOX_SIR_PASS_OVERRIDES
space-separated SIR pass overrides, e.g. "-vectorize_concat +gvn"
Expand Down Expand Up @@ -1580,7 +1580,8 @@ run_one() {
run_in_heliodor "$timeout_sec" "$log" \
"${celox_execution_command[@]}" \
--project "$HELIODOR_DIR" --test "$test" \
"${celox_args[@]}" --backend tiered --opt-level "${CELOX_OPT_LEVEL,,}"
"${celox_args[@]}" --backend tiered --opt-level "${CELOX_OPT_LEVEL,,}" \
--threads "$HELIODOR_CELOX_THREADS"
Comment on lines +1583 to +1584

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reset the thread count for the fixed gate

When a caller exports HELIODOR_CELOX_THREADS=1 (or another valid value) before invoking gate, run_gate never resets that variable before calling run_one, so this new argument makes the tiered leg caller-configurable. This violates the gate's stated fixed-configuration contract and can silently turn the intended parallel tiered measurement back into the historical sequential one; assign the gate's required thread count explicitly in run_gate.

Useful? React with 👍 / 👎.

Comment on lines +1583 to +1584

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Cap the default tiered thread count at the CLI limit

On hosts where nproc reports more than 64 CPUs and HELIODOR_CELOX_THREADS is unset, this forwards that value to celox-heliodor, whose --threads parser accepts only 1..=64 (crates/celox-bench/src/bin/celox-heliodor.rs). Consequently every selected celox-tiered run—including the fixed gate and complete suite—exits during argument parsing rather than benchmarking; clamp the derived default to the runner's supported maximum.

Useful? React with 👍 / 👎.

process_status="$?"
;;
celox-interpreter)
Expand Down Expand Up @@ -1658,9 +1659,10 @@ run_one() {
result_valid=0
echo "error: $CELOX_RESULT_DIAGNOSTIC" >&2
fi
if [[ "$runner" == celox-parallel && "$semantic_status" == pass ]] \
if [[ ( "$runner" == celox-parallel || "$runner" == celox-tiered ) \
&& "$HELIODOR_CELOX_THREADS" -gt 1 && "$semantic_status" == pass ]] \
&& ! grep -Fxq "CELOX_TEST_THREADS test=$test threads=$HELIODOR_CELOX_THREADS" "$log"; then
echo "error: celox-parallel log does not record $HELIODOR_CELOX_THREADS threads" >&2
echo "error: $runner log does not record $HELIODOR_CELOX_THREADS threads" >&2
semantic_status=invalid
result_valid=0
fi
Expand Down Expand Up @@ -1733,6 +1735,11 @@ publish_result() {
run_all() {
validate_compile_only_runners || return "$?"
validate_native_image_mode || return "$?"
if runner_enabled celox-tiered \
&& { ! is_uint "$HELIODOR_CELOX_THREADS" || ((HELIODOR_CELOX_THREADS < 1)); }; then
echo "error: HELIODOR_CELOX_THREADS must be at least 1 for celox-tiered" >&2
return 2
fi
prepare
mkdir -p "$HELIODOR_RESULTS_DIR"
ensure_results_schema "$HELIODOR_RESULTS_DIR/results.tsv" || return "$?"
Expand Down
41 changes: 38 additions & 3 deletions scripts/tests/run-heliodor-bench-results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ run_in_heliodor() {
ensure_results_schema "$integration_results/results.tsv"
HELIODOR_COMPILE_ONLY=0
CELOX_OPT_LEVEL=O2
HELIODOR_CELOX_THREADS=4
HELIODOR_CELOX_BUILD_CACHE_DIR="$TMP/build-cache"
CELOX_SIR_PASS_OVERRIDES="-branchify_mux +gvn"
FIXTURE_RESULT_LINE=$'CELOX_TEST_TIMING test=integration_pass compile_ns=20 execute_ns=30 jit_execute_ns=25\nCELOX_TEST_RESULT test=integration_pass status=pass elapsed_ns=71'
Expand Down Expand Up @@ -462,11 +463,13 @@ assert_eq "$(awk -F '\t' 'NR == 8 { print $10 }' "$integration_results/results.t
assert_eq "$(awk -F '\t' 'NR == 8 { print $11 }' "$integration_results/results.tsv")" NA \
"run_one Veryl CLI execute elapsed"

FIXTURE_RESULT_LINE=$'CELOX_TEST_TIMING test=integration_tiered compile_ns=12 execute_ns=34 jit_execute_ns=NA\nCELOX_TIERED_STATS test=integration_tiered tier=compiled promotion=promoted interpreted_evaluations=10 compiled_evaluations=20 promoted_after_interpreted_evaluations=10 promotion_elapsed_ns=15 safe_point_polls=11 split_apply_deferrals=0 threshold_deferrals=0\nCELOX_TEST_RESULT test=integration_tiered status=pass elapsed_ns=48'
FIXTURE_RESULT_LINE=$'CELOX_TEST_THREADS test=integration_tiered threads=4\nCELOX_TEST_TIMING test=integration_tiered compile_ns=12 execute_ns=34 jit_execute_ns=NA\nCELOX_TIERED_STATS test=integration_tiered tier=compiled promotion=promoted interpreted_evaluations=10 compiled_evaluations=20 promoted_after_interpreted_evaluations=10 promotion_elapsed_ns=15 safe_point_polls=11 split_apply_deferrals=0 threshold_deferrals=0\nCELOX_TEST_RESULT test=integration_tiered status=pass elapsed_ns=48'
run_one celox-tiered integration_tiered >/dev/null \
|| fail "run_one rejected a fixture tiered pass"
[[ " ${FIXTURE_RUN_ARGS[*]} " == *" --backend tiered "* ]] \
|| fail "tiered runner did not select the tiered backend"
[[ " ${FIXTURE_RUN_ARGS[*]} " == *" --threads 4 "* ]] \
|| fail "tiered runner did not request parallel execution"
assert_eq "$(awk -F '\t' 'NR == 9 { print $1 }' "$integration_results/results.tsv")" \
celox-tiered "run_one tiered runner name"
assert_eq "$(awk -F '\t' 'NR == 9 { print $12 }' "$integration_results/results.tsv")" NA \
Expand All @@ -486,13 +489,15 @@ assert_eq "$(awk -F '\t' 'NR == 10 { print $1 }' "$integration_results/results.t
# host-qemu mode. Native host codegen is handled separately by run_one.
HELIODOR_CELOX_NATIVE_IMAGE_MODE=host-qemu
CELOX_EXECUTION_PREFIX=(qemu-aarch64 -L /fixture-sysroot)
FIXTURE_RESULT_LINE=$'CELOX_TEST_TIMING test=integration_qemu_tiered compile_ns=12 execute_ns=34 jit_execute_ns=NA\nCELOX_TIERED_STATS test=integration_qemu_tiered tier=compiled promotion=promoted interpreted_evaluations=10 compiled_evaluations=20 promoted_after_interpreted_evaluations=10 promotion_elapsed_ns=15 safe_point_polls=11 split_apply_deferrals=0 threshold_deferrals=0\nCELOX_TEST_RESULT test=integration_qemu_tiered status=pass elapsed_ns=48'
FIXTURE_RESULT_LINE=$'CELOX_TEST_THREADS test=integration_qemu_tiered threads=4\nCELOX_TEST_TIMING test=integration_qemu_tiered compile_ns=12 execute_ns=34 jit_execute_ns=NA\nCELOX_TIERED_STATS test=integration_qemu_tiered tier=compiled promotion=promoted interpreted_evaluations=10 compiled_evaluations=20 promoted_after_interpreted_evaluations=10 promotion_elapsed_ns=15 safe_point_polls=11 split_apply_deferrals=0 threshold_deferrals=0\nCELOX_TEST_RESULT test=integration_qemu_tiered status=pass elapsed_ns=48'
run_one celox-tiered integration_qemu_tiered >/dev/null \
|| fail "run_one rejected a host-qemu tiered fixture"
assert_eq "${FIXTURE_RUN_ARGS[0]}" qemu-aarch64 "tiered execution prefix command"
assert_eq "${FIXTURE_RUN_ARGS[1]}" -L "tiered execution prefix option"
assert_eq "${FIXTURE_RUN_ARGS[2]}" /fixture-sysroot "tiered execution prefix argument"
assert_eq "${FIXTURE_RUN_ARGS[3]}" "$CELOX_RUNNER_BIN" "tiered target runner"
[[ " ${FIXTURE_RUN_ARGS[*]} " == *" --threads 4 "* ]] \
|| fail "ARM tiered runner did not request parallel execution"

FIXTURE_RESULT_LINE=$'CELOX_TEST_TIMING test=integration_qemu_interpreter compile_ns=8 execute_ns=55 jit_execute_ns=NA\nCELOX_TEST_RESULT test=integration_qemu_interpreter status=pass elapsed_ns=65'
run_one celox-interpreter integration_qemu_interpreter >/dev/null \
Expand All @@ -502,6 +507,36 @@ assert_eq "${FIXTURE_RUN_ARGS[3]}" "$CELOX_RUNNER_BIN" "interpreter target runne
HELIODOR_CELOX_NATIVE_IMAGE_MODE=off
CELOX_EXECUTION_PREFIX=()

# A successful result without the requested thread count cannot be published.
FIXTURE_RESULT_LINE=$'CELOX_TEST_TIMING test=tiered_threads compile_ns=12 execute_ns=34 jit_execute_ns=NA\nCELOX_TEST_RESULT test=tiered_threads status=pass elapsed_ns=48'
for marker in "" "CELOX_TEST_THREADS test=tiered_threads threads=2"; do
(
FIXTURE_RESULT_LINE="$marker"$'\n'"$FIXTURE_RESULT_LINE"
if run_one celox-tiered tiered_threads >/dev/null 2>&1; then
fail "tiered accepted a missing or incorrect thread count"
fi
assert_eq "$(tail -n 1 "$integration_results/results.tsv" | cut -f 6)" invalid \
"tiered thread mismatch must invalidate the result"
)
done
(
HELIODOR_CELOX_THREADS=1
run_one celox-tiered tiered_threads >/dev/null \
|| fail "tiered rejected explicit sequential execution"
[[ " ${FIXTURE_RUN_ARGS[*]} " == *" --threads 1 "* ]] \
|| fail "tiered did not honor the sequential override"
)
for invalid_threads in 0 -1 invalid; do
(
HELIODOR_RUNNERS=celox-tiered
HELIODOR_CELOX_THREADS="$invalid_threads"
prepare() { fail "invalid thread count reached benchmark preparation"; }
status=0
run_all >/dev/null 2>&1 || status=$?
assert_eq "$status" 2 "invalid tiered thread count"
)
done

previous_cache="$FIXTURE_AOT_CACHE_DIR"
FIXTURE_RESULT_LINE=$'VERYL_TEST_CONFIG test=integration_veryl_tiered backend=cc aot_c_async=true compile_only=false\nVERYL_TEST_TIMING test=integration_veryl_tiered compile_ns=8 execute_ns=50\nVERYL_TIERED_STATS test=integration_veryl_tiered compiled_dispatches=100 fallback_dispatches=200\nVERYL_TEST_RESULT test=integration_veryl_tiered status=pass elapsed_ns=59'
run_one veryl-cc-tiered integration_veryl_tiered >/dev/null \
Expand Down Expand Up @@ -552,7 +587,7 @@ fi
HELIODOR_PUBLISH_ARCH=x86_64
HELIODOR_COMPILE_ONLY=0
HELIODOR_CELOX_NATIVE_IMAGE_MODE=off
FIXTURE_RESULT_LINE=$'CELOX_TEST_TIMING test=publish_tiered compile_ns=12 execute_ns=34 jit_execute_ns=NA\nCELOX_TIERED_STATS test=publish_tiered tier=compiled promotion=promoted interpreted_evaluations=10 compiled_evaluations=20 promoted_after_interpreted_evaluations=10 promotion_elapsed_ns=15 safe_point_polls=11 split_apply_deferrals=0 threshold_deferrals=0\nCELOX_TEST_RESULT test=publish_tiered status=pass elapsed_ns=48'
FIXTURE_RESULT_LINE=$'CELOX_TEST_THREADS test=publish_tiered threads=4\nCELOX_TEST_TIMING test=publish_tiered compile_ns=12 execute_ns=34 jit_execute_ns=NA\nCELOX_TIERED_STATS test=publish_tiered tier=compiled promotion=promoted interpreted_evaluations=10 compiled_evaluations=20 promoted_after_interpreted_evaluations=10 promotion_elapsed_ns=15 safe_point_polls=11 split_apply_deferrals=0 threshold_deferrals=0\nCELOX_TEST_RESULT test=publish_tiered status=pass elapsed_ns=48'
run_one celox-tiered publish_tiered >/dev/null \
|| fail "publishing rejected a completed tiered run"
FIXTURE_RESULT_LINE="${FIXTURE_RESULT_LINE/compiled_evaluations=20/compiled_evaluations=0}"
Expand Down
Loading