Edmund Lab Notebook #158
Replies: 19 comments 17 replies
-
Oops, I need to make this a habit to update more. Optional ParametersFirstly, work is mostly done on a new feature for optional parameters, formatted as follows: comp MultComb[#IN_WIDTH, ?#OUT_WIDTH=#IN_WIDTH]<G: L-(G), ?L: 1=G+1>(
@[G, L] left: #IN_WIDTH,
@[G, L] right: #IN_WIDTH,
) -> (
@[G, L] out: #OUT_WIDTH,
) where L > G, #IN_WIDTH <= #OUT_WIDTH, #IN_WIDTH > 0, #OUT_WIDTH > 0; There are still a couple issues though: namely, these have to be made explicit at some point in the evaluation to calyx, possibly in the monomorphize pass. There also may be issues with how they are represented in the IR, but that might need a little discussion. The code currently builds but actually compiling the code leads to Floating Point LibraryBeen working on the floating point library a little bit, and have implemented addition with full parametrization using the following signature:
Realised a need for optional parameters mainly while working on the multiplication module, where I wanted to perform a multiply while retaining full precision without sign extending both arguments before hand. Also in general, there are often a lot of not very necessary parameters in a lot of modules providing useful but calculatable information. Ideas, Thoughts, ImpressionsJust a quick list of thoughts I've had about the language that might want discussion:
|
Beta Was this translation helpful? Give feedback.
-
More updates, less work done this week because of a lot of travel related things. I mainly got a lot of bugs fixed and just recently finally managed to have everything compile. Optional ParametersOptional parameters seem to be working well now, there were some issues with elaborating parameters in the monomorphize pass which is where I decided to add things, and until recently externals still did not work very well with elaboration, but now things are mostly passing. FP LibraryOn the side of the library, everything has been done and the tests have also been added to the library; however, they are currently not passing for some unknown reason which I am working on fixing at the moment. FFTWith the FFT module I have been figuring out how most of it will likely work, but I am stuck currently on the twiddle factor generation which I will likely need to research more. The problem is pretty much that it requires you to generate values along a sine wave, which is most easily done using verilog-generating python to generate a properly sized table, in which case the entire FFT would have to be python-generated which I'm not sure is exactly what we are looking for. I am looking into whether macros could be used in some way but I haven't found anything yet. |
Beta Was this translation helpful? Give feedback.
-
Would be nice to have some more documentation of the filament library, I just spent over an hour trying to figure out a bug only to realize muxes chose the left argument when the selector was 1, not when it was 0. |
Beta Was this translation helpful? Give feedback.
-
Possibly allowing negative parameters in some simpler way would be useful in the future? Having to check which of two arguments of a subtraction are greater in order to decide whether to generate a |
Beta Was this translation helpful? Give feedback.
-
Optional ParametersShould be done entirely, no issues as of now. Floating Point LibraryFinished as of now, all tests passing! Both add and mult have been tested with 32 bit floating point only, and exhibit correct behavior. Tests are also added to runt by default. IR - Assume passResearched a bit about how the IR is structured and got the pass started, but working on some egg parsing to possibly expedite the generation of assumptions for custom functions. Currently thinking about localizing everything within |
Beta Was this translation helpful? Give feedback.
-
Would be incredibly nice to have some recursive printing for |
Beta Was this translation helpful? Give feedback.
-
IR - Assume PassFinished pass and merged! Floating point librarycherrypicked commits and wrote tests, merged! Optional Parameterscherrypicked commits again and merged properly with updated main, also added tests. Compilation passBegan compilation pass, currently working for externals. IR needs work on issues like storing unannotated ports, etc which I plan to work on before continuing work with compilation. I still haven't really looked at the lower pass yet, which means I still have to figure out FSM generation, etc, but progress is coming along slowly. |
Beta Was this translation helpful? Give feedback.
-
IR - Compile PassLots of progress so far but I've been having a couple issues that I'm currently working through:
It should be almost done, but I haven't tested anything yet so I hope that isn't a huge issue. All of compliation otherwise is already done (with lower included). |
Beta Was this translation helpful? Give feedback.
-
Compilation PassMostly finished but having issues with port name generation and connecting events to interface ports properly. Need to work on the info struct in order to save information about port connections, in order to properly connect invoke defined ports and events to their component counterpart in calyx and the IR. Fixed a couple bugs regarding event and port generation for optional events and ports. Just added invoke and instance information to the IR, and will continue adding information for ports and connects. |
Beta Was this translation helpful? Give feedback.
-
Compilation PassCompletely finished and functional at the moment, passing monomorphic tests. Opened some issues about possible new IR features that have yet to be discussed, so currently held back due to that in case the features are removed or changed, which would break the code. Floating pointAdded edge case tests and spent time researching UC berkeley's testfloat. Figured out how to make it work but currently also tabled as it is not super important at the moment. FFTRestarted work on the library, removed old stale pull request. |
Beta Was this translation helpful? Give feedback.
-
Would be nice to see some documentation on a couple useful things: How exactly are Similarly, with invoke ports, how are these defined? |
Beta Was this translation helpful? Give feedback.
-
Lower passMerged with all the new features implemented (Foreigns, etc). Bundle Elim PassAlso completed, using the Local Port EliminationCompleted as well, also discovered some issues within the original ast compiler that showed incorrect behavior, but corrected in the IR. Astconv fixBeginning work on compiling the signature first in the double pass. Next stepsHave a couple things I want to work on soon-ish:
|
Beta Was this translation helpful? Give feedback.
-
Lots of smaller changes this week! Bundle Elim, Assignment Check, Local Port ElimMerged local port elim into bundle elim, and merged the whole PR into main. Also added a new assignment check pass to assert that every port is written to once and only once.
Info ChangesMerged a change on infos that made them use struct variants and added some casting functions that checked if information was added. Astconv RewriteAstconv was rewritten to compile signatures first before anything else, allowing for recursive and mutually recursive components to compile. Also adds even-odd, a mutually recursive test to make sure things work
Expr and Prop interningAdded simplification rules for prop interning similar to expr interning, and fixed a bug in expr interning that was causing some bugs.
Current WorkI have a couple PRs currently open with a few more IR related features:
|
Beta Was this translation helpful? Give feedback.
-
A little late on this weeks updates, but here goes: Visitor updateMerged the pass, which adds a Max States passMoved max states generation function into the utilities file and exposed it as public, also implemented the Let-bound ParametersAdded the ability to define parameters in component using let bindings (
Current Work
|
Beta Was this translation helpful? Give feedback.
-
Frontend Redesign Proposal Noteswant
ideas
File scope
Components
Nodes
Error Handling
Utils
|
Beta Was this translation helpful? Give feedback.
-
FloPoCo Build debuggingSpent a couple hours debugging the flopoco build failures, the eventual issue was that flopoco requires This in turn broke flopoco, and I spent a few hours slogging through logs and debugging installation scripts before I finally realized this. This would have been impossible to find if I had not manually looked through the old logs in |
Beta Was this translation helpful? Give feedback.
-
HypermapperGot a simple version of hypermapper working for the flopoco FFT this week. Currently, the optimizer varies clock period and flopoco target frequency to minimize the following:
It runs 10 parallel synthesis runs per optimization iteration. If the synthesis doesn't meet timing, I have it set the return values of the function arbitrarily to I'm going to try to get some graphs generated as well (pareto plots, etc) which would be cool to see. |
Beta Was this translation helpful? Give feedback.
-
Filament Optimization IdeasBasic problem statement: For example, take a fixed point multiply add implemented entirely in filament: comp FixedMultiplyAdd[W, D]<'G: 1>(
X: ['G, 'G+1] W,
Y: ['G, 'G+1] W,
Z: ['G, 'G+1] W,
) -> (
out: ['G+1, 'G+2] W
) {
mult := Mult[W, 2*W](X, Y) // 2*W being the output width here
ext := SignExtend[W, 2*W](Z); // Extend Z before adding
add := Add[2*W, 2*W](mult.out, ext.out);
sliced := Slice[2*W, 2*W-D-1, W-D](add.out); // Slice the necessary bits
R := sliced.out;
} Clearly, we need some delay elements here as
Obviously, registering first here would save resources. We would like to have a system (possibly based on SDC modules) to do this sort of optimization automatically. This would mean
This system is different from something in, say, XLS, as these components are still required to satisfy the (possibly complicated) timing constraints of the inputs and outputs, which allow a form of constrained optimization not currently possible in other purely HLS languages. This could allow optimization to integraate with hand-optimized components, even hand laid out or analog parts in the future. |
Beta Was this translation helpful? Give feedback.
-
Notes
|
Beta Was this translation helpful? Give feedback.
-
Hi, this is a lab notebook for me to just jot down any problems, ideas, etc I have about filament!
Beta Was this translation helpful? Give feedback.
All reactions