Giter Club home page Giter Club logo

Comments (2)

gravesee avatar gravesee commented on August 22, 2024

@idroz I added openmp support and verified that it works on mac. Here are the new timings on a dataset of 7,000 obs and 11 columns and 100 trees of depth 32. Roughly 4x speedup.

It's all under this branch: add-openmp

Unit: milliseconds
 expr      min        lq      mean   median        uq       max neval
  new 229.6577  244.6078  269.6257  253.532  269.4523  471.8144   100
  old 981.9939 1013.5965 1067.6469 1031.105 1099.3970 1640.0559   100

To get it to work on mac you have to first:

brew install llvm

And then edit your ~/.R/Makevars file to look like so:

CXX = /usr/local/opt/llvm/bin/clang
CXXFLAGS = -I/usr/local/opt/llvm/include -fopenmp
LDFLAGS = -L/usr/local/opt/llvm/lib -fopenmp=libiomp5

That last bit with -fopenmp=libiomp5 was a real pain to figure out. I have to add some safety checks. The code will crash if your data.frame has types other than numeric, integer, or factor.

To call the omp parallel predict function do the following:

 p <- predict(mod, newdata, iterative=TRUE)

from isofor.

gravesee avatar gravesee commented on August 22, 2024

Todos:

  1. Clean up code -- remove printfs
  2. switch callocs to mallocs
  3. change for loop zero-initialization to memcpy?

from isofor.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.