Re: [julia-users] Re: How to accelerate the Warm-up process of `svds`?

2015-02-26 Thread Tim Holy
Not sure, but two possibilities come to mind: - I'm not sure it works with keyword functions. One way to check would be to modify base to create an`svds_` function (note the underscore) that takes all those parameters as regular arguments, and have `svds` call `svds_`. Then precompile `Base.svd

Re: [julia-users] Re: How to accelerate the Warm-up process of `svds`?

2015-02-25 Thread Todd Leo
I am a little bit confused when trying to add precompile for svds in userimg.jl, since svds uses nsv as keyword arguments: function svds{S}(X::S; nsv::Int = 6, ritzvec::Bool = true, tol::Float64 = 0.0, maxiter::Int = 1000) hence, calling svds maybe looks like: svds(X, nsv = 2), where X is a spa

Re: [julia-users] Re: How to accelerate the Warm-up process of `svds`?

2015-02-25 Thread Todd Leo
Thanks Tim, for the neat and patient explanation! I did follow your tips, added my module to userimg.jl and precompile for the svds. What I did wrong is, I put my precompile function in my scripts rather than userimg.jl. Will try it again now. Cheers, Todd Leo On Wednesday, February 25, 2015 a

Re: [julia-users] Re: How to accelerate the Warm-up process of `svds`?

2015-02-25 Thread Tim Holy
Keep in mind that compilation involves multiple stages: - parsing - lowering - type inference - generation of LLVM IR - generation of machine native code Just because it gets built into julia does not mean it goes through all of those steps for all possible data types (in fact, that's not even po

Re: [julia-users] Re: How to accelerate the Warm-up process of `svds`?

2015-02-25 Thread Todd Leo
That's exactly how I understand, and I'm using 0.4, so Tim's suggestion above won't work...I presume this is not related to the implementation of svds, since other built-in functions also takes much more time and memory on the first running: julia> @time sprand(5,5,0.1) elapsed time: 0.31490503

Re: [julia-users] Re: How to accelerate the Warm-up process of `svds`?

2015-02-25 Thread SLiZn Liu
That's exactly how I understand, and I'm using 0.4, so Tim's suggestion above won't work...I presume this is not related to the implementation of svds, since other built-in functions also takes much more time and memory on the first running: julia> @time sprand(5,5,0.1) elapsed time: 0.314905039 s

Re: [julia-users] Re: How to accelerate the Warm-up process of `svds`?

2015-02-25 Thread Viral Shah
No need to precompile. svds was recently added to base - but it won't exist in 0.3. -viral On Wednesday, February 25, 2015 at 12:32:09 PM UTC+5:30, Todd Leo wrote: > > Isn't svd/svds already included in base? Do I need to precompile them? > > On Saturday, February 7, 2015 at 3:48:50 AM UTC+8, Ti

Re: [julia-users] Re: How to accelerate the Warm-up process of `svds`?

2015-02-24 Thread Todd Leo
Isn't svd/svds already included in base? Do I need to precompile them? On Saturday, February 7, 2015 at 3:48:50 AM UTC+8, Tim Holy wrote: > > Since it allocates 120MB on the first call and only 9kB on the second, all > that > memory is just due to compilation. > > The only way I know to fix tha

Re: [julia-users] Re: How to accelerate the Warm-up process of `svds`?

2015-02-06 Thread Tim Holy
Since it allocates 120MB on the first call and only 9kB on the second, all that memory is just due to compilation. The only way I know to fix that is to precompile some of the functions when you build julia. If this is a big deal to you, consider adding your own custom userimg.jl (and see base/

[julia-users] Re: How to accelerate the Warm-up process of `svds`?

2015-02-06 Thread Viral Shah
This is because the internal operations with svds are allocating new vectors every iteration. This PR should address it, but needs to be completed, https://github.com/JuliaLang/julia/pull/7907 Also, array indexing giving views by default will also help here. -viral On Friday, February 6, 2015