-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.Net - Agents Fix: Chat Concurrency (Step #ANY) (#5831)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Minimize locking / state management for `AgentChat` and `BroadcastQueue`. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> On re-evaluation w/ Sergey, we wanted to consolidate `BroadcastQueue` state and determine if this had an impact on locking semantics. While this did show some improvement, I traced the concurrency contract back into `AgentChat` and was able to establish a flow that eliminated the need for `BroadcastQueue._stateLock`. There exists zero contention for `BroadcastQueue._queues.` I've ran ran all tests, including my local concurrency performance harness that creates 3 agents with 3 separate channels and proceeds with over 100 turns while validating turn order. For this test, I ran the harness using Open AI Assistant Agents for maximum latency / queueing. Test execution quantitatively demonstrates lighter locking patterns. ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [X] The code builds clean without any errors or warnings - [X] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [X] All unit tests pass, and I have added new tests where possible - [X] I didn't break anyone 😄
- Loading branch information
Showing
3 changed files
with
256 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.