Skip to content

Instantly share code, notes, and snippets.

View killeent's full-sized avatar

Trevor Killeen killeent

View GitHub Profile
Old Code Path:
Averages of 10 trials used to generate results
----------------------------------------------------------------
CatArray for 2 1D Tensors took 4.7445297241211e-05 seconds
CatArray for 4 1D Tensors took 5.0187110900879e-05 seconds
CatArray for 8 1D Tensors took 7.932186126709e-05 seconds
CatArray for 16 1D Tensors took 0.00016393661499023 seconds
CatArray for 32 1D Tensors took 0.00027034282684326 seconds
CatArray for 64 1D Tensors took 0.00049459934234619 seconds
Old:
----------------------------------------------------------------
Soumith's Benchmarks (The times are the sum of 100 trials)
----------------------------------------------------------------
CatArray for 32 1x600 Tensors along dim=1 took 0.024901628494263 seconds
CatArray for 128 1x32 tensors along dim=1 took 0.089506387710571 seconds
CatArray for 128 1x1024 tensors along dim=1 took 0.10325860977173 seconds
New:
Averages of 10 trials used to generate results
----------------------------------------------------------------
CatArray for 2 1D Tensors took 9.0932846069336e-05 seconds. Clone: 2.8562545776367e-05
CatArray for 4 1D Tensors took 2.9778480529785e-05 seconds. Clone: 2.7894973754883e-05
CatArray for 8 1D Tensors took 2.892017364502e-05 seconds. Clone: 2.6392936706543e-05
CatArray for 16 1D Tensors took 3.2711029052734e-05 seconds. Clone: 2.6988983154297e-05
CatArray for 32 1D Tensors took 6.4587593078613e-05 seconds. Clone: 2.6130676269531e-05
CatArray for 64 1D Tensors took 4.2986869812012e-05 seconds. Clone: 2.6583671569824e-05
CatArray for 128 1D Tensors took 8.2588195800781e-05 seconds. Clone: 2.6845932006836e-05
CatArray for 256 1D Tensors took 8.995532989502e-05 seconds. Clone: 2.6607513427734e-05
Averages of 10 trials used to generate results
----------------------------------------------------------------
CatArray for 2 1D Tensors took 8.8000297546387e-05 seconds. Clone: 2.5820732116699e-05
CatArray for 4 1D Tensors took 2.9921531677246e-05 seconds. Clone: 2.4724006652832e-05
CatArray for 8 1D Tensors took 2.7823448181152e-05 seconds. Clone: 2.3770332336426e-05
CatArray for 16 1D Tensors took 5.5909156799316e-05 seconds. Clone: 2.6226043701172e-05
CatArray for 32 1D Tensors took 3.4642219543457e-05 seconds. Clone: 2.5463104248047e-05
CatArray for 64 1D Tensors took 4.2414665222168e-05 seconds. Clone: 2.5272369384766e-05
CatArray for 128 1D Tensors took 7.7128410339355e-05 seconds. Clone: 2.589225769043e-05
CatArray for 256 1D Tensors took 8.4567070007324e-05 seconds. Clone: 2.6488304138184e-05
require 'torch'
require 'cutorch'
local counts = {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192}
local trials = 10
print('Averages of', trials, 'trials used to generate results')
print("----------------------------------------------------------------")
-- 1D Tensors
require 'torch'
require 'cutorch'
local trials = 5
print("----------------------------------------------------------------")
print("Soumith's Benchmarks (The times are the sum of", trials, "trials)")
print("----------------------------------------------------------------")
local tensors = {}
for i = 1, 32 do
@killeent
killeent / gist:33476c9eb3a84354026f1bd0c190e4e6
Created January 9, 2017 21:47
comprehensive benchmarks
require 'torch'
require 'cutorch'
local dims = {1, 32, 128, 1024}
local counts = {2, 4, 8, 32, 128, 512, 1024, 2048}
local trials = 10
print('Sum of', trials, 'trials used to generate results')
print("----------------------------------------------------------------")
----------------------------------------------------------------
Soumith's Benchmarks (The times are the sum of 5 trials)
----------------------------------------------------------------
ms: 0.282048
ms: 0.255712
ms: 0.278784
ms: 0.262304
ms: 0.224384
CatArray for 32 1x600 Tensors along dim=1 took 0.00031156539916992 seconds
ms: 0.933888
----------------------------------------------------------------
Soumith's Benchmarks (The times are the sum of 5 trials)
----------------------------------------------------------------
ms: 0.075840
ms: 0.041088
ms: 0.035072
ms: 0.035136
ms: 0.035648
CatArray for 32 1x600 Tensors along dim=1 took 0.00010762214660645 seconds
ms: 0.059296
Sum of 10 trials used to generate results
----------------------------------------------------------------
CatArray for 2 size 1 1D Tensors took 0.00037097930908203 seconds.
CatArray for 4 size 1 1D Tensors took 0.00036001205444336 seconds.
CatArray for 8 size 1 1D Tensors took 0.00064897537231445 seconds.
CatArray for 32 size 1 1D Tensors took 0.0023789405822754 seconds.
CatArray for 128 size 1 1D Tensors took 0.0089218616485596 seconds.
CatArray for 512 size 1 1D Tensors took 0.036385059356689 seconds.
CatArray for 1024 size 1 1D Tensors took 0.075536012649536 seconds.
CatArray for 2048 size 1 1D Tensors took 0.14832401275635 seconds.