-
Notifications
You must be signed in to change notification settings - Fork 29
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
[dataflow] Unified Systolic Array #232
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing! Just some minor issues.
for ri in range(Rtimes, name="row_loop"): | ||
for ci in range(Ctimes, name="column_loop"): | ||
# corner | ||
with allo.meta_if(i in [0, Rt + 1] and j in [0, Ct + 1]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This statement is a bit confusing. For example, for i in [0, Rt + 1]
, are you saying i
is either 0
or Rt+1
? In this case, it would be better to write it as a set (to be consistent with the math notation), i.e., i in {0, Rt+1}
.
r: int32 = in_R.get() | ||
c: int32 = in_C.get() | ||
# Core MAC | ||
acti: int32 = r |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write the full name (activation
) or use a proper shorthand (act
).
acti: int32 = r | ||
weight: int32 = c if flowtag else s | ||
psum: int32 = s if flowtag else c | ||
accu: int32 = acti * weight + psum |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, use acc
or accumulation
if hls.is_available("vitis_hls"): | ||
gemm(A_flat, B_flat, insts, C_flat) | ||
print(C_flat) | ||
C_tru = np.dot(A, B).flatten() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C_true
?
I have fixed the naming issues. Let me know if there are any problems. |
|
||
|
||
@df.kernel(mapping=[P0, P1]) | ||
def gemm(A: int32[M, K], B: int32[K, N], inst: int8[2], C: int32[M, N]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you pull the latest commit (need to rebuild) and see whether a single bool inst now works for both LLVM and HLS backend? If so, you can use inst: bool
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I'll try this later.
…rray Update to upstream.
The test of scalar interface looks good for csim. I've changed the interface to a single bool argument. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thx
Description
The implementation of unified systolic array to achieve GEMM with output-stationary or weight-stationary dataflow.
Examples
Numpy tests are included.
Checklist