hughperkins / cltorch

An OpenCL backend for torch.
Other
291 stars 26 forks source link

Test failed on MacBook Pro Retina 2014 #56

Closed marcomastri closed 8 years ago

marcomastri commented 8 years ago

Hello, I tried to install cltorch on my macbook. The installation itself went fine, but I got an error when running the test:

running tests...
aftter requiring cltorch.unit_storage
Running 2 tests
1/2 test_get ............................................................ [WAIT]
Using Apple , OpenCL platform: Apple
Using OpenCL device: Iris Pro
1/2 test_get ............................................................ [PASS]
2/2 test_basic .......................................................... [WAIT]
2/2 test_basic .......................................................... [ERROR]
Completed 4 asserts in 2 tests with 0 failures and 1 error and 1 warning
--------------------------------------------------------------------------------
test_basic
 Function call failed
/Users/marco/torch/install/share/lua/5.1/torch/Tester.lua:85: message parameter must be a string
stack traceback:
    [C]: in function 'assert'
    /Users/marco/torch/install/share/lua/5.1/torch/Tester.lua:85: in function 'getMessage'
    /Users/marco/torch/install/share/lua/5.1/torch/Tester.lua:199: in function 'asserteq'
    ...rco/torch/install/share/lua/5.1/cltorch/unit_storage.lua:25: in function 'v'
    ...rco/torch/install/share/lua/5.1/cltorch/unit_storage.lua:84: in function <...rco/torch/install/share/lua/5.1/cltorch/unit_storage.lua:82>
    [C]: in function 'xpcall'
    /Users/marco/torch/install/share/lua/5.1/torch/Tester.lua:476: in function '_pcall'
    /Users/marco/torch/install/share/lua/5.1/torch/Tester.lua:436: in function '_run'
    /Users/marco/torch/install/share/lua/5.1/torch/Tester.lua:354: in function 'run'
    ...rco/torch/install/share/lua/5.1/cltorch/unit_storage.lua:91: in function 'test'
    /Users/marco/torch/install/share/lua/5.1/cltorch/Test.lua:8: in function 'test'
    (command line):1: in main chunk
    [C]: at 0x01091fdbd0

--------------------------------------------------------------------------------
Should use TestSuite rather than plain lua table

--------------------------------------------------------------------------------
luajit: /Users/marco/torch/install/share/lua/5.1/torch/Tester.lua:362: An error was found while running tests!
stack traceback:
    [C]: in function 'assert'
    /Users/marco/torch/install/share/lua/5.1/torch/Tester.lua:362: in function 'run'
    ...rco/torch/install/share/lua/5.1/cltorch/unit_storage.lua:91: in function 'test'
    /Users/marco/torch/install/share/lua/5.1/cltorch/Test.lua:8: in function 'test'
    (command line):1: in main chunk
    [C]: at 0x01091fdbd0

This is the output from th -l cltorch -e 'cltorch.about()':

cltorch.  OpenCL backend for Torch
Built from commit c45b2f0
More info, doc: https://github.com/hughperkins/cltorch
Issues: https://github.com/hughperkins/cltorch/issues

As per the subject my machine is a MacBook Pro Retina 2014 (2,2 GHz Intel Core i7, Intel Iris Pro 1536 MB), running El Capitan 10.11.1.

Thank you very much, Marco

hughperkins commented 8 years ago

Hi Marco,

Hmmm. Interesting. What happens if you do:

luajit -l cltorch -e 'print(torch.ClStorage())'

?

On my machine I get:

Using NVIDIA Corporation , OpenCL platform: NVIDIA CUDA
Using OpenCL device: GeForce 940M
[torch.ClStorage of size 0]
marcomastri commented 8 years ago

This is what I get:

Using Apple , OpenCL platform: Apple
Using OpenCL device: Iris Pro
[torch.ClStorage of size 0]
hughperkins commented 8 years ago

Hmmm, well, that looks correct... The line that is failing in your stack trace is:

  tester:asserteq('[torch.ClStorage of size 0]\n', tostring(torch.ClStorage()))

It looks simple enough. So, the inner torch.ClStorage() bit is giving the output it should. What if you do:

luajit -l cltorch -e 'print(tostring(torch.ClStorage()))'

? On my system, this gives:

$ luajit -l cltorch -e 'print(tostring(torch.ClStorage()))'
Using NVIDIA Corporation , OpenCL platform: NVIDIA CUDA
Using OpenCL device: GeForce 940M
[torch.ClStorage of size 0]
    1
hughperkins commented 8 years ago

Hmmm, I wonder if we are using different versions of Tester.lua? It's from 'torch' pakage. Here is some information on my own Tester.lua:

ubuntu:~/torch/pkg/torch$ git log -n 5 Tester.lua
commit 6fc2c95707d238f5106501c2c98f726a6f737d41
Author: Adam Lerer <alerer@fb.com>
Date:   Mon Jul 27 00:11:39 2015 -0700

    torch Tester: run tests in alphabetical order, and support interrupt handler

commit 14f5b23527cc738f9f9e0dfb61f117daed367be7
Author: George van den Driessche <georgevdd@google.com>
Date:   Thu Apr 9 12:19:59 2015 +0100

    Separated choice of tests to run from their actual running.

commit cfa0b1cfd183cc4553dbe420bba596eda27b283d
Author: GeorgOstrovski <ostrovski@google.com>
Date:   Thu Mar 19 16:26:26 2015 +0000

    Improve assertTensorEq to work with precision 0

    This change allows to use assertTensorEq to check for exact equality (previously setting precision = 0 would have made the condition unsatisfiable)

commit f6c1b74a3d4205f5347a7f3c799bdc4b959717ec
Author: GeorgOstrovski <ostrovski@google.com>
Date:   Tue Mar 17 17:52:28 2015 +0000

    fix assertTensorEq for case of empty tensors

    The case of empty tensors was handled wrongly: leading to exception. In the test of torch.maskedSelect and similar the case of an empty tensor can occur, leading to occasional test failures.

commit eb1f2345aeea145c5fb275755e8904e0f3c99987
Author: soumith <soumith@fb.com>
Date:   Mon Nov 17 13:23:59 2014 -0800

    removing redundant uninitialized variable access
ubuntu:~/torch/pkg/torch$ md5sum Tester.lua 
7e5ec5a6cbdb5cc90da88ceba811665f  Tester.lua
ubuntu:~/torch/pkg/torch$ md5sum ~/torch/install/share/lua/5.1/torch/Tester.lua 7e5ec5a6cbdb5cc90da88ceba811665f  /home/ubuntu/torch/install/share/lua/5.1/torch/Tester.lua
marcomastri commented 8 years ago

The output from the previous command looks fine:

Using Apple , OpenCL platform: Apple
Using OpenCL device: Iris Pro
[torch.ClStorage of size 0]
    1

Here’s my info for Tester.lua:

commit 9a41915d490dd6d6530c963911f56a81d64f850e
Author: soumith <soumith@gmail.com>
Date:   Mon Mar 7 21:42:34 2016 -0500

    making sys optional

commit d8ff64c5707f716199e7782d630e44e2cf402a54
Author: David Saxton <saxton@google.com>
Date:   Wed Feb 24 17:54:10 2016 +0000

    Replace torch.Tester with totem.Tester + extra stuff.

    This should bring a lot of benefit to code that uses torch.Tester (totem will
    eventually become deprecated). Note that torch.Tester and totem.Tester once
    shared the same code - this change brings it full circle.

    At a glance, extra functionality includes:
    - A general equality checker that accepts many different objects.
    - Deep table comparison with precision checking.
    - Stricter argument checking in using the test functions.
    - Better output.
    - torch.Storage comparison.
    - Extra features for fine-grained control of testing.

commit 6fc2c95707d238f5106501c2c98f726a6f737d41
Author: Adam Lerer <alerer@fb.com>
Date:   Mon Jul 27 00:11:39 2015 -0700

    torch Tester: run tests in alphabetical order, and support interrupt handler

commit 14f5b23527cc738f9f9e0dfb61f117daed367be7
Author: George van den Driessche <georgevdd@google.com>
Date:   Thu Apr 9 12:19:59 2015 +0100

    Separated choice of tests to run from their actual running.

commit cfa0b1cfd183cc4553dbe420bba596eda27b283d
Author: GeorgOstrovski <ostrovski@google.com>
Date:   Thu Mar 19 16:26:26 2015 +0000

    Improve assertTensorEq to work with precision 0

    This change allows to use assertTensorEq to check for exact equality (previously setting precision = 0 would have made the condition unsatisfiable)
hughperkins commented 8 years ago

ah-hah. You have a newer version, of torch module. I updated my torch module, and have the same issue now. Ok, I'll take a look.

hughperkins commented 8 years ago

ok. Do you want to pull down latest cltorch, rebuild, and try again? (addressed in 61bb912 )

marcomastri commented 8 years ago

Ok, now everything looks fine, thank you very much!

hughperkins commented 8 years ago

Ok, cool :-)