-
Notifications
You must be signed in to change notification settings - Fork 59
PIFO Trees: Telemetry #1736
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
PIFO Trees: Telemetry #1736
Conversation
Thanks for getting us started on this @anshumanmohan! What do you think about formalizing some of the details of the architecture in a system diagram? This would also give a head start for the figure needed in the paper and act as a nice at-a-glance reference for what the architecture is doing |
Sure thing! Here's a quick sketch. It's actually an animation that I'll present when we meet, and hopefully it'll make more sense then. Also, I spoke to @sampsyo and he suggested I can probably do some cleanup in the stats component: instead of an internal All solid rectangles are components. The triangle reflects the logical PIFO tree, but of course there isn't actually a PIFO tree component; you just talk to the PIFO tree by talking to root PIFO component. I've used dotted lines to represent the two .data arrays. FIFOs are just boxes, and PIFOs are boxes with a few annotations. Here's what those mean: |
Awesome, the visual is helpful but also leads me to a question: does each "managing queue" have access to its own stats component? If that is the case, is the controller accumulating this information and generating some form of cumulative statistics to report to the outside world? |
Right now only the root "managing queue" has a stats component, and it is not learning anything from its sub-queues about their flow-splitting decisions. This means that the (sole) stats component is only ever getting the most coarse-grained info, from the root. This is an interesting space to explore, though. What I have above is a little unsatisfying. Two further options that will get us finer-grained info:
|
…into pifo-tree-telemetry
…into pifo-tree-telemetry
I think this will now pass the compiler tests, which is a step in the right direction. We're not done yet though. @calebmkim I am wondering if I can get your eyes on something. Let's look at the Calyx file generated for now, which I've pushed temporarily. My question is this: are you thinking that we do currently have the issue where two different copies of the
In case you are right, would you remind me what the fix was? I seem to recall you saying something about having one stats component defined at the |
Hmmm, I still think there's the problem. If I'm understanding correctly, here's basically what's going on.
I think you only want one instantiation of
This is the same program as before, but very clearly, there are two different(ly named) SolutionSadly the solution is probably going to be very ugly, since we have given up on passing components by reference (bc we can't invoke things because we need both to run for the exact same time). It seems like I think it would look something like this:
|
Thanks Caleb! Re: why it's not working, I think I get it 100%. Those two instances of Re: the solution, let me try to say it at a high level first. Please nitpick me ruthlessly.
|
1
Yep 2
Yeah, and I think this kind of goes hand in hand with your other comment:
Since main's control program is just one group ("faux-rtl"), that group will always be enabled. 3
To nit-pick, this isn't necessarily "when the invoke returns". So what we're really saying is that, for the entire time the 4
Yeah basically. 5One last thing: it seems like |
This all sounds great, Caleb! Thanks!! I'll get to it, and we'll see what comes up. |
This works for now because the controller is not looping forever. It soon WILL, and then we'll need to do some RTL-like coding to make sure that the par block is guarded by the dataplane and not the controller
This is now working! I have not implemented the approach that Caleb and I shook on just above, opting instead for a lighter-weight version that @sampsyo and I discussed. The high-level intent earlier was for We have instead opted for a style where To make this work, I had to adapt The eDSL code is ugly as sin, in large part because it still does lots of ugly things that were (I think) necessary in the "batch mode" |
I have pushed the .yx file generated by the eDSL just for ease of review. I will remove it afterwards, and before merging. The point of pushing it is to demonstrate that we are no longer instantiating multiple copies of |
…into pifo-tree-telemetry
I have tidied up the eDSL code some, which is nice at the Python level and has led to a leaner hardware design. Kinda fun to see the changes here. This is now ready for review. I would like to catch the other queues up to this nicer style, but that's going to be a separate issue. |
This is WIP and is not ready for serious review. I am just opening this PR so I can seek help getting it all the way there. This PR will eventually close #1697: the overall plan is exactly as summarized at the bottom of that thread.
Important background:
pifo.py
in Calyx is actually a more general thing: it is simply a queue that orchestrates two sub-queues.0
or1
. Based on the flow, it thenpush
es the input into one of its sub-queues. We'll call this the "top-level" flow inference to distinguish it from whatever further flow inference the sub-queues may go on to perform.A summary of what I have done in this PR so far:
stats
, which is a handle to a stats component. If passed a stats component, the PIFO component will, after each successfulpush
, report the top-level flow of the recently pushed item to the stats component.report
andflow
.count_0
andcount_1
.report
is high, it also expects two further ref-registers. It drives the values ofcount_0
andcount_1
to those ref-registers and is done. In this case the value offlow
is ignored.report
is low, it actually computes statistics us 8000 ingflow
: it increments the appropriate counter and is then done.flow
, a raised flag forreport
, and cells into which it wants the stats to be written by reference.Further work is required all over:
report
.