Browse Source

remove benchmark descriptor handling helper scripts

master
Constantin Fürst 11 months ago
parent
commit
cae0fbb56e
  1. 31
      benchmarks/benchmark-descriptors/modifier.py
  2. 19
      benchmarks/benchmark-descriptors/renamer.sh

31
benchmarks/benchmark-descriptors/modifier.py

@ -1,31 +0,0 @@
import os
import json
import shutil
import copy
def process_json_file(file_path):
fr = open(file_path, 'r')
json_data = json.load(fr)
entries = json_data["count"]
for i in range(entries):
bs = json_data["list"][i]["task"]["batching"]["batch_size"]
del json_data["list"][i]["task"]["batching"]
del json_data["list"][i]["task"]["iterations"]
json_data["list"][i]["task"]["batch_size"] = bs
json_data["repetitions"] = 10
with open(file_path, 'w') as f:
json.dump(json_data, f, indent=2)
def process_files_in_folder(folder_path):
for filename in os.listdir(folder_path):
file_path = os.path.join(folder_path, filename)
if os.path.isfile(file_path) and filename.endswith('.json'):
process_json_file(file_path)
if __name__ == "__main__":
folder_path = "./benchmark-descriptors/peak-perf-smart-cpu/"
process_files_in_folder(folder_path)

19
benchmarks/benchmark-descriptors/renamer.sh

@ -1,19 +0,0 @@
#!/bin/bash
json_directory="$1"
# Check if the specified directory exists
if [ ! -d "$json_directory" ]; then
echo "Error: Directory $json_directory not found. Provide as arg \$1"
exit 1
fi
# Iterate over all JSON files in the directory
for json_file in "$json_directory"/*.json; do
# Check if there are matching files
if [ -e "$json_file" ]; then
bn=$(basename $json_file)
name="${bn%.*}"
mv $json_file "${json_directory}/${name}-cpu.json"
fi
done
Loading…
Cancel
Save