How to implement Systolic Array in DSLX #1663
Replies: 12 comments 4 replies
-
XLS[cc] is a compiler that targets hardware. Specifically, it targets hardware in the sense that the final output is verilog that you can (eventually) send to a fab to get built into a physical chip. Though its syntax is c++ it actually only supports a small subset of what a full C++ compiler does. To answer your questions:
|
Beta Was this translation helpful? Give feedback.
-
It's very helpful. Thanks for your answer!
|
Beta Was this translation helpful? Give feedback.
-
You say you "install" with the command
|
Beta Was this translation helpful? Give feedback.
-
Thanks for sharing this. Two problems I met: |
Beta Was this translation helpful? Give feedback.
-
I think this is a question for XLS[cc]'s maintainer at this point, rather than the rest of the contributors, since XLS[cc] is more of its own thing. @spurserh, want to weigh in? |
Beta Was this translation helpful? Give feedback.
-
There is an arbitrary precision float implementation in dslx if you want to use that language instead. Take a look at our docs to learn more: https://google.github.io/xls/floating_point/. There isn't really any supported way to mix the xlscc with dslx stuff. With enough effort you could probably get something hacked together though (maybe inline apfloat compiled routines into asm blocks).
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Hello team, But could you give me more hint about the status of your tools (especially syntax):
Q3: As is stated here, I also agree that the I appreciate all your help. And this will be very valuable for my project and I will be willing to contribute to you if my systolic array does work. Thanks very much. |
Beta Was this translation helpful? Give feedback.
-
@Mars-Cat2023 I started to update the matmul example in b59c99a to properly use array of channels and lower to IR, hopefull that's useful. In order to do repeative channel operation and |
Beta Was this translation helpful? Give feedback.
-
Yes, I think https://github.com/google/xls/blob/main/xls/examples/matmul_4x4/matmul_4x4.x is in a good shape, there is still a few workaround for pending issues (like #1750) but it does demonstrate idiomatic usage of
I believe it does support them all, I did remove the Hope that helps. |
Beta Was this translation helpful? Give feedback.
-
(3) May I ask how can we write an array like A[6] = [4,2,1,3,3,5]; in DSLX? Otherwise, how can we write test_proc with arbitrary inputs easily? |
Beta Was this translation helpful? Give feedback.
-
Responding to your questions (1) and (4), RE: order of array indexing - this has been discussed before, e.g., #616 (comment) Roughly, the issue here is a mismatch between Rust (which inspired the syntax of DSLX) and the syntax of other languages, including both SystemVerilog and most C-style languages. Currently, when you index into an array like F32[3][5], you're indexing from the outside in. So: an F32[3][5] array is a 5-element array of F32[3]'s, which are in turn 3-element arrays of F32s. Your confusion is one more data point suggesting that we need to fix this mismatch in some way! |
Beta Was this translation helpful? Give feedback.
-
Hi!
How do we write things about "vector<int>" in our XLS[cc]? I would like to read and write values from and to xls channels (i.e., __xls_channel). Do we support that? Or other alternatives?
Or at least arrays like "int A[10];" "int A[10][10];". And what other array features do we support (How to access? etc.) What's the syntax I should use? It seems like we cannot do that with normal C++ code. Could you give me some small examples for this?
Could you tell me which standard C++ library do we support in XLS[cc]? (Maybe not the same library name, but XLS[cc] version) If so, how can I import that into my .cc code?
Beta Was this translation helpful? Give feedback.
All reactions