-
Notifications
You must be signed in to change notification settings - Fork 44
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
Mode solver run_batch
#1685
Mode solver run_batch
#1685
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a few comments so that we remove any changes to the local mode solver.
Thanks for the explaining the detailed process and taking care of this. Next time it will be a lot smoother :) |
No Problem. I think I forgot to checkout the CHANGELOG. Should be all set now. can you do one more check to makes sure I got everything? then maybe we can simply merge this one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great after a final check! Once it is merged to pre/2.7, I will pull it and run some mode solver tests with it just to be 100% sure before the release. Thank you.
Hey @prashkh i noticed the mode solver test is failing on this branch. Any idea why? |
it seems like it is failing in this step. Not sure why since this works fine on my local machine.
E assert False |
Could it be that we need to do |
1f78ab9
to
35a29f8
Compare
That's weird. Also passed for me, but there are 125 warnings, so not sure about that. Let's see if it passes this time? hopefully it doesn't indicate some issue. |
6274118
to
da6dc38
Compare
I wonder if something is wrong with the |
In the Another idea is to try to do this same thing with joblib. I can implement this today. |
@prashkh One other thing I noticed is that the default folder handling here is probably not ideal. It automatically creates a directory and separate folder on the web UI when running batch. I'd say maybe it's better to leave the defaults? just my preference / impression though, maybe some users would like this. |
I think if |
@momchil-flex Converted to joblib and used 'threading' as backend. It works fine locally so let's see if this fixes it. @tylerflex I also left the save directory to default as per your suggestion. Could you please help me check if this looks reasonable and if this passes the tests now during merging. Only this function and the import needs to be changed.
|
@tylerflex I found the problem. When verbose=False, we don't need to update the pbar since it is None :). Committed with this change after checking it runs fine locally. Could you please try to merge and see if it passes. Thank you! |
1c16469
to
c5b3166
Compare
Thanks @prashkh ! Yea these rich errors can be a bit hard to debug.. I rebased this branch against the latest |
@prashkh. shoot, looks like it's still failing Could you look into it? Important note: I force pushed to this branch, so to get the changes you'd need to
to reset your local copy to the one I pushed here. |
@tylerflex I reset the local copy and ran it locally and it works fine. I think the problem is that when running pytest it is asking for API access to run mode solver. How does this work for pytest?
|
@dbochkov-flexcompute @lucas-flexcompute Sorry to bother you, but we're trying to get this mode solver I spend a good amount of time trying to fix it but I think there's something I'm not understanding. It looks like both of you worked on these mocked tests for the regular mode solver run. Do you mind taking a look and modifying to make them work with batch mode solver if you get a chance? |
I've added the missing response to the tests, but I'm not sure you'll want to keep it separate to the existing one or change the |
I also don't see an explicit test function for |
thanks @lucas-flexcompute ! @prashkh there are a set of tests for
Unfortunately, in my experience, you never really know eg. if joblib upgrades and then changes behavior slightly, things could still break. So while it's a bit of extra effort, mocking the web API at least can help us isolate the issue to the |
Another consideration is testing speed, even with mock responses and data for everything in these tests, they take almost 10 minutes to finish. We also need to run them probably a dozen times a day, pretty much whenever a PR changes. if we ran the real web API, it would probably take hours to finish and use a ton of credits. |
That makes sense! So, if |
So In principle it would be enough to just test
So when we call the web API, we basically send a dictionary to some URL and get a dictionary back from the server. The web API mocking basically interrupts this process and so whenever you send a specific dictionary, it just immediately returns some "mock" data without actually making the call. The mode solver mocking does this for all of the sub-steps of I think the problem was that the dictionary sent out in the batch one had different fields from the single mode solver (eg the folder name) so the mocking was getting confused. Basically we couldn't use the same mocking function for both single and batch mode solver. This is what I was trying to figure out unsuccessfully yesterday. Basically you can think of the two mocks as the same, but they're matching on the different data sent out by the batched mode solver and the regular one. Does that clear it up? |
54c1f7b
to
dd1b6ad
Compare
@prashkh I'm going to try to get this feature in soon. Could you take one last look over the files changed and verify it's looking ok and then assuming all tests pass, I'll merge it. |
dd1b6ad
to
e018b63
Compare
Thanks for the explanation on the mock api. It makes sense! Also seems like the tests were passed!! Let me check it one more time locally and we are all good :) |
@tylerflex I just tested it locally and the code looks good. Seems like all checks were passed as well so all good now. Thank you! |
Awesome congrats on your first contribution! 🎉 . sorry it was a little rocky with the testing there. |
Thanks for all the help! |
@prashkh I took the changes from your batch (minus all of the
black
formats) and put them into this branch.If you'd like, I can edit your branch to put it in this state so you can wrap it up?
btw the basic idea was:
prash/mode/batchsolver2
pre/2.7
and "dropped" the 2nd commit (with the changes and alsoblack
formatting)git checkout prash/mode/batchsolver2 -- file1 file2 ...
all of the files related to the mode solver that you changed.you could either try something similar on your branch or I could try to do it manually for you. hopefully that makes sense and let me know how you want to proceed
(and no worries about this, I've done it many times). Usually before I run black, I make sure I have all of my actual changes commited, that way if this ends up happening, I can simply drop the black commit.