Skip to content

refactor: adapt dispatcher for full C++17 compatibility and support pip install on MetaX#5

Merged
voltjia merged 9 commits intofeat/dev-infrafrom
refactor/cpp-17-dispatcher
Mar 5, 2026
Merged

refactor: adapt dispatcher for full C++17 compatibility and support pip install on MetaX#5
voltjia merged 9 commits intofeat/dev-infrafrom
refactor/cpp-17-dispatcher

Conversation

@Ziminli
Copy link
Copy Markdown
Collaborator

@Ziminli Ziminli commented Feb 28, 2026

TL;DR: Refactors the dispatcher to remove C++20-specific features and ensure full C++17 compatibility, and support pip install .[dev] on MetaX.

Key Changes

  • Dispatcher Refactor:

    • Remove the usage of a C++20 feature (explicit template parameter list for lambdas) in the dispatcher.
    • Replace with an equivalent implementation that works under the project’s C++17 standard.
    • Update places where dispatcher is used.
  • Support Pytest on MetaX:

    • Pybind11 and pyproject introduce extra flags that MetaX's compiler (i.e., mxcc) does not support. By adding a wrapper script, it processes the flags and make pip install work.
  • Support Auto-detection on MetaX:

    • Now on MetaX, install InfiniOps can just do pip install .[dev] instead of pip install .[dev] -C cmake.define.WITH_CPU="ON" -C cmake.define.WITH_METAX="ON".
  • Fix Styling Issues:

    • Fix the code styling noncompliance in common/traits.h, common/constexpr_map.h, src/dispatcher.h and cpu/add/add.h.

Known Issues & Future Work:

  • None

@Ziminli Ziminli self-assigned this Feb 28, 2026
@Ziminli Ziminli force-pushed the refactor/cpp-17-dispatcher branch 2 times, most recently from 87bd2c0 to 1740234 Compare March 2, 2026 12:57
@Ziminli Ziminli changed the title refactor: adapt dispatcher for full C++17 compatibility refactor: adapt dispatcher for full C++17 compatibility and support pip install Mar 2, 2026
@Ziminli Ziminli changed the title refactor: adapt dispatcher for full C++17 compatibility and support pip install refactor: adapt dispatcher for full C++17 compatibility and support pip install on MetaX Mar 2, 2026
@Ziminli Ziminli marked this pull request as ready for review March 2, 2026 13:12
Ziminli added 6 commits March 4, 2026 09:11
- dispatcher now does not depend on C++20 features
- udpate the current dispatcher use cases
- add some relevant constexpr traits in common/traits.h
- add `PYBIND_ENABLE_EXTRAS` internal cmake variable for controlling the flags introduced by pybind
…, `common/constexpr_map.h` and `dispatcher.h`
@Ziminli Ziminli force-pushed the refactor/cpp-17-dispatcher branch 2 times, most recently from 333df36 to 909a7c6 Compare March 4, 2026 13:05
…ace `detail` to comply with the styling rules
@Ziminli Ziminli force-pushed the refactor/cpp-17-dispatcher branch from 909a7c6 to 4606681 Compare March 4, 2026 13:07
@Ziminli Ziminli force-pushed the refactor/cpp-17-dispatcher branch from 9a9cb4b to 2807c28 Compare March 5, 2026 02:28
@voltjia voltjia merged commit a6d915b into feat/dev-infra Mar 5, 2026
@voltjia voltjia deleted the refactor/cpp-17-dispatcher branch March 5, 2026 02:44
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