模版
#!/bin/bash
bash_args=""
function check_framework() {
}
# 判断是否分布式还是单机
function check_switch() {
}
# 单机
function run_single() {
# vllm/sglang
check_service_engin
# 执行对应的评测方式
if [ "$evaluation_method" = "throughput" ]; then
run_throughput
fi
if [ "$evaluation_method" = "serving" ]; then
run_serving
fi
if [ "$evaluation_method" = "slo_search" ]; then
run_slo_search
fi
}
# 分布式
function run_distributed() {
check_service_engin
# 执行对应的评测方式
if [ "$evaluation_method" = "throughput" ]; then
run_throughput
fi
if [ "$evaluation_method" = "serving" ]; then
run_serving
fi
if [ "$evaluation_method" = "slo_search" ]; then
run_slo_search
fi
}
function check_service_engin() {
# vllm/sglang
if [ "$framework" = "vllm" ]; then
fi
if [ "$framework" = "sglang" ]; then
fi
}
function run_throughput() {
}
function run_serving() {
}
function run_slo_search() {
}
function get_params() {
# Check if config.json exists
if [ ! -f "config.json" ]; then
echo "Error: config.json not found"
return 1
fi
# Parse JSON and extract params
local params=$(jq -c '.params[]' config.json 2>/dev/null)
if [ $? -ne 0 ]; then
echo "Error: Failed to parse config.json"
return 1
fi
# Process each parameter
while IFS= read -r param; do
local param_type=$(echo "$param" | jq -r '.paramType')
local param_name=$(echo "$param" | jq -r '.paramName')
local param_value=$(echo "$param" | jq -r '.paramValue')
# Only process FRAME_PARAM type parameters
if [ "$param_type" = "FRAME_PARAM" ]; then
# Add to bash_args with proper formatting
bash_args="$bash_args --${param_name}=${param_value} "
fi
done <<< "$params"
}
main() {
# 参数处理
get_params
# 单机/分布式
if [ "$engin" = "single" ]; then
run_single
fi
if [ "$engin" = "distributed" ]; then
run_distributed
fi
}
main
1019

被折叠的 条评论
为什么被折叠?



