Skip to content

Conversation

@manopapad
Copy link
Contributor

No description provided.

def add_arguments(
self, task: Any, args: Optional[Sequence[npt.NDArray[Any]]]
self,
task: Union[AutoTask, ManualTask],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might expect this to be task: Task, but Task does not define add_input.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth inserting a parent class in between to denote tasks that provide this interface?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So actually it looks like AutoTask and ManualTask define their add_input method in incompatible ways:

    def add_input(
        self, store: Store, partition: Optional[PartSym] = None
    ) -> None:

vs

    def add_input(
        self,
        arg: Union[Store, StorePartition],
        proj: Optional[ProjFn] = None,
    ) -> None:

and the add_arguments function takes advantage of the fact that both add_input methods do the same when passing in scalar values. Therefore I actually don't think we need to bother with this.

Copy link
Contributor

@bryevdv bryevdv Jul 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, if we wanted to clean this up, a base could define a specialized def add_store_input(store: Store) just for the overlapping portion of this API. But unless there is a bit more common API to put a protocol/base I guess it is nto worth it.

@manopapad manopapad requested a review from bryevdv July 21, 2022 19:13
def add_arguments(
self, task: Any, args: Optional[Sequence[npt.NDArray[Any]]]
self,
task: Union[AutoTask, ManualTask],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth inserting a parent class in between to denote tasks that provide this interface?

@manopapad manopapad merged commit c764e0a into nv-legate:branch-22.07 Jul 25, 2022
jjwilke pushed a commit to jjwilke/cunumeric that referenced this pull request Jul 29, 2022
* Strengthen some types

* Minor improvement

* Fix test failure

* Make FFTType public

* Use Sequence in alphabetical_transpose
jjwilke pushed a commit to jjwilke/cunumeric that referenced this pull request Jul 29, 2022
* Strengthen some types

* Minor improvement

* Fix test failure

* Make FFTType public

* Use Sequence in alphabetical_transpose
@manopapad manopapad deleted the more-types branch July 19, 2023 17:30
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