Skip to content

AVX-512 CI

AVX-512 CI #13

Workflow file for this run

name: AVX-512 CI
# 手動実行のみ
on:
workflow_dispatch:
inputs:
benchmark_pattern:
description: 'Benchmark pattern (e.g., "." for all, "BenchmarkParse" for specific)'
required: false
default: '.'
type: string
benchmark_count:
description: 'Number of benchmark iterations'
required: false
default: '1'
type: string
enable_pprof:
description: 'Generate CPU/Memory pprof for benchmarks (true/false)'
required: false
default: 'true'
type: choice
options:
- 'true'
- 'false'
jobs:
ci:
name: Run AVX-512 CI
runs-on: [self-hosted, linux, x64, avx512]
env:
GOEXPERIMENT: simd
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Setup Go 1.26
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
with:
go-version: '1.26.0-rc.2'
- name: Verify AVX-512 Support
run: |
set -euo pipefail
echo "=== CPU Info ==="
lscpu | grep -E "Model name|CPU\(s\)|Thread|Core|Socket"
echo ""
echo "=== Required AVX-512 Flags (avx512f, avx512bw, avx512vl) ==="
grep -oE 'avx512(f|bw|vl)' /proc/cpuinfo | sort -u
for f in avx512f avx512bw avx512vl; do
if ! grep -qE "(^|[[:space:]])${f}([[:space:]]|$)" /proc/cpuinfo; then
echo "Missing required CPU flag: ${f}"
exit 1
fi
done
echo ""
echo "=== Go Version & GOEXPERIMENT ==="
go version
go env GOEXPERIMENT
- name: Run Tests
run: go test -v ./...
- name: Run Benchmarks
run: |
echo "=== Running Benchmarks ==="
if [ "${{ inputs.enable_pprof }}" = "true" ]; then
COUNT=1
PKG="."
ARGS=(-run "^$" -cpuprofile=cpu.pprof -memprofile=mem.pprof)
else
COUNT="${{ inputs.benchmark_count }}"
PKG="./..."
ARGS=()
fi
ARGS+=(-bench='${{ inputs.benchmark_pattern }}' -benchmem -count="${COUNT}" -cpu=1,2 "${PKG}")
go test "${ARGS[@]}" | tee benchmark-results.txt
- name: Upload Benchmark Results
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: benchmark-results-${{ github.run_number }}
path: benchmark-results.txt
retention-days: 90
- name: Upload Benchmark Profiles
if: ${{ inputs.enable_pprof == 'true' }}
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: benchmark-pprof-${{ github.run_number }}
path: |
cpu.pprof
mem.pprof
retention-days: 90