inferencekit-cli 0.1.0__py3-none-any.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.
Files changed (104) hide show
  1. inferencekit/__init__.py +9 -0
  2. inferencekit/__main__.py +5 -0
  3. inferencekit/analysis/__init__.py +1 -0
  4. inferencekit/analysis/ncu_csv.py +284 -0
  5. inferencekit/analysis/nsys_sqlite.py +518 -0
  6. inferencekit/canonical.py +104 -0
  7. inferencekit/checkpoint.py +396 -0
  8. inferencekit/cli.py +274 -0
  9. inferencekit/cuda/bw_peak.cu +252 -0
  10. inferencekit/cuda/torch_bw.py +60 -0
  11. inferencekit/engines/__init__.py +7 -0
  12. inferencekit/engines/adapters.py +190 -0
  13. inferencekit/engines/clip/__init__.py +13 -0
  14. inferencekit/engines/clip/comfyui.py +749 -0
  15. inferencekit/engines/clip/diffusers_ltx.py +601 -0
  16. inferencekit/engines/clip/noise.py +46 -0
  17. inferencekit/engines/clip/official_ltx.py +316 -0
  18. inferencekit/engines/clip/server.py +542 -0
  19. inferencekit/engines/clip/stepdump.py +182 -0
  20. inferencekit/engines/gates.py +94 -0
  21. inferencekit/engines/sglang_worker.py +86 -0
  22. inferencekit/engines/vllm_worker.py +129 -0
  23. inferencekit/evidence.py +427 -0
  24. inferencekit/gpuinfo.py +93 -0
  25. inferencekit/hardware.py +135 -0
  26. inferencekit/mcp_server.py +178 -0
  27. inferencekit/ops/__init__.py +30 -0
  28. inferencekit/ops/bench.py +184 -0
  29. inferencekit/ops/bench_audio.py +384 -0
  30. inferencekit/ops/bench_clip.py +819 -0
  31. inferencekit/ops/bench_image.py +393 -0
  32. inferencekit/ops/bench_rounds.py +297 -0
  33. inferencekit/ops/bench_serve.py +866 -0
  34. inferencekit/ops/ceiling.py +135 -0
  35. inferencekit/ops/compare.py +378 -0
  36. inferencekit/ops/correctness.py +153 -0
  37. inferencekit/ops/doctor.py +486 -0
  38. inferencekit/ops/gates.py +1772 -0
  39. inferencekit/ops/gates_clip.py +930 -0
  40. inferencekit/ops/intake.py +1321 -0
  41. inferencekit/ops/ledger.py +749 -0
  42. inferencekit/ops/manifest.py +309 -0
  43. inferencekit/ops/ncu.py +183 -0
  44. inferencekit/ops/nsys.py +224 -0
  45. inferencekit/ops/prompts.py +316 -0
  46. inferencekit/ops/quality.py +2161 -0
  47. inferencekit/ops/quality_clip.py +690 -0
  48. inferencekit/ops/quality_clip_steps.py +341 -0
  49. inferencekit/ops/report.py +317 -0
  50. inferencekit/ops/review.py +119 -0
  51. inferencekit/ops/rocprof.py +89 -0
  52. inferencekit/ops/roofline.py +392 -0
  53. inferencekit/ops/store.py +61 -0
  54. inferencekit/proc.py +172 -0
  55. inferencekit/prompts/ATTRIBUTION.md +56 -0
  56. inferencekit/prompts/__init__.py +167 -0
  57. inferencekit/prompts/build.py +518 -0
  58. inferencekit/prompts/dev-load.jsonl.gz +0 -0
  59. inferencekit/prompts/dev-load.manifest.json +212 -0
  60. inferencekit/prompts/dev.jsonl.gz +0 -0
  61. inferencekit/prompts/dev.manifest.json +214 -0
  62. inferencekit/prompts/exclusions.json +54 -0
  63. inferencekit/quality/__init__.py +23 -0
  64. inferencekit/quality/client.py +66 -0
  65. inferencekit/quality/data/gsm8k_LICENSE.txt +21 -0
  66. inferencekit/quality/fake.py +329 -0
  67. inferencekit/quality/gsm8k.py +224 -0
  68. inferencekit/quality/logprobs.py +106 -0
  69. inferencekit/quality/metrics.py +235 -0
  70. inferencekit/quality/niah.py +63 -0
  71. inferencekit/quality/parquet.py +296 -0
  72. inferencekit/quality/sampling.py +262 -0
  73. inferencekit/quality/step_replay.py +217 -0
  74. inferencekit/quality/video_metrics.py +304 -0
  75. inferencekit/registry.py +206 -0
  76. inferencekit/review/__init__.py +6 -0
  77. inferencekit/review/diff.py +163 -0
  78. inferencekit/review/media.py +181 -0
  79. inferencekit/review/page.py +920 -0
  80. inferencekit/review/rundir.py +844 -0
  81. inferencekit/roofline_headers.py +504 -0
  82. inferencekit/schemas/evidence.v1.json +130 -0
  83. inferencekit/schemas/evidence.v2.json +499 -0
  84. inferencekit/schemas/intake.v1.json +276 -0
  85. inferencekit/schemas/run-manifest.v1.json +118 -0
  86. inferencekit/serve/__init__.py +8 -0
  87. inferencekit/serve/audio_client.py +330 -0
  88. inferencekit/serve/client.py +446 -0
  89. inferencekit/serve/clip_client.py +351 -0
  90. inferencekit/serve/clip_rounds.py +429 -0
  91. inferencekit/serve/image_client.py +373 -0
  92. inferencekit/serve/loadgen.py +136 -0
  93. inferencekit/serve/metrics.py +203 -0
  94. inferencekit/serve/profiles.py +105 -0
  95. inferencekit/serve/prompts_io.py +125 -0
  96. inferencekit/serve/rounds.py +1111 -0
  97. inferencekit/serve/servers.py +897 -0
  98. inferencekit/stats.py +249 -0
  99. inferencekit_cli-0.1.0.dist-info/METADATA +233 -0
  100. inferencekit_cli-0.1.0.dist-info/RECORD +104 -0
  101. inferencekit_cli-0.1.0.dist-info/WHEEL +4 -0
  102. inferencekit_cli-0.1.0.dist-info/entry_points.txt +2 -0
  103. inferencekit_cli-0.1.0.dist-info/licenses/LICENSE +202 -0
  104. inferencekit_cli-0.1.0.dist-info/licenses/NOTICE +9 -0
@@ -0,0 +1,499 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:inferencekit:schema:evidence:v2",
4
+ "title": "inferencekit evidence record, version 2",
5
+ "description": "One measurement or derivation, content-addressed: evidence_id = 'ev_' + sha256 of the canonical JSON (sorted keys, no whitespace) of every other field. Same envelope as v1 (schema 'inferkit.evidence.v1'); v2 adds serving workloads (single-user and load modes, prompt sets, SLOs) and the kinds written by bench serve, gates, quality and the run manifest; 0.3 adds clip workloads (task, shape, steps, seed policy, clip set) and the kinds written by bench clip, gates clip and quality clip.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema",
10
+ "evidence_id",
11
+ "kind",
12
+ "claim_class",
13
+ "summary",
14
+ "identity",
15
+ "provenance",
16
+ "metrics",
17
+ "artifacts",
18
+ "coverage",
19
+ "limitations",
20
+ "data"
21
+ ],
22
+ "properties": {
23
+ "schema": {
24
+ "const": "inferencekit.evidence.v2"
25
+ },
26
+ "evidence_id": {
27
+ "type": "string",
28
+ "pattern": "^ev_[0-9a-f]{64}$"
29
+ },
30
+ "kind": {
31
+ "enum": [
32
+ "environment",
33
+ "roofline",
34
+ "ceiling",
35
+ "benchmark",
36
+ "nsys_capture",
37
+ "nsys_timeline",
38
+ "ncu_capture",
39
+ "ncu_kernels",
40
+ "correctness",
41
+ "comparison",
42
+ "serve_benchmark",
43
+ "capacity",
44
+ "gates",
45
+ "quality_trajectory",
46
+ "quality_task",
47
+ "manifest",
48
+ "clip_benchmark",
49
+ "clip_gates",
50
+ "clip_quality",
51
+ "clip_steps",
52
+ "image_benchmark",
53
+ "audio_benchmark",
54
+ "rocprof_capture",
55
+ "rocprof_summary"
56
+ ]
57
+ },
58
+ "claim_class": {
59
+ "description": "observed = measured on hardware; derived = computed from other evidence or a model config; inferred = a judgement that goes beyond the data.",
60
+ "enum": [
61
+ "observed",
62
+ "derived",
63
+ "inferred"
64
+ ]
65
+ },
66
+ "summary": {
67
+ "type": "string",
68
+ "maxLength": 600
69
+ },
70
+ "identity": {
71
+ "type": "object",
72
+ "additionalProperties": false,
73
+ "required": [
74
+ "gpu",
75
+ "engine",
76
+ "model",
77
+ "workload"
78
+ ],
79
+ "properties": {
80
+ "gpu": {
81
+ "type": "object",
82
+ "additionalProperties": false,
83
+ "properties": {
84
+ "name": {
85
+ "$ref": "#/$defs/optString"
86
+ },
87
+ "count": {
88
+ "$ref": "#/$defs/optInt"
89
+ },
90
+ "driver": {
91
+ "$ref": "#/$defs/optString"
92
+ },
93
+ "cuda": {
94
+ "$ref": "#/$defs/optString"
95
+ },
96
+ "clocks": {
97
+ "enum": [
98
+ "default",
99
+ "locked",
100
+ null
101
+ ]
102
+ }
103
+ }
104
+ },
105
+ "engine": {
106
+ "type": "object",
107
+ "additionalProperties": false,
108
+ "properties": {
109
+ "name": {
110
+ "$ref": "#/$defs/optString"
111
+ },
112
+ "version": {
113
+ "$ref": "#/$defs/optString"
114
+ },
115
+ "commit": {
116
+ "$ref": "#/$defs/optString"
117
+ },
118
+ "flags": {
119
+ "type": "object"
120
+ }
121
+ }
122
+ },
123
+ "model": {
124
+ "type": "object",
125
+ "additionalProperties": false,
126
+ "properties": {
127
+ "id": {
128
+ "$ref": "#/$defs/optString"
129
+ },
130
+ "revision": {
131
+ "$ref": "#/$defs/optString"
132
+ },
133
+ "dtype": {
134
+ "$ref": "#/$defs/optString"
135
+ },
136
+ "quant": {
137
+ "$ref": "#/$defs/optString"
138
+ }
139
+ }
140
+ },
141
+ "workload": {
142
+ "type": "object",
143
+ "additionalProperties": false,
144
+ "properties": {
145
+ "prompt_len": {
146
+ "$ref": "#/$defs/optInt"
147
+ },
148
+ "gen_len": {
149
+ "$ref": "#/$defs/optInt"
150
+ },
151
+ "batch": {
152
+ "$ref": "#/$defs/optInt"
153
+ },
154
+ "seed": {
155
+ "$ref": "#/$defs/optInt"
156
+ },
157
+ "mode": {
158
+ "enum": [
159
+ "single",
160
+ "load",
161
+ null
162
+ ],
163
+ "description": "single = one request at a time; load = open-loop arrivals (or a labelled closed-loop stress test)."
164
+ },
165
+ "bucket": {
166
+ "$ref": "#/$defs/optString",
167
+ "description": "Input bucket (very_short, short, medium, long) when the record covers one bucket; null when it covers several."
168
+ },
169
+ "concurrency": {
170
+ "description": "Concurrency level, or the grid of levels a load record covers.",
171
+ "oneOf": [
172
+ {
173
+ "type": "null"
174
+ },
175
+ {
176
+ "type": "integer",
177
+ "minimum": 1
178
+ },
179
+ {
180
+ "type": "array",
181
+ "items": {
182
+ "type": "integer",
183
+ "minimum": 1
184
+ }
185
+ }
186
+ ]
187
+ },
188
+ "concurrency_source": {
189
+ "$ref": "#/$defs/optString",
190
+ "description": "How concurrency was chosen: flag, get_server_info, llamacpp_props or timing_probe (quality gsm8k --concurrency 0)."
191
+ },
192
+ "rate_rps": {
193
+ "description": "Offered arrival rate in requests/s, or the grid of rates a load record covers.",
194
+ "oneOf": [
195
+ {
196
+ "type": "null"
197
+ },
198
+ {
199
+ "type": "number",
200
+ "minimum": 0
201
+ },
202
+ {
203
+ "type": "array",
204
+ "items": {
205
+ "type": "number",
206
+ "minimum": 0
207
+ }
208
+ }
209
+ ]
210
+ },
211
+ "duration_s": {
212
+ "type": [
213
+ "number",
214
+ "null"
215
+ ],
216
+ "minimum": 0
217
+ },
218
+ "prompt_set": {
219
+ "oneOf": [
220
+ {
221
+ "type": "null"
222
+ },
223
+ {
224
+ "type": "object",
225
+ "additionalProperties": false,
226
+ "required": [
227
+ "name",
228
+ "sha256"
229
+ ],
230
+ "properties": {
231
+ "name": {
232
+ "$ref": "#/$defs/optString"
233
+ },
234
+ "sha256": {
235
+ "type": "string",
236
+ "pattern": "^[0-9a-f]{64}$"
237
+ }
238
+ }
239
+ }
240
+ ]
241
+ },
242
+ "slo": {
243
+ "oneOf": [
244
+ {
245
+ "type": "null"
246
+ },
247
+ {
248
+ "type": "object",
249
+ "additionalProperties": false,
250
+ "properties": {
251
+ "ttft_p95_ms": {
252
+ "type": [
253
+ "number",
254
+ "null"
255
+ ]
256
+ },
257
+ "tpot_p95_ms": {
258
+ "type": [
259
+ "number",
260
+ "null"
261
+ ]
262
+ },
263
+ "max_fail": {
264
+ "type": [
265
+ "number",
266
+ "null"
267
+ ],
268
+ "minimum": 0
269
+ }
270
+ }
271
+ }
272
+ ]
273
+ },
274
+ "endpoint_kind": {
275
+ "$ref": "#/$defs/optString",
276
+ "description": "How the engine was reached, e.g. openai_chat, openai_completions, in_process; for clips clip_http (POST /v1/clips), comfyui (a ComfyUI server driven through its prompt API) or in_process (the pipeline ran inside the measuring process)."
277
+ },
278
+ "task": {
279
+ "enum": ["t2v", "i2v", "t2i", "tts", null],
280
+ "description": "Generation task: text/image-to-video, text-to-image or text-to-speech; null for mixed tasks."
281
+ },
282
+ "width": {"type": ["integer", "null"], "minimum": 1, "description": "Clips: requested width in pixels (null when clips differ)."},
283
+ "height": {"type": ["integer", "null"], "minimum": 1, "description": "Clips: requested height in pixels (null when clips differ)."},
284
+ "num_frames": {"type": ["integer", "null"], "minimum": 1, "description": "Clips: requested frames per clip (null when clips differ)."},
285
+ "fps": {"type": ["number", "null"], "exclusiveMinimum": 0, "description": "Clips: requested frame rate (null when clips differ)."},
286
+ "steps": {"type": ["integer", "null"], "minimum": 1, "description": "Clips: requested denoising steps (null when clips differ)."},
287
+ "guidance_scale": {"type": ["number", "null"], "minimum": 0, "description": "Clips: requested classifier-free guidance scale (null when clips differ)."},
288
+ "seed_policy": {
289
+ "description": "Clips: how each round's seed was chosen, fixed before the run. per_round = derived from base and the round index (the same for every engine in a round, different across rounds); fixed = base every round; list = the given seeds in round order.",
290
+ "oneOf": [
291
+ {"type": "null"},
292
+ {
293
+ "type": "object",
294
+ "additionalProperties": false,
295
+ "required": ["name"],
296
+ "properties": {
297
+ "name": {"enum": ["per_round", "fixed", "list"]},
298
+ "base": {"$ref": "#/$defs/optInt"},
299
+ "rule": {"type": "string"}
300
+ }
301
+ }
302
+ ]
303
+ },
304
+ "seeds": {
305
+ "description": "Clips: the seed of each round, in round order (round 0 first).",
306
+ "oneOf": [{"type": "null"}, {"type": "array", "items": {"type": "integer"}}]
307
+ },
308
+ "clip_set": {
309
+ "description": "Clips: the clip set file (JSONL), by name and sha256 of its bytes.",
310
+ "oneOf": [
311
+ {"type": "null"},
312
+ {
313
+ "type": "object",
314
+ "additionalProperties": false,
315
+ "required": ["name", "sha256"],
316
+ "properties": {
317
+ "name": {"$ref": "#/$defs/optString"},
318
+ "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
319
+ }
320
+ }
321
+ ]
322
+ },
323
+ "audio": {"type": ["boolean", "null"], "description": "Clips: whether the engine was asked for (or reported) an audio track; null when unknown."},
324
+ "request_set": {"oneOf": [{"type": "null"}, {"type": "object", "additionalProperties": false, "required": ["sha256"], "properties": {"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}, "n": {"type": ["integer", "null"], "minimum": 0}}}], "description": "bench serve: sha256 over the selected prompt ids and buckets and each request's max_tokens and chat_template_kwargs, plus the API, exact-length request and extra body; equal only when two records asked for exactly the same requests."},
325
+ "image_task_set": {"oneOf": [{"type": "null"}, {"type": "object", "additionalProperties": false, "required": ["sha256"], "properties": {"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}, "n": {"type": ["integer", "null"], "minimum": 0}}}], "description": "Image task identity excluding steps and numerical format, for explicitly labelled quality tradeoffs."},
326
+ "prefix_cache": {
327
+ "enum": ["cold", "warm", null],
328
+ "description": "cold = no timed request repeats an earlier prompt of the run (prefix-cache hits impossible); warm = prompts repeat across rounds on purpose, so prefill can be served from the engine's prefix cache."
329
+ }
330
+ }
331
+ }
332
+ }
333
+ },
334
+ "provenance": {
335
+ "type": "object",
336
+ "additionalProperties": false,
337
+ "required": [
338
+ "tool",
339
+ "tool_version",
340
+ "argv_digest",
341
+ "started",
342
+ "ended"
343
+ ],
344
+ "properties": {
345
+ "tool": {
346
+ "type": "string"
347
+ },
348
+ "tool_version": {
349
+ "type": "string"
350
+ },
351
+ "argv_digest": {
352
+ "type": "string",
353
+ "pattern": "^sha256:[0-9a-f]{64}$"
354
+ },
355
+ "started": {
356
+ "type": "string"
357
+ },
358
+ "ended": {
359
+ "type": "string"
360
+ }
361
+ }
362
+ },
363
+ "metrics": {
364
+ "type": "array",
365
+ "items": {
366
+ "$ref": "#/$defs/metric"
367
+ }
368
+ },
369
+ "artifacts": {
370
+ "type": "array",
371
+ "items": {
372
+ "$ref": "#/$defs/artifact"
373
+ }
374
+ },
375
+ "coverage": {
376
+ "type": "object",
377
+ "additionalProperties": false,
378
+ "required": [
379
+ "complete",
380
+ "missing"
381
+ ],
382
+ "properties": {
383
+ "complete": {
384
+ "type": "boolean"
385
+ },
386
+ "missing": {
387
+ "type": "array",
388
+ "items": {
389
+ "type": "string"
390
+ }
391
+ }
392
+ }
393
+ },
394
+ "limitations": {
395
+ "type": "array",
396
+ "items": {
397
+ "type": "string"
398
+ }
399
+ },
400
+ "data": {
401
+ "type": "object"
402
+ }
403
+ },
404
+ "$defs": {
405
+ "optString": {
406
+ "type": [
407
+ "string",
408
+ "null"
409
+ ]
410
+ },
411
+ "optInt": {
412
+ "type": [
413
+ "integer",
414
+ "null"
415
+ ]
416
+ },
417
+ "metric": {
418
+ "type": "object",
419
+ "additionalProperties": false,
420
+ "required": [
421
+ "name",
422
+ "value",
423
+ "unit",
424
+ "stat"
425
+ ],
426
+ "properties": {
427
+ "name": {
428
+ "type": "string"
429
+ },
430
+ "value": {
431
+ "type": [
432
+ "number",
433
+ "null"
434
+ ]
435
+ },
436
+ "unit": {
437
+ "type": "string"
438
+ },
439
+ "stat": {
440
+ "type": "string"
441
+ },
442
+ "n": {
443
+ "type": [
444
+ "integer",
445
+ "null"
446
+ ]
447
+ },
448
+ "ci95": {
449
+ "oneOf": [
450
+ {
451
+ "type": "null"
452
+ },
453
+ {
454
+ "type": "array",
455
+ "minItems": 2,
456
+ "maxItems": 2,
457
+ "items": {
458
+ "type": [
459
+ "number",
460
+ "null"
461
+ ]
462
+ }
463
+ }
464
+ ]
465
+ },
466
+ "subject": {
467
+ "type": "string",
468
+ "description": "What the metric is about when a record holds several subjects (a kernel name, a buffer size)."
469
+ }
470
+ }
471
+ },
472
+ "artifact": {
473
+ "type": "object",
474
+ "additionalProperties": false,
475
+ "required": [
476
+ "path",
477
+ "sha256",
478
+ "bytes"
479
+ ],
480
+ "properties": {
481
+ "path": {
482
+ "type": "string",
483
+ "description": "Relative to the record's run directory, unless role is 'input'."
484
+ },
485
+ "sha256": {
486
+ "type": "string",
487
+ "pattern": "^[0-9a-f]{64}$"
488
+ },
489
+ "bytes": {
490
+ "type": "integer",
491
+ "minimum": 0
492
+ },
493
+ "role": {
494
+ "type": "string"
495
+ }
496
+ }
497
+ }
498
+ }
499
+ }