Repository navigation
Enrich FIFO Logs - #1706
Enrich FIFO Logs#1706mrontio wants to merge 22 commits into
Conversation
- test_fifo_log_verbose_build: Test graph G with residual node - test_fifo_log_verbose_finnloop_build: MLO A -> G -> G -> G -> B - test_fifo_log_format_matches_rtl: Check format fifo_gauge.sv tests - main: benchmark across configurations with large input
Previously the time measured synthesis + simulation, fixed with a watcher class.
Previously log paths were only assigned in InsertAndSetFIFODepths, which didn't set outer-loop FIFO log paths. We introduce code additional traversal into BuildDataflowConfig, to re-parse the tree and add them into all FIFOs.
eab5a39 to
b002526
Compare
preusser-amd
left a comment
There was a problem hiding this comment.
Thanks, @mrontio!
This looks good.
auphelia
left a comment
There was a problem hiding this comment.
Thanks for this PR @mrontio!
This is a great feature to have.
Besides the inline comments and the separate comment on the test file, there are two things I'd like to ask you to add:
- Documentation for FIFO debug logging
- Add a new page docs/finn/components/streaming-fifo.rst (listed in components/index.rst) with a "Debug logging" section covering:
- what
debug_fifo=Truedoes: FIFOs are simulated with the fifo_gauge model, and verify_rtlsim_behavioral is enabled automatically; - where the logs go: debug/fifo_logs//<main|FINNLoop_N>/.log, for the phases fifo_sizing and stitched_ip_rtlsim;
- both log formats, including the header and summary line;
- fifo_log_verbose and fifo_log_flush:
- that they only apply with debug_fifo=True;
- what fifo_log_flush=0 means;
- the use case of watching logs while a simulation is running;
- the measured effect on simulation time and log size (from your benchmark).
- what
- Add a debug/fifo_logs/ entry to "Generated outputs" in command_line.rst that links to the new page.
- Mention in the DataflowBuildConfig comments for both settings that they only apply with
debug_fifo=True.
- Config checks in src/finn/builder/build_dataflow_checks.py
- Warning when fifo_log_verbose or fifo_log_flush differs from its default while
debug_fifo=False. Please compare against the dataclass defaults rather than hard-coding 65536. - Error when fifo_log_flush is None or negative. Currently
int(cfg.fifo_log_flush)would fail partway through the build.
- test_parse_fifo_log: test parser for correct & incorrect log formats - test_fifo_log_build: check mapping from graph to fifo log number
|
Hi @auphelia, Whilst writing docs, I noticed that the previous ONNX Node -> Log name mapping was not trivial (the enumeration was not intuitive). That enumeration predates when I was touching it, so I just want to make sure this name collision won't become a problem for other code. Thank you, |
Enriched FIFO Logs
Stall and performance analysis can be performed with the help with enriched FIFO logs.
This PR adds to
DataflowBuildConfig:fifo_log_verbose : bool-- Control whether FIFO log output is<data_in>(false) or<data> <direction> <cycle>(true).fifo_log_flush : int-- Control how often the logs are flushed to disk, to allow for either performance or improved live-probing.Example Output
An example FIFO log with
fifo_log_verbose=TrueYou can tell that after clock cycle 30192, the FIFO contains a single element, 0f10.
Example Usage
Performance Characterisation
The following table shows runs of the visualised graph (above), defined using the test file's main method. The test builds a graph G with 4 nodes, one in a residual path. It then constructs a graph with MLO: A -> G -> G -> G -> B, and runs 65536 * 4 inputs to it.
Interpretation:
Testing
We add the following tests:
Files Affected