kernels-data 0.14.0.dev0__cp314-cp314t-win32.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kernels_data/__init__.py +5 -0
- kernels_data/__init__.pyi +125 -0
- kernels_data/kernels_data.cp314t-win32.pyd +0 -0
- kernels_data/py.typed +0 -0
- kernels_data-0.14.0.dev0.dist-info/METADATA +8 -0
- kernels_data-0.14.0.dev0.dist-info/RECORD +8 -0
- kernels_data-0.14.0.dev0.dist-info/WHEEL +4 -0
- kernels_data-0.14.0.dev0.dist-info/sboms/kernels-data-python.cyclonedx.json +2550 -0
kernels_data/__init__.py
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"""Type stubs for kernels_data module."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from enum import Enum
|
|
5
|
+
from typing import Optional, final
|
|
6
|
+
|
|
7
|
+
__all__ = ["Backend", "BackendInfo", "KernelName", "Metadata", "Version", "__version__"]
|
|
8
|
+
|
|
9
|
+
__version__: str
|
|
10
|
+
|
|
11
|
+
@final
|
|
12
|
+
class Backend(Enum):
|
|
13
|
+
"""Kernel backend (hardware target)."""
|
|
14
|
+
|
|
15
|
+
CANN = "CANN"
|
|
16
|
+
CPU = "CPU"
|
|
17
|
+
CUDA = "CUDA"
|
|
18
|
+
Metal = "Metal"
|
|
19
|
+
Neuron = "Neuron"
|
|
20
|
+
ROCm = "ROCm"
|
|
21
|
+
XPU = "XPU"
|
|
22
|
+
|
|
23
|
+
@staticmethod
|
|
24
|
+
def from_str(s: str) -> "Backend":
|
|
25
|
+
"""Parse a backend name.
|
|
26
|
+
|
|
27
|
+
Args:
|
|
28
|
+
s: One of ``"cann"``, ``"cpu"``, ``"cuda"``, ``"metal"``,
|
|
29
|
+
``"neuron"``, ``"rocm"``, ``"xpu"``.
|
|
30
|
+
|
|
31
|
+
Raises:
|
|
32
|
+
ValueError: If the backend name is unknown.
|
|
33
|
+
"""
|
|
34
|
+
...
|
|
35
|
+
|
|
36
|
+
def __str__(self) -> str: ...
|
|
37
|
+
def __repr__(self) -> str: ...
|
|
38
|
+
|
|
39
|
+
@final
|
|
40
|
+
class BackendInfo:
|
|
41
|
+
"""Backend information."""
|
|
42
|
+
|
|
43
|
+
@property
|
|
44
|
+
def backend_type(self) -> Backend:
|
|
45
|
+
"""Return the backend type."""
|
|
46
|
+
...
|
|
47
|
+
|
|
48
|
+
@property
|
|
49
|
+
def archs(self) -> Optional[list[str]]:
|
|
50
|
+
"""Optional list of target architectures."""
|
|
51
|
+
...
|
|
52
|
+
|
|
53
|
+
def __repr__(self) -> str: ...
|
|
54
|
+
|
|
55
|
+
@final
|
|
56
|
+
class Version:
|
|
57
|
+
"""A dotted numeric version (e.g. ``12.8.0``).
|
|
58
|
+
|
|
59
|
+
Trailing zeros are stripped during normalization.
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
@staticmethod
|
|
63
|
+
def from_str(s: str) -> "Version":
|
|
64
|
+
"""Parse a version string of the form ``X``, ``X.Y``, ``X.Y.Z``, ...
|
|
65
|
+
|
|
66
|
+
Raises:
|
|
67
|
+
ValueError: If the string is empty or contains non-numeric parts.
|
|
68
|
+
"""
|
|
69
|
+
...
|
|
70
|
+
|
|
71
|
+
def __str__(self) -> str: ...
|
|
72
|
+
def __repr__(self) -> str: ...
|
|
73
|
+
def __eq__(self, value: object, /) -> bool: ...
|
|
74
|
+
def __lt__(self, value: "Version", /) -> bool: ...
|
|
75
|
+
def __le__(self, value: "Version", /) -> bool: ...
|
|
76
|
+
def __gt__(self, value: "Version", /) -> bool: ...
|
|
77
|
+
def __ge__(self, value: "Version", /) -> bool: ...
|
|
78
|
+
def __hash__(self) -> int: ...
|
|
79
|
+
|
|
80
|
+
@final
|
|
81
|
+
class KernelName:
|
|
82
|
+
"""A validated kernel name matching ``^[a-z][-a-z0-9]*[a-z0-9]$``."""
|
|
83
|
+
|
|
84
|
+
def __new__(cls, name: str) -> "KernelName":
|
|
85
|
+
"""Create a new ``KernelName``.
|
|
86
|
+
|
|
87
|
+
Raises:
|
|
88
|
+
ValueError: If the name does not match the required pattern.
|
|
89
|
+
"""
|
|
90
|
+
...
|
|
91
|
+
|
|
92
|
+
@property
|
|
93
|
+
def python_name(self) -> str:
|
|
94
|
+
"""The name with dashes replaced by underscores."""
|
|
95
|
+
...
|
|
96
|
+
|
|
97
|
+
def __str__(self) -> str: ...
|
|
98
|
+
def __repr__(self) -> str: ...
|
|
99
|
+
def __eq__(self, value: object, /) -> bool: ...
|
|
100
|
+
def __hash__(self) -> int: ...
|
|
101
|
+
|
|
102
|
+
@final
|
|
103
|
+
class Metadata:
|
|
104
|
+
"""Parsed ``metadata.json`` for a kernel build variant."""
|
|
105
|
+
|
|
106
|
+
@staticmethod
|
|
107
|
+
def load(metadata_path: os.PathLike[str] | str) -> "Metadata":
|
|
108
|
+
"""Parse ``metadata.json`` at the given path.
|
|
109
|
+
|
|
110
|
+
Raises:
|
|
111
|
+
ValueError: On any I/O or parse error.
|
|
112
|
+
"""
|
|
113
|
+
...
|
|
114
|
+
|
|
115
|
+
@property
|
|
116
|
+
def version(self) -> Optional[int]: ...
|
|
117
|
+
@property
|
|
118
|
+
def license(self) -> Optional[str]: ...
|
|
119
|
+
@property
|
|
120
|
+
def upstream(self) -> Optional[str]: ...
|
|
121
|
+
@property
|
|
122
|
+
def python_depends(self) -> list[str]: ...
|
|
123
|
+
@property
|
|
124
|
+
def backend(self) -> BackendInfo: ...
|
|
125
|
+
def __repr__(self) -> str: ...
|
|
Binary file
|
kernels_data/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kernels-data
|
|
3
|
+
Version: 0.14.0.dev0
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Summary: Kernels data structures (Python bindings)
|
|
7
|
+
Home-Page: https://github.com/huggingface/kernels
|
|
8
|
+
Requires-Python: >=3.8
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
kernels_data/__init__.py,sha256=8ScqcBxuAjovkwPaNrXDOwxQlTt5Qtp7DqeBfWRQ3sA,131
|
|
2
|
+
kernels_data/__init__.pyi,sha256=q8EVUffwqH9PoDaXPybFXge7V0tQuJNtG3ko4yNEm1M,3260
|
|
3
|
+
kernels_data/kernels_data.cp314t-win32.pyd,sha256=jZkE6ka4Jr0Vo5MMhhS7rzgOd27GlbzOakVenj7uTXE,1817088
|
|
4
|
+
kernels_data/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
kernels_data-0.14.0.dev0.dist-info/METADATA,sha256=T7R3GAc4SANFVV2V_rtHPg3-jawwUqWmUBfmUe39qx0,299
|
|
6
|
+
kernels_data-0.14.0.dev0.dist-info/WHEEL,sha256=oFpOdyT3tiQwV5WSp6rLsbHQ8zAEBc7CZJPs7NIopGk,94
|
|
7
|
+
kernels_data-0.14.0.dev0.dist-info/sboms/kernels-data-python.cyclonedx.json,sha256=ynSV04SXuKc7_QWvEwDZL_Nt2shM5O2HLhfFXxU2olw,79749
|
|
8
|
+
kernels_data-0.14.0.dev0.dist-info/RECORD,,
|