Check-in some changes to run the kernels correctly - #323
Conversation
- Add CgraRTL_relu4x4_test_from_yaml.py: ReLU kernel test on 4x4 Mesh CGRA using relu.yaml compiled kernel config (II=5, 32 iterations) - Fix script_generator.py: swap STORE src_operands to match MemUnitRTL hardware expectation (in0=address, in1=data vs YAML order [data, addr])
…flag Bug #1 - CrossbarRTL all-or-nothing: Stale prologued data blocked entire crossbar - Mask recv_valid_vector, exclude prologued from send/recv_required_vector - Gate changed: recv_valid_or_prologue_allowing_vector Bug #2 - PhiRTL shared first flag: Multiple PHI_START on same tile failed - Detect iteration wrap via ctrl_addr, clear s.first only at boundaries - Added prev_ctrl_addr tracking Tests: ReLU 379 cycles (pass), SpMV 759 cycles (pass)
Oh sorry It is a typo, I mean char😂 |
| s.recv_data_from_routing_crossbar[i].rdy @= \ | ||
| (s.inport_opt.operation == OPT_NAH) | \ | ||
| (s.inport_opt.fu_in[i] == 0) | \ | ||
| reg_towards_fu | \ | ||
| s.send_data_to_fu[i].rdy |
|
Hi @Jackcuii, as long as you can resolve my comments, it should be okay to check in. Plz try to resolve them ASAP. Thanks! |
Okay~ I am checking in the logics the comments mentioned in the branch one by one to make sure all the yaml tests can still pass. It is somehow black-boxed😂 |
I understand that. Can you then ask your agent to apply my suggestions to see whether it works? |
|
Sadly some comments will cause some tests to fail, I am working on it |
|
new TODO: merge #322 to this branch after folks' reviews |
I just merged it |
|
@Jackcuii I remember you mentioned that you would update the tests, and double-check the last one finished or not? So then we can review again and merge this? |
omg I just found I did not push all the commits 🤣 here they come. Some logics have been changed to merge with main 🫠 |
# Conflicts: # mem/register_cluster/RegisterBankRTL.py
|
Hi @Jackcuii, any update :-) ? |
Hi Sir Tan, the hacky logics are removed and tests are passed. But Yosys seems to fail this time ... checking |
There was a problem hiding this comment.
Why do we need to touch this folder?
There was a problem hiding this comment.
Let me check it out, seems related to the Yosys check
| field_dict[kAttrReadRegIdx] = [RegIdxType for _ in range(num_fu_inports)] | ||
| # One means the next scheduled access to this register needs a live version. | ||
| # A feedback write replaces it; a predicated-away write leaves it unchanged. | ||
| field_dict[kAttrReadRegRetain] = [mk_bits(1) for _ in range(num_fu_inports)] |
There was a problem hiding this comment.
This new filed of read_reg_retain is suspicious... What is it used for? Can we avoid adding it?
There was a problem hiding this comment.
Sorry Sir Tan I am moving to Swizterland these days... 🫠
It seems to be necessary:
read_reg_retain marks whether the register version read by the current ctrl
step has another scheduled reader before the next write. The register bank
only sees the current ctrl word, so without this information it cannot
distinguish a non-final read from the final read. Clearing on every read
breaks values shared by multiple ctrl steps, while never clearing blocks the
next write. The script generator computes this bit from the cyclic per-
register read/write order; it is not kernel-specific. We could avoid
exposing the field only by adding control-memory lookahead/reference
counting in hardware or by rewriting the schedule, both of which are
substantially more complex.
🤔 maybe need to dive into the register?
There was a problem hiding this comment.
I don't get what it wants to achieve. "Clearing on every read breaks values shared by multiple ctrl steps"...
in which scenario/kernel it needs this "fix"? We already and skid buffer in master and enable holding reg's consumption if current ctrl has other consumers..
There was a problem hiding this comment.
@Jackcuii Can we revert the register related change, and exclude the failed test? We can investigate the register related issue in a standalone PR. How does this sound?
There was a problem hiding this comment.
It breaks GEMM and GEMV, others are good
#326
(To make sure we still have a all-pass version for AE, this old branch is kept)
I somehow know the reason (bad habit x_x, did not record it carefully when I debugged a few month ago)
There was a problem hiding this comment.
Hi Sir Tan I think the left _retains are leftover and not function at all. I just remove them :)
There was a problem hiding this comment.
Cool, thanks! Can you also sync that PR with master for submission?
No description provided.