Skip to content

Conversation

@MasterJH5574
Copy link
Contributor

This PR reduces the number of reads and writes for the message queue of ProcessSession and ThreadSession in Disco by caching all the data to read/write.

The message queue in ThreadSession prior to this PR grabs the mutex for multiple times for a batch of data to read/write. This PR enables to read/write data from/to a local buffer first, and then read/write from/to the critical region together. This reduces the number of grabbing mutex to once.

The message queue in ProcessSession prior to this PR reads/writes the inter-process pipe for multiple times for a batch of data. This PR uses a local buffer to cache all the data first, and then issues a single read/write from/to the pipe, and effectively reduces the number of reads/writes to the pipe, which may causes extra system overhead.

This PR reduces the number of reads and writes for the message queue
of ProcessSession and ThreadSession in Disco by caching all the data
to read/write.

The message queue in ThreadSession prior to this PR grabs the mutex
for multiple times for a batch of data to read/write. This PR enables
to read/write data from/to a local buffer first, and then read/write
from/to the critical region together. This reduces the number of
grabbing mutex to once.

The message queue in ProcessSession prior to this PR reads/writes
the inter-process pipe for multiple times for a batch of data.
This PR uses a local buffer to cache all the data first, and then
issues a single read/write from/to the pipe, and effectively reduces
the number of reads/writes to the pipe, which may causes extra
system overhead.
@MasterJH5574
Copy link
Contributor Author

@tvm-bot rerun

@tqchen tqchen merged commit ca99a98 into apache:main Apr 2, 2024
thaisacs pushed a commit to thaisacs/tvm that referenced this pull request Apr 3, 2024
…pache#16817)

This PR reduces the number of reads and writes for the message queue
of ProcessSession and ThreadSession in Disco by caching all the data
to read/write.

The message queue in ThreadSession prior to this PR grabs the mutex
for multiple times for a batch of data to read/write. This PR enables
to read/write data from/to a local buffer first, and then read/write
from/to the critical region together. This reduces the number of
grabbing mutex to once.

The message queue in ProcessSession prior to this PR reads/writes
the inter-process pipe for multiple times for a batch of data.
This PR uses a local buffer to cache all the data first, and then
issues a single read/write from/to the pipe, and effectively reduces
the number of reads/writes to the pipe, which may causes extra
system overhead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants