Skip to content

Conversation

@copybara-service
Copy link

[mpmd] Fix nanobind compatibility and add OPTIMIZE enum value

Fixes two nanobind issues:

  1. Added .none() annotations for optional FragmentInfo parameters
    (call_counter, split_type) to accept None from Python
  2. Changed PartitioningPhase enum to nb::is_flag() for bitmask support,
    allowing combinations like OPTIMIZE | PARTITION. Seems like otherwise
    apply_partioning() will error on combinations since they are not explicitly
    declared enum values.

Fixes two nanobind issues:
1. Added .none() annotations for optional FragmentInfo parameters
   (call_counter, split_type) to accept None from Python
2. Changed PartitioningPhase enum to nb::is_flag() for bitmask support,
   allowing combinations like OPTIMIZE | PARTITION. Seems like otherwise
   apply_partioning() will error on combinations since they are not explicitly
   declared enum values.

PiperOrigin-RevId: 832290786
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