This is an archive of the discontinued LLVM Phabricator instance.

[libc] Remove 'try_open' from the client interface
ClosedPublic

Authored by jhuber6 on Aug 20 2023, 7:35 AM.

Details

Summary

We previously provided the try_open facility to indicate if opening a
port failed. This is used on the server to continuously poll and quit if
there is no work. However the Client currently has no way to recover
from not finding a port and simply spins repeatedly. The abstraction
here costs us some resources. This patch changes the interface to only
allow open on the client side and merges the loops. This saves us a
branch and a good number of registers.

Diff Detail

Event Timeline

jhuber6 created this revision.Aug 20 2023, 7:35 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 20 2023, 7:35 AM
jhuber6 requested review of this revision.Aug 20 2023, 7:35 AM
jhuber6 updated this revision to Diff 551832.

Forgot to remove the function

JonChesterfield accepted this revision.Aug 20 2023, 8:28 AM

The can't run out of ports because more are available than hardware resources doesn't really work with fewer ports than hardware resources, but that's an existing problem

This revision is now accepted and ready to land.Aug 20 2023, 8:28 AM
jhuber6 updated this revision to Diff 551847.Aug 20 2023, 8:39 AM

The hardware resource limit isn't something that's enforced yet. Right now we
just set it to the maximum amount of memory we allocate, which is 512. I believe
most GPUs will need more like 2048 to cover all hardware resources. We'll work
on that later once we have a smarter port allocation scheme. For now we would
probablyt replace the initialize at zero with the sm-id as a cheap way to
stagger them out. The smid can change during execution so it's not a perfect
solution.

This revision was automatically updated to reflect the committed changes.