Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of residual block support for pyg_to_hls #645

Open
wants to merge 42 commits into
base: main
Choose a base branch
from

Conversation

green-cabbage
Copy link

@green-cabbage green-cabbage commented Aug 25, 2022

This is my first time submitting a pull request, let alone for work, so corrections are appreciated.

Description

  • I have added a custom block called residualBlock on top of existing nodeblock, edgeblock and edge_aggregate.
  • The nnet utils h file for this block is located on templates/vivado/nnet_utils/nnet_graph.h because I am implementing this on my group's GNN, but could more properly belong in templates/vivado/nnet_utils/nnet_merge.h
  • There's yet no dataflow/pipeline distinction for residualBlock. Mathmatically it's a simple operation so there may not be a need to.

Type of change

  • New feature (non-breaking change which adds functionality)

abdelabd and others added 30 commits December 26, 2021 21:02
Add files via upload

Update hls_layers.py

Update hls_layers.py

Update hls_model.py

Update hls_model.py

Update vivado_writer.py

Add files via upload

Update vivado_template.py

Update vivado_writer.py

added vec_to_mat, mat_to_vec

Delete nnet_graph.h

Add files via upload

handling for 1D-vector inputs and outputs

Update vivado_writer.py

Update pyg_to_hls.py

Update hls_layers.py

Update vivado_template.py

Update pyg_to_hls.py

Update hls_layers.py

Update nnet_activation.h

Update nnet_dense_resource.h

wip

Add files via upload

Add files via upload

added testbench handling for concatenation

added weights tranpose, deleted hard-coded testbench

add nnet::matrix_config

cleaning up

add HLSModel_GNN._get_top_function(), HLSModel_GNN.predict(..)

top-level conversion function (starting ground)

update naming conventions:'Rn' --> 'node_attr', 'Re' --> 'edge_attr'. update order of inputs: 1.node_attr, 2.edge_attr, 3.edge_index

update naming conventions, edge_index shape (now, edge_index.shape=[N_EDGE, 2])

add max, mean aggregation. update naming conventions

generalize all the aggregation methods in a single function

cleaning up

added precision and testbenching

added precision handle

added handling for different flow direction

cleaning up from 'save intermediates'

slight improvement on max aggregation

fixed max-aggregation

minor updates

generalizing pyg_to_hls()

tidying up

improved handling for user-input precision

re-included extra #pragma HLS UNROLL, don't know if this is correct yet

implemented LUT-division

missed a semicolon

added handling for initial aggregation layer

added Aggregate layer, self._check_inputs()

added Aggregate layer

use existing test bench code

update naming conventions

tidying up, added #pragma HLS UNROLL to nnet_array::vec_to_mat/mat_to_vec

ditched single-edge aggregation functions

re-added single-edge-aggregation functions

re-added #pragma HLS ARRAY_PARTITION

speciy model inputs; parition

merge

cleaning up, update naming conventions

ditched single-edge-aggregation functions, improved sender-index/receiver-index handling

changed 'else if{' to 'else{ if{'

split different aggregation methods into separate functions

max not fully functional yet, just committing changes before switching branch

got max-aggregation LOGIC working, still testing build_prj.tcl

fixed up max-aggregation again
…ing. Also may need to move the residual block to nnet_merg.h bc it's a more of a merge block than a graph block
…y gives bad conversion so I commented it off for now. Still getting bad MSE for our own data, but getting good MSE values with data given in the walkthrough
@@ -331,6 +333,66 @@ void softmax(hls::stream<data_T> &data, hls::stream<res_T> &res){
}
}

// template <class data_T, class res_T, typename CONFIG_T>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented out code, printouts, etc, needs to be removed. New printouts should also be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants