calebwin / emu

The write-once-run-anywhere GPGPU library for Rust
https://calebwin.github.io/emu
MIT License
1.59k stars 53 forks source link

Some tests are not passing on my system #18

Closed dineshadepu closed 5 years ago

dineshadepu commented 5 years ago

Hi all,

I am trying to execute the tests in the examples. I did tried running tests in integration, arithmetic example folders, in both the cases my system is failing the tests.

Is this anything to do with the crate or am I missing some library?

dineshadepu commented 5 years ago

Traceback is

     Running target/debug/deps/activation-6bd646e3fe82af6e

running 4 tests
test tests::test_relu ... ok
test tests::test_logistic ... FAILED
test tests::test_softmax ... FAILED
test tests::test_tan_h ... ok

failures:

---- tests::test_logistic stdout ----
thread 'tests::test_logistic' panicked at 'assertion failed: `(left == right)`
  left: `[0.7109495, 0.99260855, 0.99183744, 0.98015976, 0.785835]`,
 right: `[0.7109495, 0.9926085, 0.99183744, 0.98015976, 0.785835]`', src/main.rs:48:3
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

---- tests::test_softmax stdout ----
thread 'tests::test_softmax' panicked at 'assertion failed: `(left == right)`
  left: `[0.26894143, 0.73105854, 1.9872231]`,
 right: `[0.09003057, 0.24472846, 0.66524094]`', src/main.rs:67:9

failures:
    tests::test_logistic
    tests::test_softmax
calebwin commented 5 years ago

test_logistic is failing because of some sort of floating point/rounding error. For test_softmax it seems like the expected is 1/3 the actual.

However, all tests work for me on my computer (Ubuntu Intel i7 Windows 10). Maybe this is a problem with the version of OpenCL you have or the hardware you are running on? does the version you use support the pow() function?