[WIP] Fix: add PTOStride alias and remove pipe_barrier for A5#229
[WIP] Fix: add PTOStride alias and remove pipe_barrier for A5#229ChaoZheng109 wants to merge 1 commit intohw-native-sys:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses two key issues: a naming conflict with the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces two main changes: adding a PTOStride alias to work around a naming conflict and updating pipe_barrier calls from PIPE_V to PIPE_ALL for A5 hardware compatibility. The changes appear correct and address the intended issues. However, the PTOStride alias is duplicated across many files. I've suggested moving it to a common header to improve maintainability. I also noted a minor inconsistency in an updated comment.
| template <int64_t SN1 = DYNAMIC, int64_t SN2 = DYNAMIC, int64_t SN3 = DYNAMIC, | ||
| int64_t SN4 = DYNAMIC, int64_t SN5 = DYNAMIC> | ||
| using PTOStride = pto::Stride<SN1, SN2, SN3, SN4, SN5>; |
There was a problem hiding this comment.
This PTOStride template alias is defined in multiple files across this pull request, leading to significant code duplication. To improve maintainability and reduce redundancy, please consider defining this alias in a single common header file (e.g., a new header in pto/common/ or an existing one if appropriate) and including it where needed. This would apply to all other kernel files modified in this PR.
|
|
||
| // Phase 2: Scalar arithmetic in RowMajor (kScalarRows, kScalarCols) | ||
| // pipe_barrier(PIPE_V) required between each dependent vector operation | ||
| // pipe_barrier(ALL) required between each dependent vector operation |
There was a problem hiding this comment.
The comment was updated to (ALL), but the code uses PIPE_ALL. For consistency with the code and the corresponding change in examples/host_build_graph/paged_attention/kernels/aiv/aiv_online_update.cpp, please update this comment to use (PIPE_ALL).
// pipe_barrier(PIPE_ALL) required between each dependent vector operation- Define PTOStride template alias (wrapping pto::Stride) in each kernel file to resolve naming conflict with the global enum class Stride defined in ccec's __clang_cce_vector_intrinsics.h on A5 platform - Remove pipe_barrier(PIPE_V) calls in aiv_online_update as A5 hardware provides ordering guarantees natively
3bfbc45 to
9460b33
Compare
file to resolve naming conflict with the global enum class Stride
defined in ccec's __clang_cce_vector_intrinsics.h on A5 platform
provides ordering guarantees natively