On Friday, October 31, 2014 12:06:04 AM UTC-5, Sam L wrote:
>
> I tried calling XtWXXtWZ! with a Distribution object e.g. Bernoulli() 
> instead of a type, likewise for Link, as in
>         XtWXXtWz!(XtWX,XtWz,Xt,β,y,wt,Bernoulli(),LogitLink())
>  and changing the appropriate lines to
>            μ = linkinv(*typeof*(L),η)
>         μη = dμdη(*typeof*(L),η)
>         W = wt[i] * abs2(μη) / var(*typeof*(D),μ)
> and that seemed to do the trick.(Also had to change the argument checking 
> line at the top.) 
>
> I'm not exactly sure why.  I guess it may be because Bernoulli and 
> LogitLink are of type DataType, so XtWXXtWZ! isn't specialized for 
> different values causing calls to linkinv, d\mud\eta, and var to not get 
> inlined.  Or something like that...
>

Yes, exactly.  I should have thought of that.  Thanks for looking at it. 

>
> I think it would also work to write linkinv, d\mud\eta and var to dispatch 
> on ::T instead of ::Type{T}, and then you could get rid of the calls to 
> typeof()
>
>
> On Thursday, October 30, 2014 2:52:15 PM UTC-7, Tim Holy wrote:
>>
>> Did you try julia --track-allocation=user (or all, if necessary)? See the 
>> docs: 
>> http://docs.julialang.org/en/latest/stdlib/base/#Base.clear_malloc_data 
>>
>> --Tim 
>>
>> On Thursday, October 30, 2014 02:16:37 PM Douglas Bates wrote: 
>> > I haven't finished with the notebook 
>> > 
>> > 
>> http://nbviewer.ipython.org/github/dmbates/JuliaWorkshop/blob/master/Paralle 
>> > lGLM.ipynb 
>> > 
>> > but, unfortunately, must turn my attention to something else.  I'll get 
>> > back  to it tomorrow.  In the meantime, if someone has a hint as to 
>> where 
>> > the memory allocation is happening in the wonderfully named XtWXXtWz! 
>> > function I would appreciate hints.  I assumed that all the one-liner 
>> > Base.var, linkinv, etc. methods would get inlined and all the 
>> assignments 
>> > should be scalar assignments, I think. 
>>
>>

Reply via email to