File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ def run_benchmarks(
6666 benchmarks : str ,
6767 / ,
6868 test_mode : bool = False ,
69- extra_args : Iterable [str ] | None = None ,
69+ extra_args : list [str ] | None = None ,
7070) -> None :
7171 if benchmarks .strip () == "" :
7272 benchmarks = "all"
@@ -82,6 +82,9 @@ def run_benchmarks(
8282 if extra_args is None :
8383 extra_args = []
8484
85+ if affinity := os .environ .get ("CPU_AFFINITY" ):
86+ extra_args .append (f"--affinity={ affinity } " )
87+
8588 args = [
8689 sys .executable ,
8790 "-m" ,
Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ jobs:
221221 - name : Tune system
222222 if : ${{ steps.should_run.outputs.should_run != 'false' }}
223223 run : |
224- sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH venv/bin/python -m pyperf system ${{ inputs.perf && 'reset' || 'tune' }}
224+ sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH venv/bin/python -m pyperf system ${{ inputs.perf && 'reset' || 'tune ${CPU_AFFINITY:+--affinity="$CPU_AFFINITY"} ' }}
225225 - name : Tune for (Linux) perf
226226 if : ${{ steps.should_run.outputs.should_run != 'false' && inputs.perf }}
227227 run : |
@@ -232,6 +232,10 @@ jobs:
232232 run : |
233233 rm -rf ~/.debug/*
234234 venv/bin/python -m bench_runner run_benchmarks ${{ inputs.perf && 'perf' || 'benchmark' }} cpython/python ${{ inputs.fork }} ${{ inputs.ref }} ${{ inputs.benchmarks || 'all' }} ${{ env.flags }} --run_id ${{ github.run_id }}
235+ - name : Untune system
236+ if : ${{ steps.should_run.outputs.should_run != 'false' }}
237+ run : |
238+ sudo LD_LIBRARY_PATH=$LD_LIBRARY_PATH venv/bin/python -m pyperf system reset
235239 # Pull again, since another job may have committed results in the meantime
236240 - name : Pull benchmarking
237241 if : ${{ steps.should_run.outputs.should_run != 'false' && !inputs.perf }}
You can’t perform that action at this time.
0 commit comments