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
Fix stream allocation scoping #766
Conversation
Codecov Report
@@ Coverage Diff @@
## master #766 +/- ##
===========================================
- Coverage 80.49% 58.83% -21.66%
===========================================
Files 222 224 +2
Lines 39796 40707 +911
===========================================
- Hits 32031 23949 -8082
- Misses 7765 16758 +8993
Continue to review full report at Codecov.
|
I think the approach is still not the right one. What we want is to make sure that FPGA streams are always allocated in exactly one place, which is at the beginning of kernel generation. My intuition would be that we have to:
|
Okay - I found something interesting. The place where the stream allocation "would" be suppressed [here],( dace/dace/codegen/targets/fpga.py Line 703 in 62ae0f0
|
Honestly I already find it a bit weird that we are suppressing these allocations here. Have you checked the callsite of where |
exactly this. This PR should be changed to focus on making sure the FPGA codegen allocates all streams in one place. |
@definelicht This would be the stack trace (made it throw an exception if an already defined stream reaches this bit of code). It is called by
I will also need to ensure that all streams are allocated once (at the top-level). At the moment, only data shared between two or more subgraphs are allocated "top-level locally". (Missed that bit before.) This should be rather straightforward - just look for all streams in the subgraphs and allocate them when it allocates the data shared between subgraphs. |
As a first step, make sure that all these streams are allocated where we want them to be allocated (i.e., at the beginning of generating an FPGA kernel). Then we can see if we need to prevent them from being reallocated later, but we might not need to, because of that code you linked. |
…/dace into fix-stream-allocation-scoping
Now all streams are allocated "top-level locally". The FPGA codegen now allocates data at that level if it shared between two subgraphs (status-quo) or if it is a stream. There is still the issue with them being declared locally due to that explicit check mentioned before. dace/dace/codegen/targets/fpga.py Line 703 in 62ae0f0
@TizianoDeMatteis It was added by this commit. Could you explain to me why this check is needed? I am not familiar with the concept of views in DaCe. |
This is not directly related to views. We need to allocate anyway streams to keep track of their names across the SDFGs hierarchy (a stream may have a certain name in the top-level scope, then another one in a nested SDFG and so on...) |
There was an issue where streams would be allocated globally (to a state) and locally. This should not happen. The expected behaviour is to never allocate streams locally to a scope.
This PR fixes this issue by never including streams in the scope transient analysis.