Comments (5)
(Question from an outsider:) Can't you just link against whatever BLAS library is installed on the system (that will most often be the one that is also used by numpy), and recommend users to install OpenBLAS?
from cgt.
That's what's typically done, e.g. by Numpy and Theano. And maybe CGT should do that, at least for now. A few reasons for the choice to download OpenBLAS:
- different BLAS implementations have different multi-threading settings. If CGT is using multi-threading, we want to ensure that BLAS is using a single thread. This is a significant effect -- I've noticed substantial speedups by setting
VECLIB_MAXIMUM_THREADS=1
on mac when CGT is using parallelism. It's easier for the user if we just use a bundled BLAS and let CGT handle the threading configuration. - most people on linux are using a BLAS that's less performant than OpenBLAS
- Properly configuring a library to find and use the right BLAS is surprisingly hard. NumPy still doesn't do a great job at it--it's rather painful to get NumPy to use your chosen BLAS and lots of people are using the fallback built-in one.
from cgt.
Julia adds a suffix to the names of BLAS (they do it so that 32-bit and 64-bit BLAS routines don't get confused), a smililar patch could be used to fix the problem for CGT, too:
from cgt.
Cool, nice find!
It definitely might make sense to customize the makefile, also to make sure we're not building functions we don't need (most of level 3)
from cgt.
A few reasons for the choice to download OpenBLAS:
Agreed, all of these are valid reasons to make OpenBLAS be the default for novice users. If it's not too difficult, advanced users could still be given a way to use an alternative BLAS library, taking care of disabling multi-threading themselves.
Properly configuring a library to find and use the right BLAS is surprisingly hard. NumPy still doesn't do a great job at it--it's rather painful to get NumPy to use your chosen BLAS and lots of people are using the fallback built-in one.
Regarding the last point, at least on Ubuntu (and probably Debian) it's quite simple. When you're using packages from the Ubuntu repository, you can even use update-alternatives
to switch between different installed BLAS libraries to be used by numpy and others, without recompiling anything. But sure, as a library developer it's hard to automatically find the correct BLAS library across multiple platforms.
It definitely might make sense to customize the makefile
What if I want to or need to customize the OpenBLAS build myself, e.g., because the architecture auto-detection does not work for my CPU? Even if you decide to only support OpenBLAS, you may want to allow users to point CGT at an OpenBLAS build somewhere on their system. (This means if you add a function name suffix, that one should be configurable as well.)
(Note that I'm just depicting what I'd like as a user here, without understanding the implications on the development side.)
from cgt.
Related Issues (20)
- Product of diagonal elements may be `nan` HOT 1
- cgt.stack only supports stacking scalars HOT 1
- Error on tutorial
- Bug in graph simplification HOT 2
- OSX: Build fails with OpenBLAS dependency HOT 1
- Questions about Installation : cmake and windows HOT 1
- Memory consumption of native backend on Linux
- Random number generation and graph simplification HOT 2
- Negative reshaping check not enforced sometimes HOT 1
- Parameter indexing leads to an assertion error in module definition HOT 1
- Issues with shared scalar HOT 2
- Random number generation and modules (and simplification again)
- CIFAR Demo Error when using GPU
- Installation with anaconda
- Support for square root operation on Node HOT 2
- Simple operation breaks CGT
- Berkely BidMach and CGT
- How to build with python 3?
- Any reference to read? HOT 1
- Links in read-me are dead
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cgt.