-
Notifications
You must be signed in to change notification settings - Fork 53
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
exp
operator in FuTIL.
#299
Comments
I wrote this for a general exponent operator. Maybe something similar to this?
|
That looks great! For situations like this, would it make sense to have a way to invoke FuTIL primitives as Dahlia functions? That is, sort of like how we can "import" C header functions when Dahlia targets HLS C, we could "import" black-box FuTIL functions an invoke them. It could simplify the process of integrating Dahlia with other stuff. And as in the |
@rachitnigam Yeah I wrote a working example (below) before reading your post in the
That's exactly what I was thinking as well. I just wasn't sure if I was trying to, in a way, re-invent the wheel with the efforts behind |
Right, something like that would be cool. What I was referring to above is that we already have a similar import mechanism for running black-box C function calls when Dahlia generates HLS C for its Vivado backend. Like this: That imports |
Interesting, I wasn't aware of this. |
#404 provides a working |
Hi Adrian and Rachit, both of you mentioned on separate occasions to use FuTIL to represent the
exp
operator. I just want to confirm whether or not this is along the lines of what you meant.Right now, for nn.softmax, I’m taking a Dahlia program and lowering it to FuTIL using external memories. Part of this includes inserting the import for
std_exp()
:import “std_exp.h” { def exp(x: ubit<32>): ubit<32>; }
This is then defined in the primitives library. The suggestion seems to imply that we should avoid the primitives library, and instead use a FuTIL component to represent
std_exp
.A current constraint is I’m lowering my programs from Dahlia, so I’d need to take in a Dahlia-level function to then lower into a FuTIL component. My naive approach is I’d need to create a component
std_exp
that takes in a constantN
and outputs the result ofexp(N)
.In Dahlia, that would look something like:
In FuTIL, the component would be something like what I've written below. This was written before @rachitnigam 's updates in #273 . So instead, it is probably correct to use the invoke statement when implemented.
The text was updated successfully, but these errors were encountered: