Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Measure GIL contention in benchmarks (#937)
Add argument to measure and report GIL contention in benchmarks. This may provide some useful insight when optimizing asyncio-related changes. Sample results observed are below. <details><summary>Small messages (1 B)</summary> ``` $ python -m ucp.benchmarks.send_recv --backend ucp-core --n-bytes 1 --n-iter 100_000 --no-detailed-report --report-gil-contention ... GIL contention | 0.688429594039917 $ python -m ucp.benchmarks.send_recv --backend ucp-async --n-bytes 1 --n-iter 100_000 --no-detailed-report --report-gil-contention ... GIL contention | 0.4772491455078125 $ UCXPY_NON_BLOCKING_MODE=1 python -m ucp.benchmarks.send_recv --backend ucp-async --n-bytes 1 --n-iter 100_000 --no-detailed-report --report-gil-contention ... GIL contention | 0.8763511180877686 ``` </details> <details><summary>Medium messages (1 MiB)</summary> ``` $ python -m ucp.benchmarks.send_recv --backend ucp-core --n-bytes 1MiB --n-iter 100 --no-detailed-report --report-gil-contention ... GIL contention | 0.1721574366092682 $ python -m ucp.benchmarks.send_recv --backend ucp-async --n-bytes 1MiB --n-iter 100 --no-detailed-report --report-gil-contention ... GIL contention | 0.25215959548950195 $ UCXPY_NON_BLOCKING_MODE=1 python -m ucp.benchmarks.send_recv --backend ucp-async --n-bytes 1MiB --n-iter 100 --no-detailed-report --report-gil-contention ... GIL contention | 0.2693021595478058 ``` </details> <details><summary>Large messages (1 GiB)</summary> ``` $ python -m ucp.benchmarks.send_recv --backend ucp-core --n-bytes 1 GiB --n-iter 10 --no-detailed-report --report-gil-contention ... GIL contention | 0.5908554792404175 $ python -m ucp.benchmarks.send_recv --backend ucp-async --n-bytes 1GiB --n-iter 10 --no-detailed-report --report-gil-contention ... GIL contention | 0.6251853108406067 $ UCXPY_NON_BLOCKING_MODE=1 python -m ucp.benchmarks.send_recv --backend ucp-async --n-bytes 1GiB --n-iter 10 --no-detailed-report --report-gil-contention ... GIL contention | 0.832139790058136 ``` </details> Authors: - Peter Andreas Entschev (https://github.com/pentschev) Approvers: - Lawrence Mitchell (https://github.com/wence-) URL: #937
- Loading branch information