[libc-commits] [libc] [libc] Increase the maximum RPC port size for future hardware (PR #188756)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Thu Mar 26 07:30:29 PDT 2026


https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/188756

Summary:
We store the locks in local device memory for performance and
simplicity. The number here needs to correspond to the maximum occupancy
so that we never have a situation where a GPU thread is blocking another
GPU thread.

The number now is sufficient for most hardware, but modern compute chips
like the MI300x are already pushing ~12000 resident waves. This has ABI
impliciations so I'd like to bump it up sooner rather than later. The
ABI change is within what OpenMP expects, LLVM major versions, and it
will be caught statically so there's no risk of silent corruption (size
doesn't match).


>From b15c1cdbda0a0d4061bd353b98b17bf050dddec5 Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Thu, 26 Mar 2026 09:26:38 -0500
Subject: [PATCH] [libc] Increase the maximum RPC port size for future hardware

Summary:
We store the locks in local device memory for performance and
simplicity. The number here needs to correspond to the maximum occupancy
so that we never have a situation where a GPU thread is blocking another
GPU thread.

The number now is sufficient for most hardware, but modern compute chips
like the MI300x are already pushing ~12000 resident waves. This has ABI
impliciations so I'd like to bump it up sooner rather than later. The
ABI change is within what OpenMP expects, LLVM major versions, and it
will be caught statically so there's no risk of silent corruption (size
doesn't match).
---
 libc/shared/rpc.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libc/shared/rpc.h b/libc/shared/rpc.h
index 81cf9fc2c6d3f..644d1bbf10208 100644
--- a/libc/shared/rpc.h
+++ b/libc/shared/rpc.h
@@ -69,7 +69,9 @@ struct Header {
 };
 
 /// The maximum number of parallel ports that the RPC interface can support.
-constexpr static uint64_t MAX_PORT_COUNT = 4096;
+/// This should be greater than the expected hardware's occupancy to ensure the
+/// interface is non-blocking.
+constexpr static uint64_t MAX_PORT_COUNT = 16384;
 
 /// A common process used to synchronize communication between a client and a
 /// server. The process contains a read-only inbox and a write-only outbox used



More information about the libc-commits mailing list