-
Notifications
You must be signed in to change notification settings - Fork 38
Question. Why not return a fresh task every run? #60
Comments
The reason I had set the task to stop in the parallel case is because, at least at that time, it was not possible to serialize tasks (I haven't checked Julia's base since then, so it may be possible by now to serialize them). I am not sure whether you refer to the returned chain, which holds a task field; if so, the task field will be dropped altogether from the returned chain, see my fork of MCMC.jl, where the whole type system for MCMC has been altered quite a lot. Although the core changes have been achieved in the updated implementation of my fork, I haven't merged them because I haven't ported all the samplers yet. Perhaps I could possibly disable some existing samplers in order to merge, so that everyone can be on the same page with the new MCMC interface and code (for ex there is not much point for you to put this effort on the basis of an old-to be redundant type system, you'd rather use the new one to write up the Gibbs sampler you want to contribute). @fredo-dedup, would it be a sensible senario to merge the changes I have made disabling temporarily some samplers (not the most common ones that are ready pretty much)? |
@scidom wow, thanks for the heads up. I just had a look at your fork and looks like you have done a lot of work refactoring. I'd love to base my Gibbs sampler off the codebase in your brach. Should I pull your master and rebase my work off it? Or, should we wait for @fredo-dedup to see if we can get your version merged before I work off of it? |
Yes, from my side feel free to pull off my master to work on Gibbs, in fact I am happy if you find the new (inter)face of MCMC cleaner and more practical. In any case we will merge the changes in due time, so I think you are safe to base your work on my fork. Let's see what @fredo-dedup thinks about a "premature" merge of my fork to make sure all involved Julian parties are happy :) I should finish the porting very soon, was held a bit behind due to a small health issue with eyes due to excessive computer use. |
With a bit of an extra self-push, I ported the acceptance rejection sampler, so I got 8 out of the 11 samplers ported; I now have 3 left, namely the important NUTS sampler and the less important in widely-used applications RMHMC and MMALA (I am not sure we really need these 2 right now but for the sake of completeness I will port them too). I promise I will get everything done by the coming Friday so that we can merge. |
Hi @scidom, |
Yeap, tasks are very helpful as you introduced them in our package more than a year ago, and I would never drop them! Basically, what I had done on that respect was to specify Job types, such as tasked and plain jobs; this gives fine-grained control allowing the user to choose whether he wants to run his MCMC with or without tasks. Since I have your approval, I will then merge the code; I will do this by tomorrow the latest, in order to make some more small additions. After this, I will write up elaborate "readthedocs" documentation, so that we can all be on the same page with the package updates. |
Hi @scidom I'd been trying if I could get scidom/MCMC.jl to run for the slice sampler, but that doesn't work yet on my system:
This is on Julia v0.3.2. I'll try again after you merge the changes. As of this morning ARS1 and ARS2 indeed work fine, you beat me to that! But still, a good way to study your improvements.
|
Cheers @goedman, yes, I know, I haven't updated most of the tests to reflect the syntax updates. I updated the slice sampler test and pushed the relevant changes to my fork, you may try it now, it should work. I will do a little more work tonight before I merge everything to our JuliaStats MCMC package. |
Just to keep you up to speed informally, I dropped the model specification syntax based on * operator overloading. There are 3 alternatives
It is still possible to specify a bunch of MCMC simulations; this can be done by using the MCSystem syntax instead of the older one based on the * opearator. I will update the README to shortly explain all these. |
Thanks @scidom . Works fine now! |
You're welcome @goedman. |
I merged the major updates. The test failure is due to the separate recent issue with the ArrayViews.jl package. I still need to port more code, but all the basic functionality is available. I didn't want to hinder progress of any Julia user or developer who wants to contribute to MCMC, this is why I pushed this forward without waiting for the whole codebase to be ported. @spencerlyon2 you should be able now to proceed with the Gibbs sampler coding. |
@scidom This is great. Thanks for pushing this through so quickly. I will base my Gibbs code on the current master. I will probably submit a rfc soon. I have made some design decisions that makes the Gibbs model feel/work different than the likelihood model we currently have and am open to any suggestions that could make my code fit more harmoniously with the likelihood based code. Thanks again and you'll hear from me shortly. |
Closed as no longer as relevant with new api. If we feel this issue should be addressed again under new code base at can reopen |
Sure, @spencerlyon2, I would be very happy to see your PR for the Gibbs sampler and how you decided to software-engineer it. I agree that the existing likelihood-based model is somewhat orthogonal to the needs of a Gibbs sampling scheme, so we are certainly open to new ideas, hoping that their fusion will amplify the potential of the package. |
@spencerlyon2 i am sorry about this, but I needed to make yet a minor change in the code base. The
I promise that the dust has settled and you won't be seeing any other major code changes for a while. |
@scidom, no problem. I was about to submit a PR, but I'll adjust my code before submitting. When I do open the PR it will be at a 70% done level and I'm hoping we can iterate together on converging to the optimal way to describe a Gibbs sampler. |
Also I have some questions. Is there an easier way to chat about some design things? Perhaps google hangouts or a skype chat. I'm thinking IM rather than video call, but it would be helpful to me to talk in a bit more interactive way (that also doesn't generate so many notifications for others). If you have some time and access to a technology like that I think it would make my process for learning the new api a bit smoother. |
Thanks very much for your patience with the ongoing updates the last few days, it is appreciated. I am sure that we will manage to get the Gibbs sampler in a good shape after discussing over your forthcoming PR. Sure, you may reach me at theodore dot papamarkou at gmail dot com if you would like to use Google hangout. I have up to 30 mins free now as we will be spending time with my wife in a bit; if you are free now for a short chat, that would be great, otherwise we could arrange it tomorrow evening. |
I am working on writing a generic Gibbs sampler that shares design principles with the code here. (the WIP is on the gibbs branch of my fork)
I was wondering why we don't always return a fresh task after running a chain? Specifically, I noticed that a task is stopped before being returned in parallel (
run_serialmc_exit
), but not if you run in serial. Unless I'm mistaken this is just a way to tell Julia that it is ok to serialize the task so it can be returned from another process.When I wrote a simple random walk metropolis routine I found that it was easier to always spin a new task at the end of running a chain (in serial or in parallel) because that way the task is always ready to resume (again, in serial or in parallel). I found that I could get the task to resume at the same place without losing any samples simply by consuming the task one more time to find a new
model.init
value, spinning a new task with that updatedmodel
, then making sure that the firstproduce
in the sampler wasmodel.init
.Is there a reason we don't do that here?
The text was updated successfully, but these errors were encountered: