[DataType] Update to use explicit Bool Type Aligning with DLPack#18453
Conversation
Summary of ChangesHello @tqchen, 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 introduces a significant refactoring of how boolean data types are handled within the project. By transitioning from an implicit representation (1-bit unsigned integers) to an explicit Highlights
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 an explicit bool type to align with DLPack, replacing the previous uint1 representation. The changes are extensive and consistently applied across the codebase, including data type definitions, operator implementations, constant folding, and tests. The introduction of is_predicate_dtype is a good way to maintain backward compatibility during this transition.
I've found a couple of minor issues:
- A copy-pasted Doxygen comment in
data_type.h. - Inconsistent use of
DataType::Bool()andDataType::Bool(1)inconst_fold.h.
Overall, this is a solid refactoring that improves type safety and clarity. My review comments provide suggestions to address the minor issues.
This PR updates the project to use explicit bool type which helps us to align with dlpack. It will also streamline explicit use of bool types.
dcaee1b to
32ed2e7
Compare
…che#18453) This PR updates the project to use explicit bool type which helps us to align with dlpack. It will also streamline explicit use of bool types.
…ack (apache#18453)" This reverts commit 49e650b.
…Pack (apache#18453)" This reverts commit f4affc7.
… with DLPack (apache#18453)"" This reverts commit 2adf5ea.
This PR updates the project to use explicit bool type which helps us to align with dlpack. It will also streamline explicit use of bool types.