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

[FEA] Need a way to block on segment initialization #68

Closed
dagardner-nv opened this issue Jun 25, 2022 · 5 comments
Closed

[FEA] Need a way to block on segment initialization #68

dagardner-nv opened this issue Jun 25, 2022 · 5 comments
Labels
feature request New feature or request

Comments

@dagardner-nv
Copy link
Contributor

Is your feature request related to a problem? Please describe.
In Morpheus we need a way to block until the segment initializer has been called.
nv-morpheus/Morpheus#188

Currently Morpheus is building the pipeline with:

self._srf_pipeline.make_segment("main", inner_build)

self._srf_executor.register_pipeline(self._srf_pipeline)

self._is_built = True

The problem is that inner_build is called asynchronously and we need a way to wait until after inner_build is called.

Describe the solution you'd like
Probably some sort of blocking call that we can make like:
wait_for_segment_init

Additional context
In Morpheus we don't have the full detail of the messages passed between nodes until the pipeline is fully built, which doesn't happen until the segment initialize is called.

@dagardner-nv dagardner-nv added the feature request New feature or request label Jun 25, 2022
@ryanolson
Copy link
Contributor

It is not safe to assume that every segment defined in a pipeline will be instantiated.

If the primary motivation here is to generate a viz file, we should be able to do it from the pipeline definition and proto serialization; however, in the case of python, we not be able to generate full type information.

@dagardner-nv
Copy link
Contributor Author

@ryanolson doesn't calling Executor.start() require that all the segment initializers are called?

@ryanolson
Copy link
Contributor

For the standalone / single node executor, that is indeed what happens.

But it is not generally true. If you had a two segment, two machine pipeline with segment A on machine A and segment B on machine B, the local executor would only ever construct/initialize A or B.

@dagardner-nv
Copy link
Contributor Author

From Morpheus' perspective then, we would always know which specific segment we are interested in. So in the above example:

self._srf_pipeline.make_segment("main", inner_build)
self._srf_executor.register_pipeline(self._srf_pipeline)

self._srf_pipeline.wait_for_segment_init("main")
self._is_built = True

@mdemoret-nv
Copy link
Contributor

I agree with @ryanolson. You never know if the initializer is going to be called or not. The only thing you can do is await on start().

I think we should close this issue as wontfix. The better solution is to handle this in morpheus with nv-morpheus/Morpheus#84

ghost pushed a commit to nv-morpheus/Morpheus that referenced this issue Jun 28, 2022
Adds a busy-loop to block until pipeline build is completed.
Fixes #188

Ideally nv-morpheus/MRC#68 would provide a better way to do this.

Authors:
  - David Gardner (https://github.com/dagardner-nv)
  - Michael Demoret (https://github.com/mdemoret-nv)

Approvers:
  - Michael Demoret (https://github.com/mdemoret-nv)

URL: #203
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants