[Cpp API Compatibility] Complement ScalarType#78581
Merged
SigureMo merged 3 commits intoPaddlePaddle:developfrom Apr 4, 2026
Merged
[Cpp API Compatibility] Complement ScalarType#78581SigureMo merged 3 commits intoPaddlePaddle:developfrom
SigureMo merged 3 commits intoPaddlePaddle:developfrom
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the C10 compatibility layer’s ScalarType support by adding missing placeholder scalar wrapper types (quantized, bit-packed, and additional float formats) and wiring them into the scalar-type dispatch/mapping macros to better align with upstream enum coverage.
Changes:
- Add placeholder
c10scalar wrapper headers forqint8/qint32,quint8/quint4x2/quint2x4,bits*, and severalFloat*low-precision formats. - Extend
AT_FORALL_SCALAR_TYPES_WITH_COMPLEX_AND_QINTSto include these types (andComplexHalf) sotoString,elementSize, and type mapping specializations are generated consistently from the macro. - Remove now-redundant manual
toString/elementSizeswitch cases and scalar-type constants that are covered by the macro generation.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| paddle/phi/api/include/compat/c10/util/quint8.h | Adds placeholder c10::quint8 wrapper type and exports to at/torch. |
| paddle/phi/api/include/compat/c10/util/quint4x2.h | Adds placeholder c10::quint4x2 wrapper type and exports to at/torch. |
| paddle/phi/api/include/compat/c10/util/quint2x4.h | Adds placeholder c10::quint2x4 wrapper type and exports to at/torch. |
| paddle/phi/api/include/compat/c10/util/qint8.h | Adds placeholder c10::qint8 wrapper type and exports to at/torch. |
| paddle/phi/api/include/compat/c10/util/qint32.h | Adds placeholder c10::qint32 wrapper type and exports to at/torch. |
| paddle/phi/api/include/compat/c10/util/Float8_e8m0fnu.h | Adds placeholder c10::Float8_e8m0fnu wrapper type and exports to at/torch. |
| paddle/phi/api/include/compat/c10/util/Float8_e5m2fnuz.h | Adds placeholder c10::Float8_e5m2fnuz wrapper type and exports to at/torch. |
| paddle/phi/api/include/compat/c10/util/Float8_e4m3fnuz.h | Adds placeholder c10::Float8_e4m3fnuz wrapper type and exports to at/torch. |
| paddle/phi/api/include/compat/c10/util/Float4_e2m1fn_x2.h | Adds placeholder c10::Float4_e2m1fn_x2 wrapper type and exports to at/torch. |
| paddle/phi/api/include/compat/c10/util/bits.h | Adds placeholder c10::bits* wrapper types and exports to at/torch. |
| paddle/phi/api/include/compat/c10/core/ScalarType.h | Updates scalar-type macro lists and derives toString/elementSize/type mappings from the expanded macro coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
/re-run all-failed |
SigureMo
reviewed
Apr 4, 2026
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. |
SigureMo
approved these changes
Apr 4, 2026
SigureMo
reviewed
Apr 4, 2026
Comment on lines
+15
to
17
| // The file has been adapted from pytorch project | ||
| // Licensed under BSD-style license - | ||
| // https://github.com/pytorch/pytorch/blob/main/LICENSE |
liuhao2638
pushed a commit
to liuhao2638/Paddle
that referenced
this pull request
Apr 7, 2026
YuhanXu
pushed a commit
to YuhanXu/Paddle
that referenced
this pull request
Apr 14, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Category
Execute Infrastructure
PR Types
Improvements
Description
完善 ScalarType 类型,提供占位符,以对齐枚举类型
是否引起精度变化
否