File tree 3 files changed +13
-5
lines changed
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:
12
12
13
13
1 . Data access via a protocol that describes the memory layout of the array
14
14
in an implementation-independent manner.
15
+
15
16
_ Rationale: any number of libraries must be able to exchange data, and no
16
17
particular package must be needed to do so._
18
+
17
19
2 . Support for all dtypes in this API standard (see {ref}` data-types ` ).
20
+
18
21
3 . Device support. It must be possible to determine on what device the array
19
22
that is to be converted lives.
23
+
20
24
_ Rationale: there are CPU-only, GPU-only, and multi-device array types;
21
25
it's best to support these with a single protocol (with separate
22
26
per-device protocols it's hard to figure out unambiguous rules for which
23
27
protocol gets used, and the situation will get more complex over time
24
28
as TPU's and other accelerators become more widely available)._
29
+
25
30
4 . Zero-copy semantics where possible, making a copy only if needed (e.g.
26
31
when data is not contiguous in memory).
32
+
27
33
_ Rationale: performance._
34
+
28
35
5 . A Python-side and a C-side interface, the latter with a stable C ABI.
36
+
29
37
_ Rationale: all prominent existing array libraries are implemented in
30
38
C/C++, and are released independently from each other. Hence a stable C
31
39
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_):
187
187
188
188
7 . Behaviour for unexpected/invalid input to functions and methods.
189
189
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._
194
194
195
195
196
196
** 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
50
50
depending on a GPU or distributed array implementation, or contain (e.g.)
51
51
CUDA code - that's not maintainable given the resources for development.
52
52
_ 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
54
54
dispatching to other array implementations. The main problem then becomes how
55
55
to know whether this will work with a particular distributed or GPU array
56
56
implementation - given that there are zero other array implementations that
You can’t perform that action at this time.
0 commit comments