Commit f3be526
Clean up kernel code by deleting unused options and code logic
Summary:
Remove unused code paths and options from faster_hash CPU and CUDA kernels
in both caffe2/torch/fb/retrieval and fbgemm_gpu codebases.
All callers already use `circular_probe=True`, `_modulo_identity_DPRECATED=false`,
and `output_on_uvm=false`, making these options dead code. This change:
- Removes the `CIRCULAR_PROBE` template parameter and simplifies
`next_output_index` from a template specialization pair to a single function,
dropping the `max_probe_local` side-effect parameter
- Removes `output_on_uvm` support, including UVM tensor allocation and
`cudaDeviceSynchronize` call
- Hardcodes `_modulo_identity_DPRECATED` to false, removing the conditional
`hash_identity` assignment
- Adds TORCH_CHECK assertions at the API boundary to enforce these constraints
- Simplifies the macro dispatch chains by removing the `CIRCULAR_PROBE` dimension,
reducing kernel binary bloat
- Removes `HASH_IDENTITY == 1` dead code from kernels and dispatch macros
(hash_identity can only be 0 or 2 after the change)
- Fixes if/else bug in CPU `INVOKE_KERNEL_HAS_OFFSET` that could invoke
the kernel twice
- Removes `output_on_uvm` parameter from `faster_hash_bench.py`
- Removes all related test cases for `circular_probe=False` and
`output_on_uvm=True`
Reviewed By: howei
Differential Revision: D95470985
fbshipit-source-id: 358362e9844bfa9b05502e701bbce6214ef94f691 parent 8d08cc1 commit f3be526
4 files changed
Lines changed: 88 additions & 463 deletions
File tree
- fbgemm_gpu
- include/fbgemm_gpu/faster_hash_ops
- src/faster_hash_ops
- test
Lines changed: 2 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
| 105 | + | |
| 106 | + | |
111 | 107 | | |
112 | 108 | | |
113 | 109 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | 110 | | |
129 | 111 | | |
130 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
75 | 74 | | |
76 | 75 | | |
77 | 76 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 77 | + | |
86 | 78 | | |
87 | 79 | | |
88 | 80 | | |
| |||
98 | 90 | | |
99 | 91 | | |
100 | 92 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 93 | + | |
105 | 94 | | |
106 | 95 | | |
107 | 96 | | |
| |||
130 | 119 | | |
131 | 120 | | |
132 | 121 | | |
133 | | - | |
134 | 122 | | |
135 | 123 | | |
136 | 124 | | |
| |||
144 | 132 | | |
145 | 133 | | |
146 | 134 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
166 | 152 | | |
167 | 153 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
175 | 161 | | |
176 | 162 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
196 | 170 | | |
197 | 171 | | |
198 | 172 | | |
| |||
202 | 176 | | |
203 | 177 | | |
204 | 178 | | |
205 | | - | |
206 | 179 | | |
207 | 180 | | |
208 | 181 | | |
| |||
281 | 254 | | |
282 | 255 | | |
283 | 256 | | |
284 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
285 | 261 | | |
286 | 262 | | |
287 | 263 | | |
| |||
319 | 295 | | |
320 | 296 | | |
321 | 297 | | |
322 | | - | |
323 | 298 | | |
324 | 299 | | |
325 | 300 | | |
| |||
0 commit comments