I have already implemented a simple proof of concept which shows some promise. The simple script
a = 1; b = 1;
tic; for i=1:10000 for j=1:10000 a = a + b; endfor endfor toc;executes on my computer in 0.178s using my jit branch, and in 253.124s using Octave 3.6.1. A speedup of 1422 is not bad.
There is still quite a ways to go before the code is ready for users though. I need to take another look at type inference, ensure error cases are handled correctly, and the current implementation requires the inner loop bounds to be constant for type inference.
You can view my current progress by checking out my code from
hg clone http://inversethought.com/hg/octave-maxThe specific revision this post refers to is cba58541954c.
*edit*
I realized that I should mention that a speedup of 1422x is really a best cast speedup. Code which is already vectorized will see a much smaller speedup (if any). This is because Octave already efficiently implements vectorization.
Hello Max,
ReplyDeleteCould you help me on compiling problem on octave?
I want to implement preconditioner for octave, and I create a folder with some source files. I don't know how to compile those files in octave and link to final binary file.
Could you help me on that?
thank you!
Are you sure you need to compile the preconditioner directly into Octave? I would recommend using Oct files if possible. There is a section in the manual that describes how to do this: http://tinyurl.com/dxhd3y7
DeleteHope that helps
I am doing project to contribute some preconditioner to octave. since the octave's built-in preconditioner is in octave/src/DLD-FUNCTIONS, I think it is better to put source code directly into octave. Could you give me some guide on how to do it?
DeleteThank you!
It looks like the files in src/DLD-FUNCTIONS are automatically found and linked in. The guide in the link I gave above should still apply, as the code in src/DLD-FUNCTIONS are actually all oct files. I think this method requires one file per function (but I don't use it, so I'm not sure). Is this your case?
DeleteHi Max,
ReplyDeleteGreat work. Really looking forward to your results. This will be great!
Keep on being awesome.
Looks very good. This can be a milestone in the GNU Octave development :)
ReplyDeleteGood luck with your project. You might want to take a look at McVM which has a JIT for Matlab. See http://www.sable.mcgill.ca/mclab/mcvm_mcjit.html. That web page also contains links to papers and the theses.
ReplyDeleteThanks for the link. I read through the type inference section of the thesis and found it to be quite interesting.
Delete