|
| 1 | +#!/bin/bash |
| 2 | +# estimate.sh — GENESIS estimation entrypoint and run-time section metadata. |
| 3 | + |
| 4 | +genesis_declare_estimation_layout() { |
| 5 | + bk_clear_estimation_defaults |
| 6 | + bk_clear_estimation_declarations |
| 7 | + bk_define_current_estimation_package weakscaling |
| 8 | + bk_define_future_estimation_package instrumented_app_sections_dummy |
| 9 | + bk_define_baseline_system "${BK_ESTIMATION_BASELINE_SYSTEM:-MiyabiG}" |
| 10 | + bk_define_baseline_exp "${BK_ESTIMATION_BASELINE_EXP:-${BK_GENESIS_EXP:-p8}}" |
| 11 | + bk_define_future_system "${BK_ESTIMATION_FUTURE_SYSTEM:-GPU_MLP_TARGET}" |
| 12 | + bk_define_current_target_nodes "${BK_ESTIMATION_CURRENT_TARGET_NODES:-1}" |
| 13 | + bk_define_future_target_nodes "${BK_ESTIMATION_FUTURE_TARGET_NODES:-1}" |
| 14 | + bk_declare_section --side future gpu_kernel_region gpu_kernel_mlp_v15 |
| 15 | +} |
| 16 | + |
| 17 | +genesis_emit_estimation_data_from_fom() { |
| 18 | + local fom="$1" |
| 19 | + local artifact_path="results/padata0.tgz" |
| 20 | + local padata_path="$artifact_path" |
| 21 | + |
| 22 | + case "${BK_GENESIS_GPU_MLP_PROFILE:-false}" in |
| 23 | + 1|true|TRUE|yes|YES|on|ON) ;; |
| 24 | + *) return 0 ;; |
| 25 | + esac |
| 26 | + |
| 27 | + if [[ -n "${GENESIS_BENCHKIT_ROOT:-}" ]]; then |
| 28 | + padata_path="${GENESIS_BENCHKIT_ROOT}/${artifact_path}" |
| 29 | + fi |
| 30 | + if [[ ! -f "$padata_path" ]]; then |
| 31 | + echo "Genesis GPU MLP estimation requested but profiler archive was not found: ${padata_path}" >&2 |
| 32 | + return 0 |
| 33 | + fi |
| 34 | + |
| 35 | + bk_emit_declared_section --side future gpu_kernel_region "$fom" "$artifact_path" |
| 36 | +} |
| 37 | + |
| 38 | +source scripts/bk_functions.sh |
| 39 | +source scripts/estimation/common.sh |
| 40 | + |
| 41 | +BK_ESTIMATION_SECTION_DEFAULT_FACTOR="${BK_ESTIMATION_SECTION_DEFAULT_FACTOR:-1.0}" |
| 42 | +BK_GPU_MLP_ARTIFACT_MODE="${BK_GPU_MLP_ARTIFACT_MODE:-ncu}" |
| 43 | +BK_GPU_MLP_SOURCE_GPU="${BK_GPU_MLP_SOURCE_GPU:-H100}" |
| 44 | +BK_GPU_MLP_KERNEL_COUNT="${BK_GPU_MLP_KERNEL_COUNT:-20}" |
| 45 | +export BK_GPU_MLP_ARTIFACT_MODE |
| 46 | +export BK_GPU_MLP_SOURCE_GPU |
| 47 | +export BK_GPU_MLP_KERNEL_COUNT |
| 48 | + |
| 49 | +genesis_declare_estimation_layout |
| 50 | +bk_estimation_apply_declared_defaults |
| 51 | +BK_ESTIMATION_PACKAGE="${BK_ESTIMATION_PACKAGE:-$BK_ESTIMATION_FUTURE_PACKAGE}" |
| 52 | + |
| 53 | +if [[ "${BASH_SOURCE[0]}" != "$0" ]]; then |
| 54 | + return 0 2>/dev/null || exit 0 |
| 55 | +fi |
| 56 | + |
| 57 | +BK_ESTIMATION_INPUT_JSON="$1" |
| 58 | + |
| 59 | +bk_estimation_run_declared_future_package "$BK_ESTIMATION_INPUT_JSON" |
| 60 | +bk_estimation_run_recorded_current_with_weakscaling \ |
| 61 | + "${BK_ESTIMATION_BASELINE_SYSTEM:-MiyabiG}" \ |
| 62 | + "${BK_ESTIMATION_BASELINE_EXP:-}" \ |
| 63 | + "${BK_ESTIMATION_CURRENT_TARGET_NODES:-1}" \ |
| 64 | + "${BK_ESTIMATION_CURRENT_PACKAGE:-weakscaling}" |
| 65 | + |
| 66 | +bk_estimation_write_output "results/estimate_${est_code}_0.json" |
0 commit comments