Skip to content

Conversation

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Nov 17, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/140912

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ You can merge normally! (1 Unrelated Failure)

As of commit 02ab2d8 with merge base 260d1dc (image):

FLAKY - The following job failed but was likely due to flakiness present on trunk:

  • linux-binary-manywheel / manywheel-py3_9-cuda12_6-test / test (gh) (similar failure)
    RuntimeError: cuDNN version incompatibility: PyTorch was compiled against (9, 5, 1) but found runtime version (9, 1, 0). PyTorch already comes bundled with cuDNN. One option to resolving this error is to ensure PyTorch can find the bundled cuDNN. one possibility is that there is a conflicting cuDNN in LD_LIBRARY_PATH.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@jansel jansel marked this pull request as ready for review November 20, 2024 19:44

@classmethod
def create(cls, *args, **kwargs): # type: ignore[no-untyped-def]
def create(cls, *args: Any, **kwargs: Any) -> TensorBox:
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Without specifying the actual arg types here then callers lose their type safety.
But Any is better than type: ignore so it's better than it was...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree not ideal, but better than it was.

def __rmul__(self, other: Any) -> typing.Self:
...

_T = TypeVar("_T", bound=_WorksWithInt)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: In general I don't like adding bounds to a generic _T like this (because usually _T would just be an unbound generic). I would prefer a name like _WorksWithIntT so the use sites are clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case the caller needs to preserve their types (either sympy.Expr when used in inductor, SymInt when used in primtorch), but the code in this file needs the protocal. I couldn't get it to type cleanly without this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm just bikeshedding on the name _T. When I see a raw _T my assumption is that it's unbound. Naming it something like _WorksWithIntT would (maybe) make it clear when reading the use sites that it's a generic but also make it clear that it's not an unbound generic.

To me:

def make_channels_last_1d_strides_for(
    shape: Sequence[_T],
) -> Tuple[Union[_T, int], ...]:

says this can take a Sequence of any type and returns a tuple with that same type (and int).

but

def make_channels_last_1d_strides_for(
    shape: Sequence[_WorksWithIntT],
) -> Tuple[Union[_WorksWithIntT, int], ...]:

says that this takes a Sequence of a generic type which is bound by _WorksWithInt and returns a tuple with that same type (and int).

Copy link
Contributor Author

@jansel jansel Nov 21, 2024

Choose a reason for hiding this comment

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

I'll rename it to _IntLikeT

@jansel jansel added the ciflow/trunk Trigger trunk jobs on your pull request label Nov 21, 2024
[ghstack-poisoned]
@jansel
Copy link
Contributor Author

jansel commented Nov 21, 2024

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

Esquains pushed a commit to Esquains/study1 that referenced this pull request Dec 15, 2024
ghstack-source-id: 953d1c7
Pull Request resolved: pytorch/pytorch#140912
@github-actions github-actions bot deleted the gh/jansel/438/head branch December 22, 2024 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants