File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -12,20 +12,28 @@ The interchange mechanism must offer the following:
1212
13131 . Data access via a protocol that describes the memory layout of the array
1414 in an implementation-independent manner.
15+
1516 _ Rationale: any number of libraries must be able to exchange data, and no
1617 particular package must be needed to do so._
18+
17192 . Support for all dtypes in this API standard (see {ref}` data-types ` ).
20+
18213 . Device support. It must be possible to determine on what device the array
1922 that is to be converted lives.
23+
2024 _ Rationale: there are CPU-only, GPU-only, and multi-device array types;
2125 it's best to support these with a single protocol (with separate
2226 per-device protocols it's hard to figure out unambiguous rules for which
2327 protocol gets used, and the situation will get more complex over time
2428 as TPU's and other accelerators become more widely available)._
29+
25304 . Zero-copy semantics where possible, making a copy only if needed (e.g.
2631 when data is not contiguous in memory).
32+
2733 _ Rationale: performance._
34+
28355 . A Python-side and a C-side interface, the latter with a stable C ABI.
36+
2937 _ Rationale: all prominent existing array libraries are implemented in
3038 C/C++, and are released independently from each other. Hence a stable C
3139 ABI is required for packages to work well together._
Original file line number Diff line number Diff line change @@ -187,10 +187,10 @@ extensions are dealt with_):
187187
1881887 . Behaviour for unexpected/invalid input to functions and methods.
189189
190- _ Rationale: there are a huge amount of ways in which users can provide
191- invalid or unspecified input to functionality in the standard. Exception
192- types or other resulting behaviour cannot be completely covered and would
193- be hard to make consistent between libraries._
190+ _ Rationale: there are a huge amount of ways in which users can provide
191+ invalid or unspecified input to functionality in the standard. Exception
192+ types or other resulting behaviour cannot be completely covered and would
193+ be hard to make consistent between libraries._
194194
195195
196196** Non-goals** for the API standard include:
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ parallelism in some algorithms. However SciPy itself will not directly start
5050depending on a GPU or distributed array implementation, or contain (e.g.)
5151CUDA code - that's not maintainable given the resources for development.
5252_ However_ , there is a way to provide distributed or GPU support. Part of the
53- solution is provided by NumPy's "array protocols" (see gh-1 ), that allow
53+ solution is provided by NumPy's "array protocols" (see [ gh-1 ] ( https://github.com/data-apis/array-api/issues/1 ) ), that allow
5454dispatching to other array implementations. The main problem then becomes how
5555to know whether this will work with a particular distributed or GPU array
5656implementation - given that there are zero other array implementations that
You can’t perform that action at this time.
0 commit comments