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

Run evaluation in a separate process when using HTTP API #1778

Merged
merged 24 commits into from Apr 11, 2019

Conversation

MetcalfeTom
Copy link
Contributor

@MetcalfeTom MetcalfeTom commented Mar 12, 2019

Fixes #1733

Proposed changes:

  • Check if the router has any idle processes, if so run rasa_nlu.test in that thread using the model path and return the results

Status (please check what you already did):

  • made PR ready for code review
  • added some tests for the functionality
    - [ ] updated the documentation
  • updated the changelog

@codeclimate
Copy link

codeclimate bot commented Mar 12, 2019

Code Climate has analyzed commit 3f667d4 and detected 3 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 3

View more on Code Climate.

@MetcalfeTom MetcalfeTom requested review from wochinge and ricwo and removed request for wochinge April 1, 2019 14:28
Copy link
Contributor

@ricwo ricwo left a comment

Choose a reason for hiding this comment

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

Nice work 👍 The number of workers in the process pool used to be determined only by the training processes, but now evaluation makes use of the pool in the same way. I think it would be good to rename the Data Router kwarg to something like max_process_pool_workers and similarly adjust something like current_pool_processes in the evaluation and training process. What do you think?

CHANGELOG.rst Outdated Show resolved Hide resolved
rasa/nlu/data_router.py Outdated Show resolved Hide resolved
rasa/nlu/data_router.py Outdated Show resolved Hide resolved
rasa/nlu/data_router.py Outdated Show resolved Hide resolved
rasa/nlu/data_router.py Outdated Show resolved Hide resolved
tests/nlu/base/test_server.py Outdated Show resolved Hide resolved
tests/nlu/base/test_server.py Outdated Show resolved Hide resolved
tests/nlu/base/test_server.py Outdated Show resolved Hide resolved
tests/nlu/base/test_server.py Outdated Show resolved Hide resolved
tests/nlu/base/test_server.py Outdated Show resolved Hide resolved
rasa/nlu/data_router.py Outdated Show resolved Hide resolved
rasa/nlu/data_router.py Outdated Show resolved Hide resolved
rasa/nlu/data_router.py Outdated Show resolved Hide resolved
rasa/nlu/data_router.py Outdated Show resolved Hide resolved
Copy link
Contributor

@wochinge wochinge left a comment

Choose a reason for hiding this comment

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

Great work @MetcalfeTom . Left a few comments regarding the debug statements, but looks good otherwise!

@MetcalfeTom MetcalfeTom requested a review from ricwo April 10, 2019 12:30
Copy link
Contributor

@ricwo ricwo left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the comments, looks great 💯 !

From reading over the changes again, do you think calling the new "pool" attributes and classes "worker" processes instead would make more sense? To me this sounds a bit more idiomatic but I don't mind too much. so e.g. MaxWorkerProcessError, self.worker_processes, self.current_worker_processes. To me "pool" is very much a python multiprocessing term and "worker" sounds more general

@MetcalfeTom
Copy link
Contributor Author

Agreed that it's a better term

rasa/nlu/data_router.py Outdated Show resolved Hide resolved
CHANGELOG.rst Outdated Show resolved Hide resolved
@MetcalfeTom MetcalfeTom merged commit 6cc006f into master Apr 11, 2019
@MetcalfeTom MetcalfeTom deleted the eval_model_unload_fix branch April 11, 2019 12:35
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.

None yet

3 participants