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

Reduced the number of channels between service and process #1

Merged
merged 2 commits into from
Jan 5, 2022

Conversation

ysingh7
Copy link
Collaborator

@ysingh7 ysingh7 commented Dec 17, 2021

Issue Number: Remove hacks and refactor Runtime and RuntimeService/Synchronizer lava-nc#86

Objective of pull request: Reduced the number of channels between service and process

Pull request checklist

Your PR fulfills the following requirements:

  • [X ] Issue created that explains the change and why it's needed
  • Tests are part of the PR (for bug fixes / features)
  • Docs reviewed and added / updated if needed (for bug fixes / features)
  • [X ] PR conforms to Coding Conventions
  • PR applys BSD 3-clause or LGPL2.1+ Licenses to all code files
  • Lint (pyb) passes locally
  • Build tests (pyb -E unit) or (python -m unittest) passes locally

Pull request type

Please check your PR type:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • [X ] Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation changes
  • Other (please describe):

What is the current behavior?

  • Currently we have five channels between runtime service and process model.
    1. Used for sending cmd from RS to PM
    1. Used for sending ack back from PM to RS
    1. Used for sending READ/WRITE Req from RS to PM
    1. Used to send write data from RS to PM
    1. Used to send read data from PM to RS

What is the new behavior?

  • Reduces the number of channels between runtime service and process model. Also it removes the notion of time step from the runtime.
    1. One way channel for all cmd/get-set-req/data from RS to PM
    1. One channel for all ack/data from PM to RS

Does this introduce a breaking change?

  • Yes
  • No

Supplemental information

@ysingh7 ysingh7 self-assigned this Dec 17, 2021
Copy link

@PhilippPlank PhilippPlank left a comment

Choose a reason for hiding this comment

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

Good start I think, please look at my comments.

tests/lava/magma/runtime/test_get_set_var.py Show resolved Hide resolved
@@ -129,7 +128,6 @@ def test_get_set_var_using_var_api(self):
process.run(condition=RunSteps(num_steps=5), run_cfg=run_config)
assert np.array_equal(process.u.get(), expected_result_u)
assert np.array_equal(process.v.get(), expected_result_v)
self.assertEqual(process.runtime.global_time, 15)

Choose a reason for hiding this comment

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

Same as above, compare with the time step in ProcModel

@@ -59,7 +59,6 @@ def test_synchronization_single_process_model(self):
run_config = SimpleRunConfig(sync_domains=[simple_sync_domain])
process.run(condition=RunSteps(num_steps=10), run_cfg=run_config)
process.run(condition=RunSteps(num_steps=5), run_cfg=run_config)
self.assertEqual(process.runtime.global_time, 15)

Choose a reason for hiding this comment

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

Same

exe: Executable,
message_infrastructure_type: ActorType):
self._run_cond: AbstractRunCondition = run_cond
self._run_cond: typing.Optional[AbstractRunCondition] = None

Choose a reason for hiding this comment

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

Why is the RunCondition optional? This internal RunCondition is and was not used by the Runtime, as far as I can see. I think we do not need it, correct?

@joyeshmishra joyeshmishra merged commit 270be3c into main Jan 5, 2022
ysingh7 added a commit that referenced this pull request Jan 13, 2022
…-nc#157)

* Reduced the number of channels between service and process (#1)

* Reduced the number of channels between service and process

* Fixed the bug with failing monitor cases

* Reduce the number of channels to communicate between runtime and runtime_service

* Fix flake8 related issues

* Fix flake8 related issues

Co-authored-by: Joyesh Mishra <joyesh.mishra@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants