File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ def run_benchmarks(
66
66
benchmarks : str ,
67
67
/ ,
68
68
test_mode : bool = False ,
69
- extra_args : Iterable [str ] | None = None ,
69
+ extra_args : list [str ] | None = None ,
70
70
) -> None :
71
71
if benchmarks .strip () == "" :
72
72
benchmarks = "all"
@@ -82,6 +82,9 @@ def run_benchmarks(
82
82
if extra_args is None :
83
83
extra_args = []
84
84
85
+ if affinity := os .environ .get ("CPU_AFFINITY" ):
86
+ extra_args .append (f"--affinity={ affinity } " )
87
+
85
88
args = [
86
89
sys .executable ,
87
90
"-m" ,
Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ jobs:
221
221
- name : Tune system
222
222
if : ${{ steps.should_run.outputs.should_run != 'false' }}
223
223
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"} ' }}
225
225
- name : Tune for (Linux) perf
226
226
if : ${{ steps.should_run.outputs.should_run != 'false' && inputs.perf }}
227
227
run : |
@@ -232,6 +232,10 @@ jobs:
232
232
run : |
233
233
rm -rf ~/.debug/*
234
234
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
235
239
# Pull again, since another job may have committed results in the meantime
236
240
- name : Pull benchmarking
237
241
if : ${{ steps.should_run.outputs.should_run != 'false' && !inputs.perf }}
You can’t perform that action at this time.
0 commit comments