Repository navigation
Commit 26ecdd2
authored
Send a relational inference config only when the caller set one (#16)
## Problem
structured-data-nims !189 and !197 make the SDM backends (the Kumo
Relational and Kumo Tabular NIMs, and the Databricks MLflow model that
reuses them) refuse a non-empty `inference.inference_config` with `400
INVALID_REQUEST`. The estimator count is now fixed when the endpoint
starts, through `SDM_NUM_ESTIMATORS`.
This client sent the engine's default config on every KumoRelational
request (`{kind, num_estimators: 1, column_shuffle: false, ...}`),
because `RelationalAdapter._inference` forwarded every key whether or
not the caller had set it. So every relational request failed on those
backends, although none asked for anything beyond the defaults.
## Fix
`RelationalAdapter._inference` now forwards only the inference-config
keys the caller set and omits `inference_config` when none are left.
`run_mode`, `use_prediction_time` and `output.prediction_statistic` are
unchanged, and sessions use the same path. An option the caller does
set, such as `num_estimators: 4`, is still sent on its own; a legacy
backend honours it and an SDM backend refuses it.
This is safe for the legacy kumo-ml backend: it reads `inference_config
or {}` and applies the rest on top of
`InferenceConfig.from_task_type(...)`, whose defaults are identical to
the engine's (one estimator, shuffles off, and `quantile` transforms
with a `median` output for regression). A request without the field gets
exactly what this client used to send.
The two Databricks relational notebooks stop passing `ENSEMBLE =
{'num_estimators': 4, 'column_shuffle': True}`, which SDM backends
refuse; there the ensemble size is set per endpoint through
`SDM_NUM_ESTIMATORS`. `tests/golden/wire_payloads.json` is regenerated
with `scripts/snapshot_wire_payloads.py --write`, and it only loses the
default config from its one relational case.
## Verification
Updated adapter, session and median tests cover a default request
sending no config (through both transports), the engine's full defaults
not being sent, and an explicit option being sent alone. They fail on
main. The client suite passes (1913 passed), along with ruff, mypy and
the golden snapshot check.
End to end, an AdventureWorks `PREDICT SUM(sales_order_details.OrderQty,
0, 30, days) FOR EACH products.ProductID` for product 712 through
`SDMClient.for_databricks_serving` against the SDM staging endpoint
`kumo-rfm-2-1-stg-v23-mr149-review` returns a prediction (120.97) with
no `inference_config` in the request body, while the same request from
main gets `400 INVALID_REQUEST`.
---------
Signed-off-by: Adi Wadaskar <awadaskar@nvidia.com>1 parent fa0637d commit 26ecdd2
10 files changed
Lines changed: 77 additions & 44 deletions
File tree
- examples/databricks
- packages/structured-data-models-client
- src/sdm_client
- adapters
- materializers
- tests
- tests/golden
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
8 | 16 | | |
9 | 17 | | |
10 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | 302 | | |
306 | 303 | | |
307 | 304 | | |
| |||
310 | 307 | | |
311 | 308 | | |
312 | 309 | | |
313 | | - | |
| 310 | + | |
314 | 311 | | |
315 | 312 | | |
316 | 313 | | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
| 314 | + | |
322 | 315 | | |
323 | 316 | | |
324 | 317 | | |
325 | 318 | | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
| 319 | + | |
331 | 320 | | |
332 | 321 | | |
333 | 322 | | |
| |||
431 | 420 | | |
432 | 421 | | |
433 | 422 | | |
434 | | - | |
| 423 | + | |
435 | 424 | | |
436 | 425 | | |
437 | 426 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | 281 | | |
285 | 282 | | |
286 | 283 | | |
| |||
289 | 286 | | |
290 | 287 | | |
291 | 288 | | |
292 | | - | |
| 289 | + | |
293 | 290 | | |
294 | 291 | | |
295 | 292 | | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 293 | + | |
301 | 294 | | |
302 | 295 | | |
303 | 296 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
183 | 186 | | |
184 | | - | |
185 | | - | |
186 | | - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
187 | 192 | | |
188 | 193 | | |
189 | 194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
165 | 169 | | |
166 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
167 | 173 | | |
168 | 174 | | |
169 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
134 | 156 | | |
135 | 157 | | |
136 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
329 | 345 | | |
330 | 346 | | |
331 | 347 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
261 | 262 | | |
262 | 263 | | |
263 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7013 | 7013 | | |
7014 | 7014 | | |
7015 | 7015 | | |
7016 | | - | |
7017 | | - | |
7018 | | - | |
7019 | | - | |
7020 | | - | |
7021 | | - | |
7022 | | - | |
7023 | 7016 | | |
7024 | 7017 | | |
7025 | 7018 | | |
| |||
0 commit comments