Conversation
|
@laifenxiawucha review |
This comment was marked as low quality.
This comment was marked as low quality.
This comment was marked as low quality.
This comment was marked as low quality.
|
@laifenxiawucha review |
This comment was marked as low quality.
This comment was marked as low quality.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as low quality.
This comment was marked as low quality.
This comment was marked as resolved.
This comment was marked as resolved.
|
@laifenxiawucha review |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as spam.
This comment was marked as spam.
|
Requested in this mention. High
Medium
Given that this is marked |
|
@laifenxiawucha review |
|
Requested in this mention. Based on the diff, this PR contains substantial code changes beyond the stated "TEST ONLY" purpose. Here's my review: High
Medium
Test Coverage
Note: The creation of |
|
@laifenxiawucha review |
|
Requested in this mention. Status: Request Changes High (Must-Fix)Missing function definition will break build
API breakage: removed backward compatibility function
Removed input validation guard
Contradictory API contract change
MediumInsufficient verification documentation
Residual Risk
If these code changes were intentional (e.g., for testing the review process), please clarify. If they were accidental, consider reverting the code changes and keeping only the AGENTS.md addition. |
|
@laifenxiawucha review |
|
Requested in this mention. <tool_call>grep -B 5 -A 10 "softmax_sparse_xpu" src/ATen/native/sparse/xpu/SparseSoftmax.cpp | head -40</arg_value></tool_call> |
|
@laifenxiawucha review 审查 |
|
Review of PR #3281: This PR is titled 1. AGENTS.md Not valid — The file contains a single placeholder line ( 2. SparseSoftmax.cpp — Removal of Not valid — The 3. Attention.cpp — Not valid — The TORCH_CHECK error message still says 4. Attention.cpp — Removal of NestedTensor+mask guard Not valid — Removing the Overall: This PR bundles unrelated changes (AGENTS.md, sparse softmax refactor, attention validation changes) into a single [AI-assisted reply] |
|
@laifenxiawucha 请帮我review这个PR的代码变更 |
|
This PR has been reviewed extensively already, but since you asked again — the core issues remain unchanged: Build failure: Broken dispatch registration: Inconsistent dimension check: Removed safety guard: The Given the PR is marked [AI-assisted reply] |
|
Requested in this mention. Status: Request Changes High (Must-Fix)Non-existent kernel name in SparseSoftmax.cpp
Incorrect TORCH_CHECK message for qkv_weight dimensionality
TORCH_CHECK(
qkv_weight.dim() == 4,
"expected 2-D `qkv_weight`, got ",
qkv_weight.dim(),
"-D tensor");
MediumGuard removal for NestedTensor with mask requires test
TORCH_CHECK(
!mask || !query.is_nested(),
"NestedTensor with mask is not supported yet");
Suspicious qkv_weight dimensionality change not verified
Low / SuggestionsMissing tests for blocked sparse softmax function removal
Incomplete PR description
Residual Risk
|
|
Requested in this mention. Perfect! Now I have enough context to write a comprehensive review. Let me summarize what I found: Issues:
Let me now write the review following the xpu-pr-review skill format exactly:Status: Request Changes High (Must-Fix)Undefined kernel function
Inconsistent tensor dimension logic
Removed safety check without justification
MediumRemoved public API function
Low / SuggestionNone Residual Risk
|
|
@laifenxiawucha review |
|
Requested in this mention. I'm unable to access the repository files to complete your review request due to a technical issue with the sandbox environment. Could you please provide the diff or the files you'd like me to review, or confirm if this is a test of the mention review bot behavior itself? If you'd like me to review the AGENTS.md changes once the technical issue is resolved, I can provide a detailed review with file-scoped comments and line-specific findings. |
|
This PR has been reviewed extensively in the comments above. The core issues remain unchanged: Build failure: Broken dispatch registration: Contradictory dimension check: Removed safety guard: Given this is marked [AI-assisted reply] |
|
@laifenxiawucha review |
|
Status: Request Changes This PR has been reviewed multiple times. The same blocking issues persist:
None of these have been addressed since first flagged. PR remains non-mergeable. [AI-assisted reply] |
laifenxiawucha
left a comment
There was a problem hiding this comment.
Requested in this mention.
Status: Comment
Summary
This PR introduces build errors and semantic regressions with incomplete refactoring in sparse softmax kernels and mismatched error messaging in the attention module.
Cross-Cutting / Residual Risk
-
No tests added for the dimensionality change from 2-D to 4-D for
qkv_weightinAttention.cpp. Verify existing Transformer tests pass with the new shape requirement. -
Sparse softmax kernel naming change is incomplete—header declarations and kernel implementations are out of sync.
-
Verify whether rename from
softmax_sparse_xpu_kerneltosoftmax_forward_sparse_xpu_kernelis intentional and propagated to all registration files (e.g.,yaml/xpu_functions.yaml). -
src/ATen/native/sparse/xpu/SparseSoftmax.cpp (L25-L29 (removed)): Medium : Removed wrapper function without API analysis. Kept in the summary instead of an inline review comment because the referenced line is not a changed RIGHT-side line in the PR diff.
-
src/ATen/native/transformers/Attention.cpp (L129-L131 (removed)): Medium : Removed guard check without verification. Kept in the summary instead of an inline review comment because the referenced line is not a changed RIGHT-side line in the PR diff.
| const int64_t dim_, | ||
| const bool half_to_float) { | ||
| return xpu::log_softmax_sparse_xpu_kernel(input_, dim_, half_to_float); | ||
| return xpu::softmax_forward_sparse_xpu_kernel(input_, dim_, half_to_float); |
There was a problem hiding this comment.
High: : Call to non-existent kernel function
- Problem:
xpu::softmax_forward_sparse_xpu_kernelis called but this function does not exist. - Evidence:
src/ATen/native/sparse/xpu/SparseSoftmax.cpp:23callsxpu::softmax_forward_sparse_xpu_kernel, butsrc/ATen/native/sparse/xpu/sycl/SparseSoftmaxKernels.honly declaressoftmax_sparse_xpu_kernel, notsoftmax_forward_sparse_xpu_kernel. - Why it matters: This will cause a linker error at build time.
- Suggestion: Either create the missing kernel function or revert to calling the existing
softmax_sparse_xpu_kernel.
| // This aligns with CUDA | ||
| TORCH_CHECK( | ||
| qkv_weight.dim() == 2, | ||
| qkv_weight.dim() == 4, |
There was a problem hiding this comment.
High: : Error message mismatched to dimensionality check
- Problem: Error message says "expected 2-D" but the check validates
dim() == 4. - Evidence:
src/ATen/native/transformers/Attention.cpp:146hasqkv_weight.dim() == 4check but the error message on L147 says"expected 2-D 'qkv_weight'". - Why it matters: Users will see confusing error messages that don't match the actual requirement, making debugging harder.
- Suggestion: Update error message to "expected 4-D
qkv_weight" to match the new check.
|
@laifenxiawucha review |
This comment was marked as spam.
This comment was marked as spam.
|
Review requested in this mention. Based on the xpu-pr-review skill and reviewing both changed files: Summary src/ATen/native/sparse/xpu/SparseSoftmax.cppHigh: Kernel function name will fail to link
High: Removing forward implementation breaks backward compatibility
src/ATen/native/transformers/Attention.cppHigh: Error message text mismatch after validation change
Cross-Cutting / Residual Risk
|
|
@laifenxiawucha review |
|
Status: Do Not Merge This PR is explicitly marked
No new code changes since last review. All previously identified issues remain unresolved, which is expected given the [AI-assisted reply] |
|
@laifenxiawucha review |
laifenxiawucha
left a comment
There was a problem hiding this comment.
Review Summary
This test PR has three substantive code issues beyond the AGENTS.md addition. All three are build-breaking or API-breaking changes that would block merge regardless of the [DO NOT MERGE] label.
[AI-assisted reply]
| const int64_t dim_, | ||
| const bool half_to_float) { | ||
| return xpu::log_softmax_sparse_xpu_kernel(input_, dim_, half_to_float); | ||
| return xpu::softmax_forward_sparse_xpu_kernel(input_, dim_, half_to_float); |
There was a problem hiding this comment.
Two issues here:
-
softmax_forward_sparse_xpu_kerneldoes not exist —src/ATen/native/sparse/xpu/sycl/SparseSoftmaxKernels.honly declaressoftmax_sparse_xpu_kernel. This causes a linker error. -
The entire
log_softmax_sparse_xpufunction is removed but remains registered inyaml/native/native_functions.yamlasSparseXPU: log_softmax_sparse_xpu. The backward functionlog_softmax_backward_sparse_xpualso still exists, creating an orphaned backward without a forward.
[AI-assisted reply]
| // This aligns with CUDA | ||
| TORCH_CHECK( | ||
| qkv_weight.dim() == 2, | ||
| qkv_weight.dim() == 4, |
There was a problem hiding this comment.
Agreed — dimension check is inconsistent with error message and downstream usage. The check now requires dim() == 4, but the error message on line 149 still says "expected 2-D 'qkv_weight'", and the comment at line 128 still documents shape as [3 * D, D] (2-D). Subsequent indexing at qkv_weight.sizes()[0]/[1] also assumes 2-D layout.
[AI-assisted reply]
| // qkv_weight shape: [3 * D, D] | ||
|
|
||
| TORCH_CHECK( | ||
| !mask || !query.is_nested(), |
There was a problem hiding this comment.
Removing this guard without adding support is unsafe. If downstream XPU kernels do not handle NestedTensor with mask, this silently allows undefined behavior instead of failing with a clear error. Restore the check or add a test proving the combination now works.
[AI-assisted reply]
|
@laifenxiawucha review |
|
@laifenxiawucha review 审查 |
|
@laifenxiawucha review 审查 |
This PR is for test only