Skip to content

feat: add distinct bool data type to InfiniRT - #47

Merged
voltjia merged 1 commit into
masterfrom
feat/bool-dtype-latest
Sep 23, 2026
Merged

voltjia merged 1 commit into
masterfrom
feat/bool-dtype-latest

Conversation

@baominghelly

Copy link
Copy Markdown
Contributor

Summary

  • Add distinct DataType::kBool with one-byte size, string conversion, and C++ bool mapping in src/data_type.h.
  • Cover bool/uint8 distinction and type mapping in tests/test_core.cc.

Motivation

Boolean tensors previously lacked a distinct runtime dtype, blocking correct bool input/output mapping in consumers such as InfiniOps.

Type of Change

  • feat - new feature / new backend capability / new public API
  • fix - bug fix
  • perf - performance improvement without behavior change
  • refactor - code restructuring without behavior change
  • test - adding or fixing tests only
  • docs - documentation only
  • build / ci - build system or CI configuration
  • chore - tooling, formatting, or other non-code changes
  • Breaking change

Platforms Affected

  • CPU (WITH_CPU)
  • NVIDIA (WITH_NVIDIA)
  • Iluvatar (WITH_ILUVATAR)
  • Hygon (WITH_HYGON)
  • MetaX (WITH_METAX)
  • Moore (WITH_MOORE)
  • Cambricon (WITH_CAMBRICON)
  • Ascend (WITH_ASCEND)
  • Build system / CMake / generated headers
  • Public headers / installed consumer API
  • Documentation only

Smoke Build and Test Result

Earlier build from the same source tree was completed in an NVIDIA GPU container. On the final commit (format-only amendment to tests/test_core.cc), the existing build was retested in baoming_infiniops:

ctest --test-dir /data/shared/baoming/workplace/new_ops/InfiniRT-bool-dtype-latest/build-bool --output-on-failure -R 'test_core|test_smoke|test_cpu_runtime|test_nvidia_runtime'
100% tests passed, 0 tests failed out of 4

Changed C++ files pass clang-format 21 --dry-run --Werror; git diff --check passes.

Test Results on Supported Platforms

Platform Affected Build / Smoke Result Full Result / Notes
CPU Yes Existing build, smoke/core/CPU runtime passed Full suite not run on final commit
NVIDIA Yes Existing build, NVIDIA runtime passed Full suite not run on final commit
Iluvatar Yes Not run - hardware unavailable Shared dtype mapping needs backend validation
Hygon Yes Not run - hardware unavailable Shared dtype mapping needs backend validation
MetaX Yes Not run - hardware unavailable Shared dtype mapping needs backend validation
Moore Yes Not run - hardware unavailable Shared dtype mapping needs backend validation
Cambricon Yes Not run - hardware unavailable Shared dtype mapping needs backend validation
Ascend Yes Not run - hardware unavailable Shared dtype mapping needs backend validation

Benchmark / Performance Impact

N/A - dtype mapping change; no benchmark run.

Notes for Reviewers

  • The new enum value is appended, preserving existing numeric dtype values. One-byte bool storage remains distinct from uint8.
  • InfiniOps companion change depends on this runtime dtype addition.
  • Existing branch feat/bool-dtype-latest predates the current branch naming convention (<type>/xxx-yyyy-zzzz); not renamed as part of this PR.
  • Other accelerators and installed consumer validation remain open; keep this PR in draft pending platform review.

@voltjia
voltjia merged commit 5175a69 into master Sep 23, 2026
6 checks passed
@voltjia
voltjia deleted the feat/bool-dtype-latest branch September 23, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants