fix: run a5sim bgemm through the shared pipe path#397
fix: run a5sim bgemm through the shared pipe path#397zhoubot wants to merge 1 commit intohw-native-sys:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request enhances the CPU simulation environment by introducing a mechanism to manage execution context, task cookies, and shared storage. It implements thread-local variables and a global storage map to track simulation state, and updates the kernel compiler to handle core-specific definitions and platform-specific linker flags. These changes enable the unification of kernel code by removing simulation-specific branches in test kernels. I have no feedback to provide.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dde86eb8a1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| uint64_t start_time = get_sys_cnt_aicore(); | ||
|
|
||
| // Execute the task | ||
| pto_cpu_sim_set_task_cookie(reinterpret_cast<uint64_t>(payload->args)); |
There was a problem hiding this comment.
Guard CPU-sim task-cookie hook behind __CPU_SIM
aicore_execute now calls pto_cpu_sim_set_task_cookie(...) unconditionally, but the only implementation in this repo is in the sim host runner (src/a5/platform/sim/host/device_runner.cpp). This executor source is shared by the A5 runtime build (src/a5/runtime/tensormap_and_ringbuffer/build_config.py) and is linked for onboard via src/a5/platform/onboard/aicore/CMakeLists.txt, so non-sim A5 builds/runtime binaries will carry an unresolved CPU-sim symbol path. This should be gated to CPU simulation (or have a non-sim definition) to avoid breaking onboard builds.
Useful? React with 👍 / 👎.
8f28c20 to
61ee9e8
Compare
61ee9e8 to
da3d1e0
Compare
Summary
__CPU_SIM-only GM fallback from the A5 BGEMM mixed kernel so sim and hardware use the same[A, B, C]TPUSH/TPOP interfacea5simkernel compilation to preserve the requested core role (__DAV_CUBE__vs__DAV_VEC__) instead of building two no-op host kernelsRoot Cause
There were two separate issues in the end-to-end
a5simpath:core_type, so both compiled kernel binaries were missing__DAV_CUBE__/__DAV_VEC__. That left the mixed BGEMM kernels effectively empty even after PTO-ISA pipe support was fixed.This PR switches the example back to the shared cross-platform interface and publishes the runtime hooks that the PTO-ISA fix consumes.
Validation
Result:
TEST PASSEDC: PASS (131072/131072 elements matched)Related