From f5ab086320b48de739f73ebe33b5f7df87a17628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Garillot?= <4142+huitseeker@users.noreply.github.com> Date: Sat, 4 Nov 2023 00:20:29 -0400 Subject: [PATCH] ci: Enhance benchmarking traceability for bench comments (#850) - Enhanced the benchmark output's system information in `merge-tests.yml` to include CPU model and total RAM besides GPU name. --- .github/workflows/merge-tests.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/merge-tests.yml b/.github/workflows/merge-tests.yml index 6ff3bebb51..0c6de3e691 100644 --- a/.github/workflows/merge-tests.yml +++ b/.github/workflows/merge-tests.yml @@ -115,8 +115,17 @@ jobs: - name: copy the benchmark template and prepare it with data run: | cp .github/tables.toml . - sed -i -Ee 's/^"""$//g' tables.toml - echo "$(nvidia-smi --query-gpu=gpu_name --format=csv|tail -n1)\n\"\"\"" >> tables.toml + # Get GPU name + GPU_NAME=$(nvidia-smi --query-gpu=gpu_name --format=csv,noheader,nounits | tail -n1) + # Get CPU model + CPU_MODEL=$(grep '^model name' /proc/cpuinfo | head -1 | awk -F ': ' '{ print $2 }') + # Get total RAM + TOTAL_RAM=$(grep MemTotal /proc/meminfo | awk '{print $2 $3}') + + # Use conditionals to ensure that only non-empty variables are inserted + [[ ! -z "$GPU_NAME" ]] && sed -i "/^\"\"\"$/i $GPU_NAME" tables.toml + [[ ! -z "$CPU_MODEL" ]] && sed -i "/^\"\"\"$/i $CPU_MODEL" tables.toml + [[ ! -z "$TOTAL_RAM" ]] && sed -i "/^\"\"\"$/i $TOTAL_RAM" tables.toml working-directory: ${{ github.workspace }} # Create a `criterion-table` and write in commit comment - name: Run `criterion-table`