-
Notifications
You must be signed in to change notification settings - Fork 331
[SWE-Paddle] Add proposal for PaddlePaddle__Paddle-64320 - code parts #1443
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
520aac0
【Hackathon 9th No.109】基于 Setuptools 80+ 版本自定义算子机制适配设计文档
megemini b6e4f2b
Merge branch 'master' of https://github.com/PaddlePaddle/community
megemini 6e7daea
Merge branch 'master' of https://github.com/PaddlePaddle/community
megemini e8ac75f
Merge branch 'master' of https://github.com/PaddlePaddle/community
megemini 4ec51cd
Merge branch 'master' of https://github.com/PaddlePaddle/community
megemini e47c171
swe-64320 proposal
megemini b2a3263
swe paddle 64320 codes
megemini 1cdef5e
Merge branch 'master' of https://github.com/PaddlePaddle/community in…
megemini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # PaddlePaddle__Paddle-64320 | ||
|
|
||
| This directory converts Paddle PR #64320 into a SWE-Paddle community task candidate. | ||
|
|
||
| ## Source | ||
|
|
||
| | Field | Value | | ||
| | --- | --- | | ||
| | Repo | `PaddlePaddle/Paddle` | | ||
| | PR | [64320](https://github.com/PaddlePaddle/Paddle/pull/64320) | | ||
| | PR title | 【Hackathon 6th No.17】为 Paddle 新增 sparse.mask_as API -part | | ||
| | Base commit | `605f5e20305db0e4932a20d3e0e6cf7d7d9631d8` | | ||
| | Merged at | `2024-06-07T09:10:27Z` | | ||
| | Hackathon | `6th` task `17` | | ||
| | Task type | `feature_enhancement` | | ||
| | Resource | CPU + GPU | | ||
|
|
||
| ## Summary | ||
|
|
||
| Add `sparse.mask_as` API for Paddle, which extracts values from a dense tensor at positions indicated by a sparse mask and outputs a sparse tensor. | ||
|
|
||
| ## Files | ||
|
|
||
| - `proposal.md`: candidate proposal for maintainer triage. | ||
| - `instruction.md`: self-contained problem statement for the coding agent. | ||
| - `solution/code.patch`: gold patch from the merged PR. | ||
| - `tests/test.patch`: test patch exposing the target behavior. | ||
| - `tests/test.sh`: minimal target test command. | ||
| - `environment/README.md`: environment notes for reproduction. | ||
|
|
||
| ## Verification | ||
|
|
||
| ```bash | ||
| bash tests/test.sh | ||
| ``` | ||
|
|
||
| Expected behavior: applying `tests/test.patch` to `base_commit` should fail on the target behavior; applying both `tests/test.patch` and `solution/code.patch` should pass the target tests. |
27 changes: 27 additions & 0 deletions
27
swe-paddle/tasks/PaddlePaddle__Paddle-64320/environment/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Environment Notes | ||
|
|
||
| This candidate is part of the SWE-Paddle task set. | ||
|
|
||
| ## Expected Environment | ||
|
|
||
| - Repository: `PaddlePaddle/Paddle` | ||
| - Base commit: `605f5e20305db0e4932a20d3e0e6cf7d7d9631d8` | ||
| - Resource: CPU + GPU | ||
| - GPU required: yes (CUDA kernels are included) | ||
| - Build path: Paddle source checkout at the base commit. This task involves C++ CPU kernels, CUDA GPU kernels, Python API, and YAML op definitions, so source build is required. | ||
|
|
||
| ## Run Order | ||
|
|
||
| 1. Check out `PaddlePaddle/Paddle` at the base commit. | ||
| 2. Apply `tests/test.patch`. | ||
| 3. Run `bash tests/test.sh`; the target behavior should fail before the fix. | ||
| 4. Apply `solution/code.patch`. | ||
| 5. Run `bash tests/test.sh` again; the target behavior should pass after the gold patch. | ||
|
|
||
| ## Minimal Test Command | ||
|
|
||
| ```bash | ||
| bash tests/test.sh | ||
| ``` | ||
|
|
||
| The verifier is responsible for deriving stable F2P and P2P node IDs from repeated runs. | ||
24 changes: 24 additions & 0 deletions
24
swe-paddle/tasks/PaddlePaddle__Paddle-64320/instruction.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # 新增 sparse.mask_as API | ||
|
|
||
| ## 详细描述 | ||
|
|
||
| 为 Paddle 稀疏计算新增 `sparse.mask_as` API。该 API 根据给定的稀疏 mask(SparseCooTensor 或 SparseCsrTensor),从稠密 Tensor 中提取对应非零位置的值,输出一个与 mask 具有相同 indices 的稀疏 Tensor。 | ||
|
|
||
| 要求支持: | ||
| - COO 格式:支持 1-D ~ 4-D 输入 | ||
| - CSR 格式:支持 2-D 和 3-D 输入(其他维度应报错) | ||
| - 数据类型:float32, float64, int32, int64, complex64, complex128, int8, int16, float16 | ||
| - 前向计算 + 反向梯度 | ||
|
|
||
| ## 验收说明 | ||
|
|
||
| - `paddle.sparse.mask_as(x, mask)` 应能正确根据 mask 的 indices 从稠密 Tensor x 中提取值 | ||
| - 支持 COO 和 CSR 两种稀疏格式 | ||
| - CSR 格式仅支持 2-D 和 3-D,其他维度应报错 | ||
| - 反向梯度应正确传播 | ||
|
|
||
| ## Acceptance Criteria | ||
|
|
||
| - The behavior described above should be fixed. | ||
| - Existing valid behavior should remain unchanged. | ||
| - Do not satisfy the task by deleting tests, weakening assertions, or bypassing validation broadly. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
具体的环境信息(cuda版本)之类的提供一下~