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

fix: Warm up Orchestrator build cache from previous Composer session #6550

Merged
merged 20 commits into from
Mar 30, 2021

Conversation

taicchoumsft
Copy link
Member

Description

If there are embeddings (in .blu files) from a previous Composer session, we can use them to warm up the Orchestrator LabelResolversCache. This dramatically speeds up subsequent build times in a cold Composer session.

If Orchestrator isn't used, the warmup does nothing.

Task Item

closes #6481

@taicchoumsft taicchoumsft requested a review from lei9444 March 25, 2021 07:26
@taicchoumsft taicchoumsft changed the title fix: Warm up Orchestrator build cache if possible fix: Warm up Orchestrator build cache from previous Composer session if possible Mar 25, 2021
@taicchoumsft taicchoumsft changed the title fix: Warm up Orchestrator build cache from previous Composer session if possible fix: Warm up Orchestrator build cache from previous Composer session Mar 25, 2021
tsuwandy
tsuwandy previously approved these changes Mar 25, 2021
);

return modelData.model && snapshotData.length
? await Orchestrator.getLabelResolversAsync(modelData.model, '', new Map(snapshotData), false)
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume this matches the lu object id "f.replace('.blu', '.lu')" pass in the buildAsync method, correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, these are also the ids we get back from the results object from buildAsync,

@coveralls
Copy link

coveralls commented Mar 25, 2021

Coverage Status

Coverage increased (+0.1%) to 52.098% when pulling 78c2946 on tachou/orchColdBootOptimization into cf42c73 on main.

@boydc2014
Copy link
Contributor

boydc2014 commented Mar 26, 2021

By code session, we mean, maybe it was closed before, right? If for a hot session, we will just memorize that in memory, is that correct?

@taicchoumsft
Copy link
Member Author

taicchoumsft commented Mar 26, 2021

By code session, we mean, maybe it was closed before, right? If for a hot session, we will just memorize that in memory, is that correct?

Yes, that is right. This cache warmup is only for when user has trained Orchestrator in a previous session, then closed Composer, then re-opened it. If the user is in the same hot session, we use the existing in-memory cache logic.

@lei9444
Copy link
Contributor

lei9444 commented Mar 30, 2021

Tested it and LGTM

@boydc2014 boydc2014 merged commit 968db73 into main Mar 30, 2021
@boydc2014 boydc2014 deleted the tachou/orchColdBootOptimization branch March 30, 2021 05:34
@cwhitten cwhitten mentioned this pull request May 20, 2021
lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
…icrosoft#6550)

* Update orch package

* initial implementation

* Tighten up code and exception handling

* Unit tests

* Fix linter errors

* Don't rethrow error for cache - safe to continue on

* Fix build error of worker script when testing

Co-authored-by: Dong Lei <[email protected]>
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.

Orchestrator: Initialize LabelResolverCache from blu files when in a new Composer Session
5 participants