cornell-zhang / heterocl

HeteroCL: A Multi-Paradigm Programming Infrastructure for Software-Defined Heterogeneous Computing
https://cornell-zhang.github.io/heterocl/
Apache License 2.0
326 stars 92 forks source link

[Backend][SODA] Update tutorial and propagate SODA error #249

Closed Blaok closed 4 years ago

Blaok commented 4 years ago

Fix #248.

Blaok commented 4 years ago

@Hecmay Do you know why the changes cause errors in hlib/tests/test_keras.py?

seanlatias commented 4 years ago

@Hecmay Seems like there still exist some cases that could lead to random behavior. Can you take a look later at the failed cases? Maybe we should replace some list with ordered_list or ordered_set.

seanlatias commented 4 years ago

Hmmm. But the errors are the same when I rerun the tests.

seanlatias commented 4 years ago

I guess there are some updates with Keras and that makes our parser not working anymore.

hecmay commented 4 years ago

I need to check it. We can use specify a specific Keras version for installation to avoid such issues.

hecmay commented 4 years ago

The error can be fixed by setting up the specific versions when installing Keras and TF: https://github.com/Hecmay/heterocl/blob/fix/hlib/python/setup.py#L45

@Blaok @chhzh123 @seanlatias

Blaok commented 4 years ago

Is it possible to write a test case that leads to incorrect behavior, which will be caught in HeteroCL? In Python, we can use try and except to test incorrect behavior.

It's impossible with exit(EXIT_FAILURE) because it will terminate the whole process immediately. Are there any existing API that can raise a Python exception from TVM? If so, we can leverage that. Otherwise, we'll have to look for some general approach to raise an exception from C++.

seanlatias commented 4 years ago

I believe you can use this Check().

Blaok commented 4 years ago

@Hecmay There was an assert_almost_equal error reported from test_keras.py. The threshold might be too tight; the second run of the tests succeeded.