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
4 changes: 2 additions & 2 deletions .github/workflows/gem5-ideal-btb-0.3c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
perf_test:
uses: ./.github/workflows/gem5-perf-template.yml
with:
script_path: ../kmh_v3_btb.sh
benchmark_type: "spec06-0.3c"
config_path: configs/example/kmhv3.py
benchmark_type: "spec06-0.3c"
19 changes: 6 additions & 13 deletions .github/workflows/gem5-ideal-btb-perf-weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,24 @@ jobs:
align_test_spec06:
uses: ./.github/workflows/gem5-perf-template.yml
with:
script_path: ../kmh_v3_btb.sh
config_path: configs/example/kmhv3.py
benchmark_type: "spec06-1.0c"

align_test_spec17:
uses: ./.github/workflows/gem5-perf-template.yml
with:
script_path: ../kmh_v3_btb.sh
config_path: configs/example/kmhv3.py
benchmark_type: "spec17-1.0c"

perf_test_spec06:
uses: ./.github/workflows/gem5-perf-template.yml
with:
script_path: ../kmh_v3_ideal.sh
config_path: configs/example/idealkmhv3.py
benchmark_type: "spec06-1.0c"

perf_test_spec17:
uses: ./.github/workflows/gem5-perf-template.yml
with:
script_path: ../kmh_v3_ideal.sh
config_path: configs/example/idealkmhv3.py
benchmark_type: "spec17-1.0c"

# perf_test_spec06_vector:
# uses: ./.github/workflows/gem5-perf-template.yml
# with:
# script_path: ../kmh_v3_ideal.sh
# benchmark_type: "spec06-rvv-1.0c"
# vector_type: "simple"
# check_result: false

4 changes: 2 additions & 2 deletions .github/workflows/gem5-ideal-btb-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ jobs:
perf_test:
uses: ./.github/workflows/gem5-perf-template.yml
with:
script_path: ../kmh_v3_ideal.sh
benchmark_type: "spec06-0.8c"
config_path: configs/example/idealkmhv3.py
benchmark_type: "spec06-0.8c"
4 changes: 2 additions & 2 deletions .github/workflows/gem5-ideal-rvv-simple-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
perf_test:
uses: ./.github/workflows/gem5-perf-template.yml
with:
script_path: ../kmh_v3_ideal.sh
config_path: configs/example/idealkmhv3.py
benchmark_type: "spec06int-rvv-0.8c"
vector_type: "simple"
check_result: false # Warning: rvv test will not show the difftest failure
check_result: false # Warning: rvv test will not show the difftest failure
35 changes: 28 additions & 7 deletions .github/workflows/gem5-perf-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ name: gem5 Performance Test Template (Unified)
on:
workflow_call:
inputs:
script_path:
config_path:
required: true
type: string
description: "gem5 config file path (relative to repo root), e.g. configs/example/idealkmhv3.py"
extra_args:
required: false
type: string
default: ""
description: "Extra arguments for gem5 (e.g., --disable-mgsc). Only works with .py config files."
benchmark_type:
required: true
type: string
Expand Down Expand Up @@ -116,17 +122,32 @@ jobs:

- name: XS-GEM5 - Run performance test
# ${{ steps.config.outputs.comment }}
env:
GCBV_REF_SO: "/nfs/home/share/gem5_ci/ref/normal/riscv64-nemu-notama-tvalref-so"
GCB_RESTORER: ""
GEM5_HOME: ${{ github.workspace }}
GEM5_BUILD_TYPE: fast
run: |
export GCBV_REF_SO="/nfs/home/share/gem5_ci/ref/normal/riscv64-nemu-notama-tvalref-so"
export GCB_RESTORER=""
export GEM5_HOME=$(pwd)
export GEM5_BUILD_TYPE=fast
mkdir -p $GEM5_HOME/util/xs_scripts/test
cd $GEM5_HOME/util/xs_scripts/test
bash ../parallel_sim.sh `realpath ${{ inputs.script_path }}` \

CONFIG_PATH="${{ inputs.config_path }}"
if [[ "$CONFIG_PATH" == /* ]]; then
echo "Error: config_path must be repo-root-relative, got absolute path: '$CONFIG_PATH'"
exit 1
fi
if [[ "$CONFIG_PATH" != *.py ]]; then
echo "Error: config_path must be a .py gem5 config file path, got: '$CONFIG_PATH'"
exit 1
fi

CONFIG_PATH="$GEM5_HOME/$CONFIG_PATH"

bash ../parallel_sim.sh "$(realpath "$CONFIG_PATH")" \
${{ steps.config.outputs.checkpoint_list }} \
${{ steps.config.outputs.checkpoint_root_node}} \
spec_all
spec_all \
"${{ inputs.extra_args }}"
- name: Setup gem5_data_proc environment
run: |
# 使用本地数据处理仓库,避免GitHub网络问题
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gem5-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ jobs:
perf_test:
uses: ./.github/workflows/gem5-perf-template.yml
with:
script_path: ../kmh_6wide.sh
benchmark_type: "spec06-0.8c"
config_path: configs/example/kmhv2.py
benchmark_type: "spec06-0.8c"
20 changes: 3 additions & 17 deletions .github/workflows/manual-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,13 @@ jobs:
setup:
runs-on: ubuntu-latest
outputs:
script_path: ${{ steps.resolve.outputs.script_path }}
config_path: ${{ steps.resolve.outputs.config_path }}
pr_sha: ${{ steps.resolve.outputs.pr_sha }}
steps:
- name: Resolve parameters
id: resolve
run: |
case "${{ github.event.inputs.configuration }}" in
"kmhv2.py")
echo "script_path=../kmh_6wide.sh" >> $GITHUB_OUTPUT
;;
"kmhv3.py")
echo "script_path=../kmh_v3_btb.sh" >> $GITHUB_OUTPUT
;;
"idealkmhv3.py")
echo "script_path=../kmh_v3_ideal.sh" >> $GITHUB_OUTPUT
;;
*)
echo "Error: unsupported configuration '${{ github.event.inputs.configuration }}'" >&2
exit 1
;;
esac
echo "config_path=configs/example/${{ github.event.inputs.configuration }}" >> $GITHUB_OUTPUT

if [ -n "${{ github.event.inputs.branch }}" ]; then
echo "pr_sha=${{ github.event.inputs.branch }}" >> $GITHUB_OUTPUT
Expand All @@ -73,7 +59,7 @@ jobs:
needs: setup
uses: ./.github/workflows/gem5-perf-template.yml
with:
script_path: ${{ needs.setup.outputs.script_path }}
config_path: ${{ needs.setup.outputs.config_path }}
benchmark_type: ${{ github.event.inputs.benchmark_type }}
vector_type: ${{ github.event.inputs.vector_type }}
pr_sha: ${{ needs.setup.outputs.pr_sha }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-demand-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
needs: trigger
uses: ./.github/workflows/gem5-perf-template.yml
with:
script_path: ../kmh_v3_ideal.sh
config_path: configs/example/idealkmhv3.py
benchmark_type: ${{ needs.trigger.outputs.benchmark_type }}
vector_type: ${{ needs.trigger.outputs.vector_type }}
pr_sha: ${{ needs.trigger.outputs.pr_sha }}
61 changes: 56 additions & 5 deletions util/xs_scripts/parallel_sim.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
#!/usr/bin/env bash
# DO NOT track your local updates in this script!

function print_help() {
printf "Usage:
bash $0 arch_script.sh workload_list.lst checkpoint_top_dir task_tag\n"
bash $0 <config_file_or_script> workload_list.lst checkpoint_top_dir task_tag [extra_gem5_args]

Arguments:
config_file_or_script: Config file (*.py) or wrapper script (*.sh).
If relative, it is resolved relative to the repo root (gem5_home).
workload_list.lst: List of workloads to run
checkpoint_top_dir: Root directory for checkpoints
task_tag: Tag for this experiment
extra_gem5_args: Optional extra arguments for gem5 (only for .py mode)

Examples:
# Legacy mode (using .sh script)
bash $0 kmh_v3_btb.sh workload.lst /cpt/dir my_exp

# New mode (using .py config)
bash $0 configs/example/idealkmhv3.py workload.lst /cpt/dir my_exp

# New mode with extra args
bash $0 configs/example/idealkmhv3.py workload.lst /cpt/dir my_exp_nosc \"--disable-mgsc\"
\n"
exit 1
}

Expand All @@ -13,7 +33,31 @@ fi

set -x

export arch_script=`realpath $1`
script_dir=$(dirname -- "$( readlink -f -- "$0"; )")
source "$script_dir/common.sh"

# Detect if first parameter is a script (.sh) or config file (.py)
first_param="$1"
if [[ "$first_param" != /* ]] && [[ -f "$gem5_home/$first_param" ]]; then
first_param="$gem5_home/$first_param"
fi
export first_param=$(realpath "$first_param")

if [[ "$first_param" == *.sh ]]; then
# Legacy mode: using wrapper script
export use_legacy_mode=true
export arch_script="$first_param"
echo "Legacy mode: using script $arch_script"
else
# New mode: using config file directly
export use_legacy_mode=false
export config_file="$first_param"
export extra_gem5_args="${5:-}" # Optional 5th parameter
echo "Config mode: using $config_file"
if [ -n "$extra_gem5_args" ]; then
echo "Extra gem5 args: $extra_gem5_args"
fi
fi

# Note 1: workload list contains the workload name, checkpoint path, and parameters, looks like:
# astar_biglakes_122060000000 astar_biglakes_122060000000_0.244818/0/ 0 0 20 20
Expand Down Expand Up @@ -70,9 +114,16 @@ function run() {

touch running

script_dir=$(dirname -- "$( readlink -f -- "$0"; )")
bash $arch_script $1 # checkpoint
check $?
if [ "$use_legacy_mode" = true ]; then
# Legacy mode: call wrapper script
bash $arch_script $1 # checkpoint
check $?
else
# New mode: directly call gem5 with config file
# config_file is already an absolute path from realpath
$gem5 "$config_file" --generic-rv-cpt="$1" $extra_gem5_args
check $?
fi

rm running
touch completed
Expand Down