Skip to content

RFC #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 28, 2023
Merged

RFC #112

merged 12 commits into from
Apr 28, 2023

Conversation

lezcano
Copy link
Collaborator

@lezcano lezcano commented Apr 11, 2023

I left a number of comments in bold throughout the text that occurred to me as I was writing this.

@lezcano lezcano requested review from rgommers and ev-br April 11, 2023 11:38
Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

Thanks Mario! Here are my first set of high-level comments that seem worth discussing.

RFC.md Outdated
w = z.sum()
```

Here we already see a couple differences between NumPy and PyTorch. The most
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest to move a summary of differences to a section nearer to the end of the document, and forward-reference it here. It reads better if we focus on the main use case and 95% where behavior is matching.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I pushed some changes. I think that leaving these in this example and moving the FKA ## DTypes section right after this section makes these points here have more meaning.

This is how I had it at the beginning, which makes more sense, but then I moved the dtypes section down the document and left this part a bit on its own.

RFC.md Outdated
keyword-only argument. It is for this reason that, in PrimTorch, we were able
to implement it as
[a decorator](https://github.com/pytorch/pytorch/blob/ce4df4cc596aa10534ac6d54912f960238264dfd/torch/_prims_common/wrappers.py#L187-L282).
This is not the case in NumPy. In NumPy `out` is a positional arg that is often
Copy link
Member

Choose a reason for hiding this comment

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

That's going on my list of things to fix for NumPy 2.0:)

Copy link
Member

Choose a reason for hiding this comment

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

Not sure what I meant two weeks ago, but this isn't true:

>>> x = np.ones(3)
>>> np.sin(x, x)
array([0.84147098, 0.84147098, 0.84147098])
>>> x = np.ones(3)
>>> np.sin(x, out=x)
array([0.84147098, 0.84147098, 0.84147098])

I'll change this to "can be used both as a positional and a keyword argument".

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep, I meant "In NumPy, out can be specified as a positional arg"

Copy link
Collaborator

@ev-br ev-br left a comment

Choose a reason for hiding this comment

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

A few minor comments on a first read-through.

Copy link
Collaborator

@ev-br ev-br left a comment

Choose a reason for hiding this comment

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

This reads great. Several minor comments, all optional.

RFC.md Outdated


The this project has a main goal as per the
[initial design document](https://docs.google.com/document/d/1gdUDgZNbumFORRcUaZUVw790CtNYweAM20C1fbWMNd8):
Copy link
Collaborator

Choose a reason for hiding this comment

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

The access is gated.

Copy link
Member

Choose a reason for hiding this comment

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

I'll try to fix that by upstreaming the relevant content here. Best for this RFC to be standalone.

@lezcano
Copy link
Collaborator Author

lezcano commented Apr 28, 2023

Addressed the last review. Once @rgommers does a last pass, we'll publish this one in the RFC repo.

@lezcano lezcano merged commit 42f0070 into main Apr 28, 2023
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.

3 participants