Slashdot Mirror


IBM Releases Open Source Machine Learning Compiler

sheepweevil writes "IBM just released Milepost GCC, 'the world's first open source machine learning compiler.' The compiler analyses the software and determines which code optimizations will be most effective during compilation using machine learning techniques. Experiments carried out with the compiler achieved an average 18% performance improvement. The compiler is expected to significantly reduce time-to-market of new software, because lengthy manual optimization can now be carried out by the compiler. A new code tuning website has been launched to coincide with the compiler release. The website features collaborative performance tuning and sharing of interesting optimization cases."

9 of 146 comments (clear)

  1. Oh really? by zmotula · · Score: 5, Insightful

    The compiler is expected to significantly reduce time-to-market of new software, because lengthy manual optimization can now be carried out by the compiler.

    Oh, so new software takes too long to build because of lengthy manual optimization? That's news indeed. Even if it did, will the compiler find a better polygon intersection algorithm for me? Will it write a spatial hash? Will it find places when I am calculating something in a tight loop and move the code somewhere higher?

    1. Re:Oh really? by lee1026 · · Score: 5, Interesting

      The last one is actually quite possible, and indeed is a huge area of compiler research.

    2. Re:Oh really? by jcupitt65 · · Score: 5, Informative

      Read the article, that's not what this does. This is a project to automatically generate optimising compilers for custom architectures. The summary is a little unclear :-(

      It reduces time to market because you don't have to spend ages making an optimising compiler for your custom chip.

  2. Dumb Summary by QuantumG · · Score: 5, Insightful

    automatically learn how to best optimise programs for re-configurable heterogeneous embedded processors

    That's kinda important to mention no?

    --
    How we know is more important than what we know.
  3. Re:Few Questions for any programmers by EvanED · · Score: 5, Informative

    What things can a compiler do to your code to 'optimize' it for you?

    Check out the Wikipedia article on optimization for some examples.

    In brief, some of the more common ones are things like substituting known values for expressions (e.g. x = 3; y = x + 2; can be changed to x = 3; y = 5;), moving code that doesn't do anything when run repeatedly outside a loop, and architecture-specific optimizations like code scheduling and register allocation. (E.g. with no -O parameters, or -O0, for something like "y = x; z = x;" GCC will generate code that loads "x" from memory twice, once for each statement. With optimization, it will load it once and store it in a register for both instructions.)

    If the compiler tries to do this, wouldn't it likely screw your code up?

    There are cases where optimizations will screw something up. One example is as follows. It's considered good security practice to zero out memory that held sensitive information (e.g. passwords or cryptographic keys) to limit the lifetime of that data. So you might see something like "password = input(); check(password); zero_memory(password); delete password;". But the compiler might see that zero_memory writes into password, but those values are never read. Why write something if you never need it? So it would remove the zero_memory call as it's useless code that can't affect anything. So it removes it. And your program no longer clears the sensitive memory.

    This was actually a bug in a couple crypto libraries for a while.

  4. Re:Few Questions for any programmers by walshy007 · · Score: 5, Insightful

    it optimizes the translation of to assembly opcodes. When you code the stuff you type is not in the binary that's compiled/assembled/linked.

    I highly recommend you add a tiny amount of assembly programming dabbling to that list, and you will gain better understanding of how compiler optimization is not a simple affair. There are many ways to do the same thing.

    As for an example of a basic optimization method, removing dead code, code that is in there but never called by the main method.

    Another one is vector optimization, where certain routines or parts of routines where it's suitable use the vector units of a cpu to speed things up a little.

  5. Re:I for one? by Norsefire · · Score: 5, Funny

    It will surely, er, program our programs to kill us.

    No, it'll just optimize out all emergency stop and safety routines. Humans inevitably die anyway so there is no point in slowing down the code to prevent it.

  6. Re:Few Questions for any programmers by walshy007 · · Score: 4, Informative

    in regards to learning assembly, if you run linux, the best book I can recommend is Programming from the ground up it's licensed under the GNU free documentation license, and in my honest opinion is likely the single best book for anyone who has no idea that wants to start, I already had some clue so skipped the first two thirds of the book, but read it for shits and giggles later and found it to be a very easy to grasp book.

    To this day if I forget minor details about things I pick that back up and re-read it a bit :)

  7. Re:Few Questions for any programmers by BlackSabbath · · Score: 5, Informative

    Before you get flamed to death by some idiot, you've got realise that compilers translate a higher-level language into a lower-level one, typically into machine instructions (or in the case of Java and .NET, virtual machine instructions), turning source code into executable form. Interpreters on the other hand, execute each statement of the language directly (effectively forming a virtual machine for that language).

    Naive compiler translations can be functionally correct but sub-optimal with respect to runtime performance, memory/disk footprint etc. Compiler optimisation is the effort to make this translation as optimal as possible with respect to some variable(s) e.g. performance, size

    What you are thinking of sound like source code optimization. There are various interpretations of this but to my mind, this means a combination of optimal algorithm selection and optimal algorithm implementation. Note that complex algorithms can be decomposed into smaller common algorithms e.g. a sort routine may be part of some higher-level algorithm, the sort-routine may be optimised independently of the higher-level routine.

    Check out: http://en.wikipedia.org/wiki/Compiler_optimization