Comments (17)
In SConstruct comment this line:
env.Append(CPPDEFINES={'CLSTM_ALL_TENSOR': '1'})
from clstm.
In earlier versions of Eigen, the matrix code was more optimized than the tensor code, but that isn't true anymore, so the matrix version isn't needed anymore.
from clstm.
Tom,
So why is a588c8 (matrix only, no tensor) is more than 2.5 faster in training compared to the tip of the repo?
Tested on my 4 years old PC, intel i5 - 4 cores, 8 GB RAM, without dedicated GPU.
from clstm.
The speed of matrix vs tensor depends crucially on the version of Eigen; the version that you have installed may be too old. Can you install Eigen from github source and then do the benchmarks again?
(Most of the work of optimizing Eigen these days goes into the tensor code, since that's what other deep learning frameworks use.)
from clstm.
I forgot to mention that I tested this with Eigen 3.3 rc1.
On Ubuntu 16.04 (gcc 5.1 5.4).
from clstm.
That sounds odd. I benchmarked both versions against each other before switching. Recent versions of Eigen really shouldn't have big differences in linear algebra performance between tensor and matrix; after all, the tensor code drives much of Google's TensorFlow.
Is it possible your matrix code is running multicore? Checking with htop while it's running should give you some idea.
from clstm.
I checked with htop. Only one cpu run 100%, the others are idle / <2% most of the time.
from clstm.
Hmmm... I'm not sure. At this point, all I can say is that when I made the switch, the two performed pretty much identically to each other, and basically gave the same performance as a good BLAS implementation. Whatever the cause is, it ought to be fixable without switching back to the Eigen matrix backend. I'll leave the bug open and see whether I can reproduce&find a quick fix.
from clstm.
Make sure you are testing cpu only without gpu involvement.
from clstm.
Weird, with the latest code from master I get step times of ~0.3s with the uw3-500 dataset, while with the a588c8 version they are between 6.5s and 10.5s, i.e. the matrix code is significantly slower. Both were compiled with eigen 3.3beta2 on Debian unstable.
edit: Using the latest eigen checkout, the performance difference still remains.
from clstm.
with the latest code from master I get step times of ~0.3s with the uw3-500 dataset
I get ~0.8s with the uw3-500 dataset
while with the a588c8 version they are between 6.5s and 10.5s
I get ~0.3s...
from clstm.
The slowness of the matrix code was due to me using debug=-1
(which enables amongst others -Ofast
). With the default the matrix version runs at ~0.3s and the tensor version is between 0.5 and 0.9s, i.e. the same as on your machine (I'm running this on an i5 clocked at 3.1ghz).
So it seems that to get comparable performance, the compiler flags have to be tuned for the tensor version.
from clstm.
What's the CPU in each case?
On Wed, Oct 12, 2016, 13:10 Johannes Baiter [email protected]
wrote:
The slowness of the matrix code was due to me using debug=-1 (which
enables amongst others -Ofast). With the default the matrix version runs
at ~0.3s and the tensor version is between 0.5 and 0.9s.So it seems that to get comparable performance, the compiler flags have to
be tuned for the tensor version.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#70 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAUYPy4cNYHrnQxYDVD4vbhNspQaNgQiks5qzT7HgaJpZM4Hzjzs
.
from clstm.
Here's an excerpt of my /proc/cpuinfo
:
vendor_id : GenuineIntel
cpu family : 6
model : 58
model name : Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
stepping : 9
microcode : 0x1c
cpu MHz : 2899.902
cache size : 3072 KB
physical id : 0
siblings : 4
core id : 1
cpu cores : 2
apicid : 3
initial apicid : 3
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm epb tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm ida arat pln pts
bugs :
bogomips : 4989.61
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
Note that there's a turbo mode where the CPU clock goes up to 3.1Ghz, which is what was active when I benchmarked clstm.
Compiler version:
g++ (Debian 6.2.0-5) 6.2.0 20160927
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
from clstm.
I can confirm that installing the latest code with scons debug=-1
, I get the same performance as the matrix based code.
from clstm.
My cpu:
model name : Intel(R) Core(TM) i5-3450 CPU @ 3.10GHz
stepping : 9
cpu MHz : 2462.683
cache size : 6144 KB
cpu cores : 4
gcc version 5.4.0
from clstm.
This issue has not been fixed yet. Every user of the master branch will suffer from the slowness, unless he/she builds with debug=-1
.
A fix in SConstruct is needed.
from clstm.
Related Issues (20)
- core dumped, w != 0 failed
- Missing last char of the line. HOT 4
- Sort and Sed commands are causing the model not to train (ERROR 1/OUT is empty) HOT 2
- Arabic 800,000 model cant go below Error Rate 0.5 HOT 4
- Always missing one character in the output HOT 3
- Can I use this tool to do scene text detection + recognition ? HOT 2
- Is it possible to train multiple languages on a one model file ? HOT 6
- Error in training uw3-500
- clstmocr - error opening clstm file (trained model) HOT 8
- Segmentation fault when running clstmocr on pre-trained model HOT 1
- Error while using clstm models that I trained and test it !
- I want to use gpu to speed up training model! How do I do, I follow the previous issu to do but failed
- error: use of undeclared identifier 'environ' HOT 6
- How to optimally prepare the data
- Segmentation Fault when running tests HOT 1
- Inaccurate training
- question: clstmocrtrain on GPU
- How to make predictions using python code
- Is there a graphical depiction of the model being used/trained here? HOT 4
- question HOT 2
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 clstm.