Discussion:
[PyCUDA] RFC - a PEP for adding a dedicated matrix multiplication operator to Python
Nathaniel Smith
2014-03-09 03:42:42 UTC
Permalink
Hey all,

I just wanted to give you a heads-up about a draft Python Enhancement
Proposal that I'm working on, for adding a dedicated matrix
multiplication operator ('@') to Python:
https://github.com/numpy/numpy/pull/4351
https://github.com/njsmith/numpy/blob/matmul-pep/doc/neps/return-of-revenge-of-matmul-pep.rst

This seems relevant to PyCUDA because IIUC your GPUArray is an ndarray
work-a-like, so if this PEP gets accepted then you'd probably want to
be implementing support for @.

So, I'd definitely welcome feedback on any aspect of the document, but
especially the "Semantics" section (since whatever ends up there is
what numpy and other projects will be doing, and perhaps PyCUDA as
well?). And if you *really* like it, then please let me know, because
I'd love to be able to include PyCUDA on the list of projects
"planning to implement @", as further evidence of our awesome
consensus and how the BDFL should totally accept this PEP. Let me
know!

-n
--
Nathaniel J. Smith
Postdoctoral researcher - Informatics - University of Edinburgh
http://vorpus.org
Nathaniel Smith
2014-03-16 02:33:31 UTC
Permalink
Hi again,

As an update for anyone not following python-ideas or
numpy-discussion: Guido has accepted the addition of @ as a matrix
multiplication operator in principle, once some details are worked
out:
https://mail.python.org/pipermail/python-ideas/2014-March/027109.html

So if you have any feedback you've been sitting on, now is a good time
to speak up :-). The current PEP draft can be seen here:
http://legacy.python.org/dev/peps/pep-0465/

I've also started threads on numpy-discussion specifically about the
details to be worked out, in case anyone wants to comment:

Precedence/associativity of @:
http://mail.scipy.org/pipermail/numpy-discussion/2014-March/069444.html

Do we care about @@:
http://mail.scipy.org/pipermail/numpy-discussion/2014-March/069448.html

I believe that if you aren't subscribed to numpy-discussion, then you
can still post through gmane (though unfortunately their anti-spam
munging of the @ character makes these threads kind of hard to read!):
http://news.gmane.org/gmane.comp.python.numeric.general

Or worst case, just send me an email directly, and I'll collate.

Cheers,
-n
Post by Nathaniel Smith
Hey all,
I just wanted to give you a heads-up about a draft Python Enhancement
Proposal that I'm working on, for adding a dedicated matrix
https://github.com/numpy/numpy/pull/4351
https://github.com/njsmith/numpy/blob/matmul-pep/doc/neps/return-of-revenge-of-matmul-pep.rst
This seems relevant to PyCUDA because IIUC your GPUArray is an ndarray
work-a-like, so if this PEP gets accepted then you'd probably want to
So, I'd definitely welcome feedback on any aspect of the document, but
especially the "Semantics" section (since whatever ends up there is
what numpy and other projects will be doing, and perhaps PyCUDA as
well?). And if you *really* like it, then please let me know, because
I'd love to be able to include PyCUDA on the list of projects
consensus and how the BDFL should totally accept this PEP. Let me
know!
-n
--
Nathaniel J. Smith
Postdoctoral researcher - Informatics - University of Edinburgh
http://vorpus.org
--
Nathaniel J. Smith
Postdoctoral researcher - Informatics - University of Edinburgh
http://vorpus.org
Loading...