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

Make -q :: faster by calculating interactions on the fly instead of pre calculating them #2807

Merged
merged 57 commits into from
Feb 25, 2021

Conversation

olgavrou
Copy link
Collaborator

This PR affects only -q :: for now, could be extended to also work for --cubic :: in different PR.

We don't hold all possible interactions anymore but calculate them on the fly by keeping namespaces when they are found.
This should not affect explicit quadratics when passed

Could potentially improve more. Reduces run time for a ccb adf run with a file with 347k examples and 3 interactions (Action,Slot,User) from ~ 11m41s to ~ 1m50s

Copy link
Member

@jackgerrits jackgerrits left a comment

Choose a reason for hiding this comment

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

Looks great! Just a thought, should we test combining -q :: with explicit -q AB and other interactions --interaction AAA --interaction :::?

test/unit_test/ccb_test.cc Outdated Show resolved Hide resolved
vowpalwabbit/interactions_predict.h Outdated Show resolved Hide resolved
vowpalwabbit/example_predict.cc Outdated Show resolved Hide resolved
vowpalwabbit/interactions.cc Outdated Show resolved Hide resolved
@olgavrou
Copy link
Collaborator Author

Looks great! Just a thought, should we test combining -q :: with explicit -q AB and other interactions --interaction AAA --interaction :::?

Good idea about a mixed quadratics test, will add

@lalo
Copy link
Collaborator

lalo commented Feb 23, 2021

Relevant #1527

@lalo
Copy link
Collaborator

lalo commented Feb 23, 2021

We will need to update these docs (see bottom) https://github.com/VowpalWabbit/vowpal_wabbit/wiki/Feature-interactions

@olgavrou
Copy link
Collaborator Author

We will need to update these docs (see bottom) https://github.com/VowpalWabbit/vowpal_wabbit/wiki/Feature-interactions

Awesome thanks, I would not have noticed that

Added more tests to this, leaving it broken for now (tests timeout needs to be increased) since I am experiencing something strange for the latest tests: -q :: -interactions AAA --interactions :::. The interactions generated match exactly with those when run from master (seen from --invert_hash output) but their weights are ever so slightly different and I don't know why and if it should be a concern or not

@rajan-chari
Copy link
Member

Looks good.

@olgavrou olgavrou merged commit f47ac31 into VowpalWabbit:master Feb 25, 2021
@jackgerrits jackgerrits added this to the 8.10.0 milestone Jun 15, 2021
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.

5 participants