stanfordaha / halide-to-hardware Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
where is the bin/align.h in the document ./app/hardware_benchmarks/apps/hdr_plus/process.cpp?I can't find it. Can you tell me? Thank you!
@jeffsetter I cannot get the coreir backend to load the current camera pipeline compute:
When I check the file at the command line I get:
./coreir/bin/coreir --load_libs commonlib --input ./coreir_compute/camera_pipeline_compute.json --output camera_pipeline_compute.v --passes rungenerators;flattentypes;verilog
ERROR: {hcompute_curved_stencil}.curve$1.clk Is not fully connected (N)
{hcompute_curved_stencil}.curve$1 Is not fully connected (R)
ERROR: {hcompute_curved_stencil}.curve$1.clk Is not fully connected (N)
{hcompute_curved_stencil}.curve$1 Is not fully connected (R)
I AM DYING!
Any idea whats going wrong here?
@jeffsetter I pulled and built cleanup_codegen. When I try to build the code in apps/hardware_benchmarks/apps/harris
I get this:
bash-3.2$ make design-vhls
c++ -std=c++11 -I ../../../../include/ -I ../../../../tools/ -fvisibility=hidden -I ../../../../../coreir/include -L../../../../../coreir/lib -Wl,-rpath,../../../../../coreir/lib -g -fno-rtti harris_generator.cpp ../../../../lib/libHalide.a ../../../../tools/GenGen.cpp -o bin/harris.generator -ldl -lpthread -lz -lcurses -L../../../../../coreir/lib -lcoreir-commonlib -lcoreir -lcoreirsim -lcoreir-float
Undefined symbols for architecture x86_64:
"llvm::zlib::uncompress(llvm::StringRef, llvm::SmallVectorImpl<char>&, unsigned long)", referenced from:
llvm::readPGOFuncNameStrings(llvm::StringRef, llvm::InstrProfSymtab&) in libHalide.a(llvm_377_InstrProf.cpp.o)
"llvm::zlib::isAvailable()", referenced from:
llvm::collectPGOFuncNameStrings(llvm::ArrayRef<llvm::GlobalVariable*>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, bool) in libHalide.a(llvm_377_InstrProf.cpp.o)
llvm::readPGOFuncNameStrings(llvm::StringRef, llvm::InstrProfSymtab&) in libHalide.a(llvm_377_InstrProf.cpp.o)
"llvm::zlib::compress(llvm::StringRef, llvm::SmallVectorImpl<char>&, llvm::zlib::CompressionLevel)", referenced from:
llvm::collectPGOFuncNameStrings(llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, bool, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) in libHalide.a(llvm_377_InstrProf.cpp.o)
(anonymous namespace)::ELFWriter::writeObject(llvm::MCAssembler&, llvm::MCAsmLayout const&) in libHalide.a(llvm_1089_ELFObjectWriter.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [bin/harris.generator] Error 1
Any idea what is wrong?
When I try to generate test verilog for harris I get the follwing error:
cmd: ${COREIR_PATH}/bin/coreir --load_libs commonlib --input harris.json --output harris.v
cmd: verilator -Wall --cc harris.v --exe --build harris_verilog_tb.cpp --top-module harris -Wno-lint
%Error: harris.v:45542:8: syntax error, unexpected const, expecting IDENTIFIER
45542 | ) const-255__383 (
| ^
%Error: harris.v:45701:8: syntax error, unexpected const, expecting IDENTIFIER
45701 | ) const-255__283 (
| ^
%Error: Exiting due to 2 error(s)
This seems to come from the harris compute file: https://github.com/dillonhuff/clockwork/blob/b4dc132aa141f610421159bccf8ae21b8ae353ce/coreir_compute/harris_compute.json#L239
@jeffsetter when I run C++ simulation for cascade (from example_progs) I get the following compile error on the generated C++ code:
cmd: g++ -fstack-protector-all -std=c++11 regression_tb_unoptimized_cascade.cpp unoptimized_cascade.cpp
unoptimized_cascade.cpp: In function ‘void op_hcompute_hw_input_global_wrapper_stencil(HWStream<hw_uint<16> >&, hw_input_global_wrapper_stencil_cache&, int, int, int)’:
unoptimized_cascade.cpp:1397:24: error: ‘hcompute_hw_input_global_wrapper_stencil’ was not declared in this scope
auto compute_result = hcompute_hw_input_global_wrapper_stencil(hw_input_stencil_hw_input_global_wrapper_s0_y_c__hw_input_global_wrapper_s0_x_value);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
unoptimized_cascade.cpp:1397:24: note: suggested alternative: ‘op_hcompute_hw_input_global_wrapper_stencil’
auto compute_result = hcompute_hw_input_global_wrapper_stencil(hw_input_stencil_hw_input_global_wrapper_s0_y_c__hw_input_global_wrapper_s0_x_value);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
op_hcompute_hw_input_global_wrapper_stencil
unoptimized_cascade.cpp: In function ‘void op_hcompute_hw_output_stencil(conv2_stencil_cache&, HWStream<hw_uint<16> >&, int, int, int)’:
unoptimized_cascade.cpp:1489:40: error: no matching function for call to ‘HWStream<hw_uint<16> >::write(hw_uint<8>&)’
hw_output_stencil.write(compute_result);
^
In file included from cascade_compute.h:2,
from unoptimized_cascade.cpp:10:
hw_classes.h:392:10: note: candidate: ‘void HWStream<T>::write(const T&) [with T = hw_uint<16>]’
void write(const T& v) {
^~~~~
hw_classes.h:392:10: note: no known conversion for argument 1 from ‘hw_uint<8>’ to ‘const hw_uint<16>&’
clockwork: prog.cpp:2842: std::vector<std::__cxx11::basic_string<char> > run_regression_tb(const string&): Assertion `res == 0' failed.
It looks as though one of the functions hcompute_hw_input_global_wrapper_stencil
does not exist in cascade_compute.h
, could you check if the cascade compute file is up to date?
@jeffsetter @thenextged I've gotten the CPU code compiling and running for my max-pooling example (https://github.com/StanfordAHA/Halide-to-Hardware/tree/maxpool_example/apps/hardware_benchmarks/apps/max_pool_2x2), but when I run make run-clockwork
I get the following error:
dhuff@kiwi:~/h2h2clockwork/Halide-to-Hardware/apps/hardware_benchmarks/apps/max_pool_2x2$ make run-clockwork
g++-7 -std=c++17 -I../../../../../clockwork -I../../../../../clockwork/include -I/home/dhuff/h2h2clockwork/Halide-to-Hardware/clockwork/barvinok-0.41/isl -fPIC -I/home/dhuff/h2h2clockwork/clockwork/barvinok-0.41/isl/ -c bin/clockwork_codegen.cpp -o bin/clockwork_codegen.o
In file included from bin/clockwork_codegen.cpp:2:0:
bin/maxpool_memory.cpp: In function ‘prog maxpool()’:
bin/maxpool_memory.cpp:11:27: error: ‘arg_0’ was not declared in this scope
int32_t &hw_output_s0_c = arg_0;
^~~~~
../../hw_support/hardware_targets.mk:138: recipe for target 'bin/clockwork_codegen.o' failed
make: *** [bin/clockwork_codegen.o] Error 1
Any idea what is going on here? Thanks!
Should be #include "ExtractHWAccelerators.h"
@jeffsetter One of the unet compute functions returns uint 8 here:
Is this going to be supported on the CGRA? If not could you replace with a function that returns hw_uint<16>?
Compile different unet schedules:
NN list:
Image Processing Applications
@jeffsetter @thenextged I'm trying to add max-pooling, which needs a 3D input and output (app here: https://github.com/StanfordAHA/Halide-to-Hardware/tree/maxpool_example/apps/hardware_benchmarks/apps/max_pool_2x2 ). When I run make run-cpu
I get:
dhuff@kiwi:~/h2h2clockwork/Halide-to-Hardware/apps/hardware_benchmarks/apps/max_pool_2x2$ make run-cpu
./bin/process run cpu input.png
Error: Input buffer input requires a buffer of exactly 3 dimensions, but the buffer passed in has 2 dimensions
../../hw_support/hardware_targets.mk:249: recipe for target 'run-cpu' failed
make: *** [run-cpu] Aborted (core dumped)
I've tried to modify process.cpp
to use a 3D buffer here:
What am I doing wrong here?
A lot of the designs coming out of the master branch are extremely large, the resulting bitstreams have around the order of 10x more configuration that prior to whatever codegen changed happened. It seems like a lot of the extra things are unnecessary control logic that doesn't need to be synthesized, is there some set of optimization passes that can be run to shrink the resulting designs?
I have installed Halide and CoreIR according to this tutorial.
I want to compile the "apps/hardware_benchmarks/apps/pointwise" application to get the CoreIR of this example application, and I use "make design" command to compile, but I got the following error info:
/home/linuxbrew/.linuxbrew/bin/ld: CodeGen_PTX_Dev.cpp:(.text+0x5f35): undefined reference to
llvm::legacy::PassManager::~PassManager()'
/home/linuxbrew/.linuxbrew/bin/ld: CodeGen_PTX_Dev.cpp:(.text+0x5f41): undefined reference to llvm::legacy::FunctionPassManager::~FunctionPassManager()' /home/linuxbrew/.linuxbrew/bin/ld: CodeGen_PTX_Dev.cpp:(.text+0x5f48): undefined reference to
vtable for llvm::raw_pwrite_stream'
/home/linuxbrew/.linuxbrew/bin/ld: CodeGen_PTX_Dev.cpp:(.text+0x5f5f): undefined reference to llvm::raw_ostream::~raw_ostream()' /home/linuxbrew/.linuxbrew/bin/ld: CodeGen_PTX_Dev.cpp:(.text+0x62c6): undefined reference to
llvm::DataLayout::~DataLayout()'
/home/linuxbrew/.linuxbrew/bin/ld: ../../../../distrib/lib/libHalide.a(CodeGen_PTX_Dev.o): in function Halide::Internal::CodeGen_PTX_Dev::dump() [clone .localalias.208]': CodeGen_PTX_Dev.cpp:(.text+0xe9): undefined reference to
llvm::Module::print(llvm::raw_ostream&, llvm::AssemblyAnnotationWriter*, bool, bool) const'
/home/linuxbrew/.linuxbrew/bin/ld: ../../../../distrib/lib/libHalide.a(CodeGen_PTX_Dev.o): in function _GLOBAL__sub_I_CodeGen_PTX_Dev.cpp': CodeGen_PTX_Dev.cpp:(.text.startup+0x40): undefined reference to
LLVMLinkInMCJIT'
/home/linuxbrew/.linuxbrew/bin/ld: ../../../../distrib/lib/libHalide.a(CodeGen_PTX_Dev.o):(.data.rel+0x0): undefined reference to llvm::DisableABIBreakingChecks' collect2: error: ld returned 1 exit status make: *** [bin/pointwise.generator] Error 1
The output access pattern is not correct for denoise buffer in camera pipeline. It has two extra dimensions.
@jeffsetter I was comparing the cgra pointwise output to the output I get with the coreir and noticed that one of the pointwise compute units casts its output to uint8
:
While the corresponding coreir compute uses 16 bit arithmetic in all compute units.
Can this be fixed or am I misunderstanding something about the outputs?
When multiple producers connect to a single consumer, there needs to be some synchronization between the valid signals. There are issues when they are out-of-sync, as when they have a different valid signature.
@jeffsetter I'm trying to build a vanilla CPU unsharp and I'm getting the following error:
cmd: g++ -fstack-protector-all -std=c++11 regression_tb_unoptimized_unsharp.cpp unoptimized_unsharp.cpp
unoptimized_unsharp.cpp: In function ‘void op_hcompute_hw_input_stencil(HWStream<hw_uint<16> >&, hw_input_stencil_cache&, int, int, int, int)’:
unoptimized_unsharp.cpp:2142:24: error: ‘hcompute_hw_input_stencil’ was not declared in this scope
auto compute_result = hcompute_hw_input_stencil(input_copy_stencil_hw_input_s0_x_c__hw_input_s0_y_c__hw_input_s0_c_value);
^~~~~~~~~~~~~~~~~~~~~~~~~
unoptimized_unsharp.cpp:2142:24: note: suggested alternative: ‘op_hcompute_hw_input_stencil’
auto compute_result = hcompute_hw_input_stencil(input_copy_stencil_hw_input_s0_x_c__hw_input_s0_y_c__hw_input_s0_c_value);
^~~~~~~~~~~~~~~~~~~~~~~~~
op_hcompute_hw_input_stencil
clockwork: prog.cpp:2848: std::vector<std::__cxx11::basic_string<char> > run_regression_tb(const string&): Assertion `res == 0' failed.
Also I don't see unsharp_compute.json
in coreir_compute.
Application list
@jeffsetter I'd like to have a rom test that is simpler than camera pipeline. Maybe just some pointwise math that looks up something in a ROM?
To do:
Most of these muxes are due to incorrectly indexed buffers. The most problematic of these are muxes with more than one input. The following are the applications with this issue.
Keyi @Kuree is running CGRA pnr test and need the unified buffer to be generated. When I set use_ubuffer=true
, it break your coreHLS codegen. Do you have a quick fix for this? @dillonhuff
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.