Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downstream next event tag (DNET), a new signal for more efficient centralized federated execution #349

Open
wants to merge 46 commits into
base: main
Choose a base branch
from

Conversation

byeonggiljun
Copy link
Collaborator

@byeonggiljun byeonggiljun commented Feb 5, 2024

This PR replaces #176 and #337.

Relevant discussion and issue: lf-lang/lingua-franca#1626, #264

A companion PR in lingua-franca: lf-lang/lingua-franca#2400
A companion PR in reactor-ts: lf-lang/reactor-ts#296

In this PR, the new message type, downstream next event tag (DNET), is introduced to reduce unnecessary NET signals. This signal is sent from the RTI to a federate to notify it that NET tags below some threshold are unnecessary, not needed by its downstream federates. Suppose the RTI is computing the DNET tag for a federate A where A has one downstream federate B. The tag is computed by the minimum delay between the federates and B's NET value. For example, if the delay from A to B is NEVER and B's next event is scheduled at (100 ms, 0), the RTI can send DNET (100 ms, 0) to A; if A sends NET (100 ms, 0) to the RTI, the RTI cannot send TAG (100 ms, 0), and if A sends NET (100 ms, 1), the RTI can grant TAG (100 ms, 0) to B.

Additionally, the RTI computes a tag of a tag advance grant (TAG) signal with the earliest incoming message tag (EIMT) to prevent blocking a federate that is eligible to advance its tag. Specifically, if a federate has its next event scheduled at (100 ms, 0) and its EIMT, calculated by the RTI, is (200 ms, 1), the RTI sends TAG (200 ms, 0) so that the federate can execute any potential events with tags earlier than (200 ms, 1) as well as the event at (100 ms, 0).

This PR also contains some refactoring for the data structure used by the RTI to store delays between federates. A two-dimensional matrix stores the delays now.

byeonggiljun and others added 21 commits January 31, 2024 14:14
…ery possible connection

This is a preparation step for the DNET message calculation. This matrix
enables each federate to search min_delays from upstreams as well as to downstreams.

Use a matrix instead of multiple arrays to store minimum delays of every possible connection

This is a preparation step for the DNET message calculation. This matrix
enables each federate to search min_delays from upstreams as well as to downstreams.
@byeonggiljun byeonggiljun added enhancement Enhancement of existing feature feature New feature federated labels Apr 22, 2024
Copy link
Contributor

coderabbitai bot commented Jun 25, 2024

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Tip

Early access features: enabled

We are currently testing the following features in early access:

  • OpenAI gpt-4o model for code reviews and chat: OpenAI claims that this model is better at understanding and generating code than the previous models. We seek your feedback over the next few weeks before making it generally available.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.
  • Please join our Discord Community to provide feedback and report issues.
  • OSS projects are currently opted into early access features by default.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@byeonggiljun byeonggiljun changed the title Draft: Introduce Downstream Next Event Tag message (DNET) to optimize the communication in centralized federated execution A new signal downstream next event tag (DNET) for more efficient centralized federated execution Aug 14, 2024
@byeonggiljun byeonggiljun changed the title A new signal downstream next event tag (DNET) for more efficient centralized federated execution Downstream next event tag (DNET), a new signal for more efficient centralized federated execution Aug 14, 2024
@byeonggiljun byeonggiljun force-pushed the rti-DNET branch 2 times, most recently from 121e21f to 79e2fdb Compare August 15, 2024 18:16
@byeonggiljun byeonggiljun marked this pull request as ready for review August 15, 2024 18:48
Copy link
Contributor

@edwardalee edwardalee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need more time to review this, but here is a starting point. This is looking very good so far. I have a few suggestions, some of which are just nits and you should feel free to ignore them. I will follow up with a more complete review as soon as I can.

core/federated/RTI/main.c Show resolved Hide resolved
core/federated/RTI/rti_common.c Outdated Show resolved Hide resolved
core/federated/RTI/rti_common.c Outdated Show resolved Hide resolved
core/federated/RTI/rti_common.c Outdated Show resolved Hide resolved
core/federated/RTI/rti_common.c Outdated Show resolved Hide resolved
core/federated/RTI/rti_common.h Outdated Show resolved Hide resolved
core/federated/RTI/rti_common.h Outdated Show resolved Hide resolved
core/federated/RTI/rti_common.h Outdated Show resolved Hide resolved
core/federated/RTI/rti_common.h Outdated Show resolved Hide resolved
core/tag.c Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing feature feature New feature federated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants