What is Quadrants Typing?
A typing layer for the
quadrants, plus PEP 561 type
stubs for the quadrants package itself. Installing this one package gives
quadrants users both:
-
quadrants_typing— genericVec,Mat,NDArray, dimension, and dtype types for annotating quadrants kernels. Import it under the conventional alias:import quadrants_typing as qdt import quadrants as qd @qd.kernel def add( x: qdt.NDArray[qd.i32, qdt.Dim1], y: qdt.NDArray[qd.i32, qdt.Dim1], ) -> None: for i in range(x.shape[0]): x[i] = y[i]
-
Automatic
quadrantsstubs — type checkers (pyright, mypy) discover the bundledquadrants-stubspackage via PEP 561 with no configuration, soimport quadrantsis fully typed.
Quadrants Replacements
Type annotations replaces directly some quadrants functions, mostly from
qd.types. Here is a full table:
N,R,Cin{1,2,3,4,5,6,7,8}dtypen{qd.u8, qd.u16, qd.u32, ... etc.}
| Description | qdt version |
qd version |
Example |
|---|---|---|---|
| Concrete tensor type | qdt.NDArray[qd.<dtype>, Dim<N>] |
qd.types.NDArray[qd.<dtype>, <N>] |
qdt.NDArray[qd.i32, Dim3] |
| Templated tensor type | qdt.NDArray[T, DimAny] |
qd.types.ndarray(dtype=None, ndim=None) |
def f[T: (qd.i32, qd.f32)](arr: qdt.NDArray[T, DimAny]) |
| Vector type | qdt.Vec[qd.<dtype>, Dim<N>] |
qd.types.vector(<N>, qd.<dtype>) |
qdt.Vec[qd.f32, Dim3] |
| Matrix type | qdt.Mat[qd.<dtype>, Dim<R>, Dim<C>] |
qd.types.matrix(<R>, <C>, qd.<dtype>) |
qdt.Mat[qd.f32, Dim3, Dim4] |
| Compile-time value | qdt.Template[T] |
qd.template() |
qdt.Template[bool] |
If you would like to construct tensors with a rank greater than 8, or vectors
and matrices with any dimension longer than 8, you can. See weird_hacks
example for how to create the annotation, or use qd.types.vector or
qd.types.matrix if you only need a constructor (e.g. for a local array).
Examples
Runnable, annotated example programs live in examples/. Run one by name:
pixi run example init_ndarray
How Finished is This?
Not at all! There's lots of work still to be done :P. Please help!
Omissions
Names present in quadrants that we intentionally do not stub in qdt, with
the reason / recommended alternative:
Intentional
qd.types.struct: usedataclasses.dataclassqd.types.NDArray: superseded byqdt.NDArray[qd.<dtype>, Dim<N>]qd.types.ndarray: superseded byqdt.NDArray[T, DimAny]qd.types.Template: superseded byqdt.Template[T]qd.template: superseded byqdt.Template[T]
Todo
qd.types.ref: todo(real_func)qd.types.quant.*(int,float,fixed): todo(field)qd.types.sparse_matrix_builder: todo(sparse_matrix)quadrants.lang.simt.grid,.tile_slicing: todo(simt) —simt.block,.warp,.subgroup(incl. itsreductions/sortingre-exports) are stubbed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quadrants_typing-0.2.4.tar.gz.
File metadata
- Download URL: quadrants_typing-0.2.4.tar.gz
- Upload date:
- Size: 19.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd079a127a8e8c114056efb1b9dfdb3aa67d7ea17f00d6ca605a8ce901defdbd
|
|
| MD5 |
6507d5920617b02666a76ccd421f78e7
|
|
| BLAKE2b-256 |
7536aac49319a8d37875512a9aa9baab26620d52972b9ef7aafc90597ce68c37
|
Provenance
The following attestation bundles were made for quadrants_typing-0.2.4.tar.gz:
Publisher:
publish.yml on D0liphin/quadrants-typing
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quadrants_typing-0.2.4.tar.gz -
Subject digest:
bd079a127a8e8c114056efb1b9dfdb3aa67d7ea17f00d6ca605a8ce901defdbd - Sigstore transparency entry: 2504267269
- Sigstore integration time:
-
Permalink:
D0liphin/quadrants-typing@44808bf56c444cd7e9240646861de393439d432a -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/D0liphin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@44808bf56c444cd7e9240646861de393439d432a -
Trigger Event:
push
-
Statement type:
File details
Details for the file quadrants_typing-0.2.4-py3-none-any.whl.
File metadata
- Download URL: quadrants_typing-0.2.4-py3-none-any.whl
- Upload date:
- Size: 27.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87a25537dffbed73c9ace3dc06498f9b72ebe543cbb36a5a52f9d41d7015adc2
|
|
| MD5 |
6e796161574735e88356016f4810ad1c
|
|
| BLAKE2b-256 |
9ec020b252ef1cf588dc803e0e243d2fdc9c4cac74235aa125e0f668f3b55d97
|
Provenance
The following attestation bundles were made for quadrants_typing-0.2.4-py3-none-any.whl:
Publisher:
publish.yml on D0liphin/quadrants-typing
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quadrants_typing-0.2.4-py3-none-any.whl -
Subject digest:
87a25537dffbed73c9ace3dc06498f9b72ebe543cbb36a5a52f9d41d7015adc2 - Sigstore transparency entry: 2504267301
- Sigstore integration time:
-
Permalink:
D0liphin/quadrants-typing@44808bf56c444cd7e9240646861de393439d432a -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/D0liphin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@44808bf56c444cd7e9240646861de393439d432a -
Trigger Event:
push
-
Statement type: