[libc-commits] [PATCH] D148288: [libc] Update RPC interface for system utilities on th GPU
Joseph Huber via Phabricator via libc-commits
libc-commits at lists.llvm.org
Thu Apr 13 19:38:59 PDT 2023
jhuber6 created this revision.
jhuber6 added reviewers: JonChesterfield, jdoerfert, tianshilei1992, michaelrj, lntue, sivachandra, tra, gchatelet.
Herald added subscribers: libc-commits, kosarev, mattd, asavonic, ecnelises, kerbowa, tschuett, jvesely.
Herald added projects: libc-project, All.
jhuber6 requested review of this revision.
This patch reworks the RPC interface to allow more generic memory
operations using the shared better. This patch decomposes the entire RPC
interface into opening a port and calling `send` or `recv` on it.
The `send` function sends a single packet of the length of the buffer.
The `recv` function is paired with the `send` call to then use the data.
So, any aribtrary combination of sending packets is possible. The only
restriction is that the client initiates the exchange with a `send`
while the server consumes it with a `recv`.
The operation of this is driven by two independent state machines that
tracks the buffer ownership during loads / stores. We keep track of two
so that we can transition between a send state and a recv state without
an extra wait. State transitions are observed via bit toggling, e.g.
This interface supports an efficient `send -> ack -> send -> ack -> send`
interface and allows for the last send to be ignored without checking
the ack.
A following patch will add some more comprehensive testing to this interface. I
I informally made an RPC call that simply incremented an integer and it took
roughly 10 microsends to complete an RPC call.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D148288
Files:
libc/src/__support/OSUtil/gpu/io.cpp
libc/src/__support/OSUtil/gpu/io.h
libc/src/__support/OSUtil/gpu/quick_exit.cpp
libc/src/__support/RPC/rpc.h
libc/startup/gpu/amdgpu/start.cpp
libc/startup/gpu/nvptx/start.cpp
libc/utils/gpu/loader/CMakeLists.txt
libc/utils/gpu/loader/Server.h
libc/utils/gpu/loader/amdgpu/CMakeLists.txt
libc/utils/gpu/loader/amdgpu/Loader.cpp
libc/utils/gpu/loader/nvptx/CMakeLists.txt
libc/utils/gpu/loader/nvptx/Loader.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148288.513414.patch
Type: text/x-patch
Size: 23949 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230414/6229506d/attachment-0001.bin>
More information about the libc-commits
mailing list