Commit b7a26de
authored
Refactor variant handling and add CUDA fallback (#339)
* Refactor variant handling and add CUDA fallback
Build variants were stringly-typed throughout kernels, with custom
parsing and serialization sprinkled everywhere. This change adds
proper/strong typing to variants adding a `Variant` class. This also
centers parsing/serialization in one place and allows code to easily
query various parts of of a variant.
This also fundamentally changes how we deal with getting variants from
the Hub. Rather than casting a wide net with all possible variants and
using allow patterns based on that, we query the hub for variants of a
kernel, parse them and can decide if there is an applicable variant
ahead of time. If there are multiple applicable variants, we can select
the best one (e.g. arch before noarch or recent CUDA version before
older versions).
* Refactor variant handling and add CUDA fallback
Build variants were stringly-typed throughout kernels, with custom
parsing and serialization sprinkled everywhere. This change adds
proper/strong typing to variants adding a `Variant` class. This also
centers parsing/serialization in one place and allows code to easily
query various parts of of a variant.
This also fundamentally changes how we deal with getting variants from
the Hub. Rather than casting a wide net with all possible variants and
using allow patterns based on that, we query the hub for variants of a
kernel, parse them and can decide if there is an applicable variant
ahead of time. If there are multiple applicable variants, we can select
the best one (e.g. arch before noarch or recent CUDA version before
older versions).
* Switch around cxx11 condition to support tagless build variant
* Make `kernels versions` more informative
* Move backend/variant regexes to their classes
* Type fixes
* Improve error handling
* Add tvm-ffi variant strings for testing
* Formatting1 parent d603813 commit b7a26de
File tree
7 files changed
+851
-133
lines changed- docs/source
- kernels
- src/kernels
- cli
- tests
7 files changed
+851
-133
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | | - | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | | - | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
30 | 31 | | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
38 | | - | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
41 | 51 | | |
42 | | - | |
| 52 | + | |
43 | 53 | | |
44 | 54 | | |
45 | 55 | | |
46 | 56 | | |
47 | 57 | | |
48 | 58 | | |
49 | | - | |
| 59 | + | |
50 | 60 | | |
51 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
52 | 68 | | |
53 | | - | |
| 69 | + | |
54 | 70 | | |
| 71 | + | |
| 72 | + | |
55 | 73 | | |
56 | 74 | | |
57 | 75 | | |
58 | 76 | | |
59 | 77 | | |
60 | 78 | | |
61 | 79 | | |
62 | | - | |
| 80 | + | |
63 | 81 | | |
64 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
65 | 90 | | |
66 | | - | |
| 91 | + | |
67 | 92 | | |
68 | 93 | | |
69 | 94 | | |
70 | 95 | | |
71 | 96 | | |
72 | 97 | | |
73 | | - | |
| 98 | + | |
74 | 99 | | |
75 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
76 | 107 | | |
77 | | - | |
| 108 | + | |
78 | 109 | | |
79 | 110 | | |
80 | 111 | | |
81 | 112 | | |
82 | 113 | | |
83 | 114 | | |
84 | | - | |
| 115 | + | |
85 | 116 | | |
86 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
87 | 123 | | |
88 | | - | |
| 124 | + | |
| 125 | + | |
89 | 126 | | |
| 127 | + | |
| 128 | + | |
90 | 129 | | |
91 | 130 | | |
92 | 131 | | |
93 | 132 | | |
94 | 133 | | |
95 | 134 | | |
96 | 135 | | |
97 | | - | |
| 136 | + | |
98 | 137 | | |
99 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
100 | 146 | | |
101 | | - | |
| 147 | + | |
102 | 148 | | |
| 149 | + | |
| 150 | + | |
103 | 151 | | |
104 | 152 | | |
105 | 153 | | |
106 | 154 | | |
107 | 155 | | |
108 | 156 | | |
109 | 157 | | |
110 | | - | |
| 158 | + | |
111 | 159 | | |
112 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
113 | 188 | | |
114 | 189 | | |
115 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | 1 | | |
7 | | - | |
8 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
9 | 7 | | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | 12 | | |
21 | 13 | | |
22 | 14 | | |
23 | 15 | | |
24 | 16 | | |
25 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
26 | 22 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 31 | + | |
0 commit comments