intel / webml-polyfill

Deprecated, the Web Neural Network Polyfill project has been moved to https://github.com/webmachinelearning/webnn-polyfill
Apache License 2.0
161 stars 42 forks source link

[nn v2] add conv2d, averagePool2d, maxPool2d, relu and reshape #1305

Closed huningxin closed 4 years ago

huningxin commented 4 years ago

next we may enable to set a CompilationOptions parameter for model.createCompilation() interface and run tests by tfjs wasm backend.

Thanks for raising this point. However, according to the latest spec, it it not clear to me which PowerPreference maps to tfjs wasm backend.

BruceDai commented 4 years ago

it it not clear to me which PowerPreference maps to tfjs wasm backend.

OK, thanks @huningxin.

I modified Compilation code to manually set tfjs backend as wasm, and ran those tests, 20 tests passed, 5 tests failed, errors of 5 failed tests as following:

  1. "Error: wasm backend Conv2D does not support dataFormat:'channelsFirst'. Please use 'channelsLast'. " happened when ran three Conv2D tests
  2. "Error: 'spaceToBatchND' not yet implemented or not found in the registry" happened when ran 'maxPool2d dilations' test.
  3. The output were not as expected, they were all zero, failed to run 'averagePool2d pads' .
huningxin commented 4 years ago

@BruceDai , your test results reflect what @akineeic found in his PR https://github.com/intel/webml-polyfill/pull/1153. It seems the tfjs wasm backend still in development. So let's focus on the tfjs webgl backend for nn v2 implementation now. Does it make sense?

BruceDai commented 4 years ago

@huningxin OK, thanks.