-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Including RulePolicy
leads to infinite max_history being used to deduplicate training trackers
#8295
Comments
one can read rules first, calculate the length of the longest rule, then use it as rulepolicy’s effective max_history which can be compared with max_history of other policies to calculate unique_last_num_states limit for deduplication of generated trackers |
RulePolicy
leads to infinite max_history being used to determine story conflictsRulePolicy
leads to infinite max_history being used to deduplicate training trackers
@melindaloubser1 I tried to reproduce this on Sara but the validation is super quick. Note that the I also don't see how max history should be a big deal in my opinion as rules are somewhat enforced to be very short anyway. cc @JEM-Mosig |
And from what I can see from the code the included policies shouldn't matter for |
No you're right; I'm thinking I miswrote this and it applies only to loading during |
@wochinge I explored the relevant code parts and I agree with automatically setting |
Can't we loop over the |
Yeah, fair, that's what would need to happen... Like this, right?
What about batches, though? I think we'd like to use the same number of turns for tracker deduplication across batches. And perhaps we can say that rule data won't come in batches, but story data will... Maybe we'd need an "initial" pass through the data to determine things like this |
We can even do this during I don't understand the part about the batches. The |
I think this doesn't work because we use the determined
Fair, we call these "chunks", not "batches". I know that |
We do but that they can just use whatever
I think you made an excellent point here. |
Hm, fair point, I didn't think about it this way. I worried about it because right now we load & de-duplicate all the Core data at once, for all policies, and so all policies receive trackers that have been de-duplicated using the same |
I'm not sure that I understand this. Are you saying that all policies must have the same |
I'm getting lost in my own thoughts and am making mistakes along the way, sorry. I'll try to backtrack and clarify:
I'll go back to:
I agree with this. I guess what I had in mind is the fact that we load and de-duplicate all trackers (rules, stories) together. If we can process rules vs stories a bit separately, then I can totally imagine a scenario where we:
I hope I made things a bit clearer now, sorry for the convoluted thoughts in my earlier replies... |
Yes, you did! Rule trackers are already deduplicated separately. I'll do some debugging later to find out where we spend so much time exactly (during deduplication or featurization) and then maybe a PR so we have something more tangible to discuss. |
Oh, no, I completely overlooked the separation in the code. I learned something new today... |
Investigation results on
A quick fix for this issue would to use lru_cache (with |
@wochinge wow, these are very interesting findings! Btw have you uploaded the right profiling results? In these ones, I don't see I agree with creating a separate issue for the root cause. As for the quick fix using caching, do you think it's safe with regards to Rasa's usage of RAM? If the usage stays below the kind of magnitudes we require for actually training the policies, then it sounds good to me and it would definitely make people's lives (mine included) easier -- way before we get to address the actual cause. Aaand I'm especially curious about the details around this:
|
Sorry, it was the wrong link 🙈 Updated it with the correct one 👍🏻
We can set a So next steps:
|
Ah, okay, makes sense. I'm also getting such errors when I use only |
Posting the details for the memory usage here as I haven't created the PR yet and need to put the results somewhere 😄
|
Rasa version: 2.4.1
Issue:
When rules/RulePolicy are included in dialogue management, in order to check for conflicts with stories, effectively infinite max_history is used. This greatly increases the time it takes to load and process dialogue data.
Command or request that led to error:
edit train, not validate
Definition of Done
max_history
to lowest possible duringrasa train core
based on the training dataThe text was updated successfully, but these errors were encountered: