diff options
Diffstat (limited to 'scripts/bench_wave64.py')
| -rw-r--r-- | scripts/bench_wave64.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/bench_wave64.py b/scripts/bench_wave64.py index b41c6e97e..3d77bc2bc 100644 --- a/scripts/bench_wave64.py +++ b/scripts/bench_wave64.py | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | python -I scripts/bench_wave64.py [--build DIR] [--llvm-mc PATH] [--groups N] [--reps N] [--procs N] [--shader NAME] | 3 | python -I scripts/bench_wave64.py [--build DIR] [--llvm-mc PATH] [--groups N] [--reps N] [--procs N] [--shader NAME] |
| 4 | 4 | ||
| 5 | Three configurations: AMD with its native 64-wide subgroup (no flag), AMD with --wave64-emulate, NVIDIA with | 5 | Three configurations: AMD with its native 64-wide subgroup (no flag), AMD with --wave64-emulate, NVIDIA with |
| 6 | --wave64-emulate (the GPU is chosen with VK_LOADER_DRIVERS_SELECT='*amd*' / '*nv*'). Each runs `procs` processes of | 6 | --wave64-emulate (the GPU is chosen with VK_LOADER_DRIVERS_SELECT='*amd*,*radeon*' / '*nv*'). Each runs `procs` processes of |
| 7 | vk_compute_test with VKC_BENCH=`reps` timed dispatches of `groups` workgroups; the table gives the median over all | 7 | vk_compute_test with VKC_BENCH=`reps` timed dispatches of `groups` workgroups; the table gives the median over all |
| 8 | dispatches, the spread of the per-process medians (other programs share the GPU, so look at it), the number of | 8 | dispatches, the spread of the per-process medians (other programs share the GPU, so look at it), the number of |
| 9 | translated segments (static: blocks + continuation segments; every continuation segment is one more workgroup barrier | 9 | translated segments (static: blocks + continuation segments; every continuation segment is one more workgroup barrier |
| @@ -20,7 +20,7 @@ import tempfile | |||
| 20 | 20 | ||
| 21 | ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | 21 | ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
| 22 | BUILD_PY = os.path.join(ROOT, "runtime", "test", "shaders", "build.py") | 22 | BUILD_PY = os.path.join(ROOT, "runtime", "test", "shaders", "build.py") |
| 23 | CONFIGS = [("AMD native", "*amd*", False), ("AMD --wave64-emulate", "*amd*", True), | 23 | CONFIGS = [("AMD native", "*amd*,*radeon*", False), ("AMD --wave64-emulate", "*amd*,*radeon*", True), |
| 24 | ("NVIDIA --wave64-emulate", "*nv*", True)] | 24 | ("NVIDIA --wave64-emulate", "*nv*", True)] |
| 25 | 25 | ||
| 26 | 26 | ||
| @@ -52,7 +52,10 @@ def run(tools, spv, groups, reps, driver, emulate): | |||
| 52 | args = [os.path.join(tools, "vk_compute_test" + (".exe" if os.name == "nt" else "")), spv, str(groups), "dump"] | 52 | args = [os.path.join(tools, "vk_compute_test" + (".exe" if os.name == "nt" else "")), spv, str(groups), "dump"] |
| 53 | if not emulate: | 53 | if not emulate: |
| 54 | args.append("--require-wave64") | 54 | args.append("--require-wave64") |
| 55 | r = subprocess.run(args, env=env, capture_output=True, text=True) | 55 | try: |
| 56 | r = subprocess.run(args, env=env, capture_output=True, text=True) | ||
| 57 | except OSError as e: | ||
| 58 | return None, f"{args[0]}: {e}", None | ||
| 56 | out = r.stdout + r.stderr | 59 | out = r.stdout + r.stderr |
| 57 | m = re.search(r"bench ms: median=([\d.]+) min=([\d.]+) max=([\d.]+)", out) | 60 | m = re.search(r"bench ms: median=([\d.]+) min=([\d.]+) max=([\d.]+)", out) |
| 58 | h = re.search(r"bench out fnv1a: (\w+)", out) | 61 | h = re.search(r"bench out fnv1a: (\w+)", out) |
| @@ -123,4 +126,8 @@ def main(): | |||
| 123 | 126 | ||
| 124 | 127 | ||
| 125 | if __name__ == "__main__": | 128 | if __name__ == "__main__": |
| 129 | try: # a redirected stdout is strict ANSI code page under -I; write '?' for what it cannot encode | ||
| 130 | sys.stdout.reconfigure(errors="replace") | ||
| 131 | except (AttributeError, ValueError, OSError): | ||
| 132 | pass | ||
| 126 | sys.exit(main()) | 133 | sys.exit(main()) |