buddy-compiler / buddy-benchmark

Benchmark Framework for Buddy Projects
Apache License 2.0
44 stars 34 forks source link

[DAP] Add validation framework to buddy benchmark. #49

Closed SForeKeeper closed 1 year ago

SForeKeeper commented 1 year ago

Validation using scipy and numpy for buddy-fir and future works. Easily, the framework could be extended by using current code as examples.

There are some problems to be discussed:

  1. It's still unknown that how should I use Buddy-mlir, it should be a subproject in my opinon, but currently no method is given using it.
  2. How the python code should be run. To use python code, dependent libraries should be installed, and the cmake target c-wrapper should be built to generate a dynamic library. The python code would also need the path of the dynamic library, since build path will not always be build, it needs cmake information to confirm location.
zhanghb97 commented 1 year ago

@SForeKeeper Can you please provide steps to run this PR?

It's still unknown that how should I use Buddy-mlir, it should be a subproject in my opinon, but currently no method is given using it.

I plan to use buddy-mlir domain libraries just like opencv style, which will be ready when I finish redesigning the buddy-mlir structure.

How the python code should be run.

This is an open topic. Should we just use the python script or wrap them as a tool? or other better ideas?

Another thing we need to determine is what format tool we need to use to format the python code. Should we use a tool like black, or can we configure clang-format to make it able to format python code?

zhanghb97 commented 1 year ago

@SForeKeeper Thanks for this PR!

When I run the validation Python file, I encountered the following error:

// Navigate to buddy-benchmark/utils/validation/Python

$ python main.py
... ...
OSError: cannot load library '../../../build/utils/validation/AudioProcessing/libCWrapper': 
../../../build/utils/validation/AudioProcessing/libCWrapper: cannot open shared object file: No such file or directory.  
Additionally, ctypes.util.find_library() did not manage to locate a library called 
'../../../build/utils/validation/AudioProcessing/libCWrapper'

And when I run the DAP benchmark in the build/bin dir, I encountered the following error:

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)

Our upstream version can work well now, did I miss something important to run this PR?