or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
NumPy sprint: May 10–11 2019
Attending locally: Stefan, Tyler, Matti, Sebastian, Stephan H
Arriving: Eric (9:50 PM, WN2278 from SEA), Chuck (when?), Hameer (9:55 PM Thursday, UA-413 from Cleveland)
Summary (written May 13)
Eight NumPy developers met May 10/11 to discuss design decisions, particularly around two topics: a new design for data types, and the API of the recently rewritten random number generation module. For discussions such as these that involve debating various technical intricacies, the high bandwidth of face-to-face meetings is invaluable. We thank the developers who generously gave their time to take part in these discussions, and can happily report progress on the following fronts:
Dtypes
This long discussion led to a deeper understanding of the overall design.
While design decisions may change we have made progress allowing to start to
work on a prototype implementation.
ArrFuncs
(legacy functions that live on the dtype)result_type
logic,this would remove the need for complex work-arounds to remain backward
compatible in
result_type
("common type").different user types would be dispatched.
as return a
UfuncImpl
object (or raise an error)UFunc
logic would need to be moved intothe
UFuncImpl
. Although, most of it could be inherited/default.UFuncImpl
classes could exist, allowing formuch flexibility to support old numpy behaviour
UFuncImpl
would probably be allowed (but does not have to)handle the full iteration, the datatypes would be fixed.
but a first step may hide this detail.
An example for code which is currently optimized with many paths is
the casting/copying code.
UfuncImpl
):(although this has lower priority)
data pointer is enough if setup/teardown is possible.
Randomgen
We had a helpful discussion via video call with Kevin Sheppard around remaining changes needed before merging randomgen. Subjects such as api exposure, names of the new objects, and what to do with the open/closed range integer uniform random number functions were all discussed and resolved.
Numpy 2.0
We should consider bundling several (small) breaking changes for a 2.0 release. In general, we may consider moving a bit faster, while clearly conveying to the users that we will not make such changes arbitrarily and will commit to supporting mechanisms for backward compatibility.
__skip_array_function__
We adopted this name for the function wrapped by
__array_function__
. Stefan H. incorporated this into the NEP and issued a PR to expose it. He also found a nice way to improve the information emitted on an exception when calling an__array_function__
copying
name
can be changed)array.copy()
we want to compact structured array padding on copy (perhaps recursively, while respecting the dtypealign
flag. Theis_aligned_struct
flag is preserved by copy, and will respect the order of the field layout in memory. When creating a dtype via PEP 3118, we will set theis_aligned_struct
. The solution for people want to keep padding isarray.astype(array.dtype)
. Aside: we may want to make sure we are correctly reflecting PEP 3118 aligment semantics, whatever they are.General work on PRs and issues
In addition to all the discussions, we worked on 22 pull requests, merging 16 of them. This is above our usual pace of 3 pull requests per day.
Fri May 10
Morning
Dtypes
Sebastian's document
Sebastian's slides
Discussion
Meta-discussions
array[0]
as both a python object and a reference to a piece of memory in an ndarrayWhat to do with copyswap, copyswapn?
UFuncs
Convert ArrFuncs to ufuncs (might need kwargs)? There will be many corner cases, as discovered when redoing
np.clip
Allow constructing ArrFuncs from python (for prototyping only), using the same approach of PyHeapType which wraps slots.
Value-based promotion is problematic. Tensorflow only does value-based for Python objects.
Agreement about a UniformObject array that has the same type for all the objects in the array
np.add
withnb_add
or other C slotsThere was an active discussion about how the new inner loop of ufuncs could be defined from python based on the User level Python APIs document
Eric came up with a design (added to User Level Python APIs) for loop resolution. Led to a discussion of a loop dispatch mechanism. perhaps we define loops for contiguous, 1d, and general ndarrays
Topics to discuss:
PyArray_Descr
Py*Register
, use this to mark it as oldPyArray_Result()
decays arrays into scalars which casts them into non-dtype things: allow passing a flag to out that will not decayDiscussion of Numpy 2.0 from the wiki page
Discussion of
__numpy_implementation__
Afternoon
3-4 call with Kevin Sheppard about random generator refactor (mattip lead)
https://github.com/numpy/numpy/issues/13164
Concerns about new random APIs
An interesting alternative design:
jax.random
Names
What should we call the
brng
andRandomGenerator
classesRandomGenerator
suggestions? np.random.GeneratorExposing APIs
Do we need to expose
Multithreaded best practices
doc
rng.jump()
->rng.jumped()
which returns a new instancehttps://github.com/google/jax#random-numbers-are-different
What to do with …
random_integers
which should be deprecated?.rand
and.randn
random_integers
randint
-> integers, remove usemask (force to faster), add booleanendpoint
kwarg with default Falserandom_sample
->random
Apache2 license of pcg32, pcg64
"axis"-based kwarg to choice? something we should consider?
take
does, and just point to its documentationcheck that the documentation of the default matches the brng default for Generator
Sat May 11
Morning
dtype
/ufunc
NEPAfternoon
uarray
discussion (Hameer), if there's interestufunc
/dtype
discussionNumPy 2.0 –- Path forward? (Hameer, Stephan, …)
import numpy2
.Topics
Dtype planning
Required: Eric, Sebastian, Matti
Random Number PR review
Required: Kevin Sheppard (remote), Robert Kern (remote) Matti,
PR Review
Required: Eric, Tyler
If there is time
array.copy()
we want to compact structured array padding on copy (perhaps recursively, respecting the dtype align flag. The is_aligned_struct flag is preseved by copy, and will respect the order of the field layout in memory. When creating a dtype via PEP 3118, we will set the is_aligned_struct. The solution for people want to keep padding isarray.astype(array.dtype)
. Aside: we may want to make sure we are correctly reflecting PEP 3118 aligment semantics, whatever they are.