vLLM contracts with input cases (text): regenerated, baselines re-recorded
Browse filesThe vLLM integrations (vllm/transformers, and vllm/vllm where vLLM has its own implementation) declare input cases (transformers-mic #277), only `text` for now; variants are run settings only. Regenerated by the vLLM contract generator (add_vllm_integrations.py); baselines recorded, reviewed and checked with tmic. The fixture is unchanged.
README.md
CHANGED
|
@@ -17,7 +17,7 @@ Slim model weights, executable usage and framework expectations in one repositor
|
|
| 17 |
|
| 18 |
## Contract
|
| 19 |
|
| 20 |
-
###
|
| 21 |
|
| 22 |
Runnable usage and the framework expectations directory are linked above.
|
| 23 |
|
|
|
|
| 17 |
|
| 18 |
## Contract
|
| 19 |
|
| 20 |
+
### tiny_starcoder_py: vLLM contract
|
| 21 |
|
| 22 |
Runnable usage and the framework expectations directory are linked above.
|
| 23 |
|
integration.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"mic": "0.3",
|
| 3 |
-
"name": "
|
| 4 |
-
"usage": "vLLM
|
| 5 |
"architecture": "GPTBigCodeForCausalLM",
|
| 6 |
"checkpoints": {
|
| 7 |
"bigcode/tiny_starcoder_py": {
|
|
@@ -44,6 +44,9 @@
|
|
| 44 |
"dtype": "float32"
|
| 45 |
}
|
| 46 |
},
|
|
|
|
|
|
|
|
|
|
| 47 |
"training": false,
|
| 48 |
"resources": {
|
| 49 |
"fixture": {
|
|
@@ -65,27 +68,8 @@
|
|
| 65 |
"runtime": {
|
| 66 |
"compare": "exact"
|
| 67 |
},
|
| 68 |
-
"
|
| 69 |
-
"compare": "exact"
|
| 70 |
-
},
|
| 71 |
-
"predicted_text": {
|
| 72 |
-
"compare": "exact"
|
| 73 |
-
},
|
| 74 |
-
"next_token_logits": {
|
| 75 |
-
"compare": "allclose",
|
| 76 |
-
"atol": 0.0001,
|
| 77 |
-
"rtol": 0.0001
|
| 78 |
-
},
|
| 79 |
-
"training.loss": {
|
| 80 |
-
"compare": "allclose",
|
| 81 |
-
"atol": 0.0001,
|
| 82 |
-
"rtol": 0.0001
|
| 83 |
-
},
|
| 84 |
-
"training.gradients": {
|
| 85 |
"compare": "all_true"
|
| 86 |
-
},
|
| 87 |
-
"training.updated": {
|
| 88 |
-
"compare": "true"
|
| 89 |
}
|
| 90 |
}
|
| 91 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"mic": "0.3",
|
| 3 |
+
"name": "tiny_starcoder_py: vLLM contract",
|
| 4 |
+
"usage": "Each vLLM integration checks that vLLM serving the fixture agrees with plain Transformers greedy generation on the same weights, for every input case: vllm/transformers uses the Transformers backend (model_impl='transformers')",
|
| 5 |
"architecture": "GPTBigCodeForCausalLM",
|
| 6 |
"checkpoints": {
|
| 7 |
"bigcode/tiny_starcoder_py": {
|
|
|
|
| 44 |
"dtype": "float32"
|
| 45 |
}
|
| 46 |
},
|
| 47 |
+
"cases": {
|
| 48 |
+
"text": {}
|
| 49 |
+
},
|
| 50 |
"training": false,
|
| 51 |
"resources": {
|
| 52 |
"fixture": {
|
|
|
|
| 68 |
"runtime": {
|
| 69 |
"compare": "exact"
|
| 70 |
},
|
| 71 |
+
"checks": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
"compare": "all_true"
|
|
|
|
|
|
|
|
|
|
| 73 |
}
|
| 74 |
}
|
| 75 |
}
|
integrations/vllm/transformers/expectations/cpu-x86_64/{tiny_starcoder_py-vllm-mic.json → tiny_starcoder_py-vllm-mic.text.json}
RENAMED
|
@@ -2,13 +2,13 @@
|
|
| 2 |
"recorded_with": {
|
| 3 |
"contract": "huggingface-mic-temp/tiny_starcoder_py-vllm-mic",
|
| 4 |
"contract_name": "tiny_starcoder_py-vllm",
|
| 5 |
-
"contract_revision": "
|
| 6 |
"framework": "vllm/transformers",
|
| 7 |
"variant": "default",
|
| 8 |
"target": "tiny_starcoder_py-vllm-mic",
|
| 9 |
-
"case":
|
| 10 |
"kind": "fixture",
|
| 11 |
-
"revision": "
|
| 12 |
"source_model": "bigcode/tiny_starcoder_py",
|
| 13 |
"weights": "random",
|
| 14 |
"fixture_repo": "huggingface-mic-temp/tiny_starcoder_py-vllm-mic",
|
|
@@ -31,7 +31,7 @@
|
|
| 31 |
"soundfile": "0.14.0",
|
| 32 |
"scipy": "1.17.1"
|
| 33 |
},
|
| 34 |
-
"seconds":
|
| 35 |
"environment_differs": {
|
| 36 |
"torch": "2.14.0+cpu (pinned 2.15.0)",
|
| 37 |
"pillow": "13.0.0 (pinned 12.3.0)",
|
|
@@ -41,8 +41,8 @@
|
|
| 41 |
},
|
| 42 |
"platform": "cpu-x86_64",
|
| 43 |
"baseline_repo": "huggingface-mic-temp/tiny_starcoder_py-vllm-mic",
|
| 44 |
-
"baseline_revision": "
|
| 45 |
-
"baseline_path": "integrations/vllm/transformers/expectations/cpu-x86_64/tiny_starcoder_py-vllm-mic.json"
|
| 46 |
},
|
| 47 |
"outputs": {
|
| 48 |
"runtime": {
|
|
|
|
| 2 |
"recorded_with": {
|
| 3 |
"contract": "huggingface-mic-temp/tiny_starcoder_py-vllm-mic",
|
| 4 |
"contract_name": "tiny_starcoder_py-vllm",
|
| 5 |
+
"contract_revision": "local",
|
| 6 |
"framework": "vllm/transformers",
|
| 7 |
"variant": "default",
|
| 8 |
"target": "tiny_starcoder_py-vllm-mic",
|
| 9 |
+
"case": "text",
|
| 10 |
"kind": "fixture",
|
| 11 |
+
"revision": "36b98f69b76fa03c659ebebaf45341e894214528",
|
| 12 |
"source_model": "bigcode/tiny_starcoder_py",
|
| 13 |
"weights": "random",
|
| 14 |
"fixture_repo": "huggingface-mic-temp/tiny_starcoder_py-vllm-mic",
|
|
|
|
| 31 |
"soundfile": "0.14.0",
|
| 32 |
"scipy": "1.17.1"
|
| 33 |
},
|
| 34 |
+
"seconds": 11.86,
|
| 35 |
"environment_differs": {
|
| 36 |
"torch": "2.14.0+cpu (pinned 2.15.0)",
|
| 37 |
"pillow": "13.0.0 (pinned 12.3.0)",
|
|
|
|
| 41 |
},
|
| 42 |
"platform": "cpu-x86_64",
|
| 43 |
"baseline_repo": "huggingface-mic-temp/tiny_starcoder_py-vllm-mic",
|
| 44 |
+
"baseline_revision": "local",
|
| 45 |
+
"baseline_path": "integrations/vllm/transformers/expectations/cpu-x86_64/tiny_starcoder_py-vllm-mic.text.json"
|
| 46 |
},
|
| 47 |
"outputs": {
|
| 48 |
"runtime": {
|
integrations/vllm/transformers/usage.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
-
#
|
| 2 |
|
| 3 |
-
This page is the vLLM contract of the
|
| 4 |
[Transformers modeling backend](https://docs.vllm.ai/en/latest/models/supported_models.html#transformers)
|
| 5 |
(`model_impl="transformers"`), which runs the Transformers modeling code inside vLLM's engine (paged KV cache,
|
| 6 |
continuous batching, vLLM attention). The MIC runner runs the block below against the slim fixture in
|
| 7 |
-
[`integration.json`](../../integration.json). Lines marked `# doc-builder: hide` only matter there.
|
| 8 |
|
| 9 |
The check is differential: Transformers and vLLM run the same weights in the same process, and the contract
|
| 10 |
asserts that vLLM picked the Transformers backend, generates the same greedy tokens and produces the same logits
|
|
@@ -13,6 +13,8 @@ Transformers breaks what the backend relies on (attention dispatch through `ALL_
|
|
| 13 |
propagation, positions, weight names, config fields), not when modeling math changes, which moves both sides alike
|
| 14 |
and is covered by the Transformers contract.
|
| 15 |
|
|
|
|
|
|
|
| 16 |
## Greedy generation: vLLM vs Transformers
|
| 17 |
|
| 18 |
```py runnable:usage
|
|
@@ -28,9 +30,13 @@ model_id = "bigcode/tiny_starcoder_py"
|
|
| 28 |
model_id = os.environ.get("MIC_MODEL", model_id) # doc-builder: hide
|
| 29 |
revision = os.environ.get("MIC_MODEL_REVISION") or None # doc-builder: hide
|
| 30 |
variant = json.loads(os.environ.get("MIC_MODEL_KWARGS", "{}")) # doc-builder: hide
|
|
|
|
|
|
|
| 31 |
dtype = variant.get("dtype", "float32")
|
| 32 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 33 |
-
prompts =
|
|
|
|
|
|
|
| 34 |
max_new_tokens = 6
|
| 35 |
|
| 36 |
# Reference: Transformers, one prompt at a time (no padding), greedy
|
|
|
|
| 1 |
+
# tiny_starcoder_py: vLLM Transformers backend
|
| 2 |
|
| 3 |
+
This page is the vLLM contract of the tiny_starcoder_py MIC and also a usage example: vLLM serves the model with its
|
| 4 |
[Transformers modeling backend](https://docs.vllm.ai/en/latest/models/supported_models.html#transformers)
|
| 5 |
(`model_impl="transformers"`), which runs the Transformers modeling code inside vLLM's engine (paged KV cache,
|
| 6 |
continuous batching, vLLM attention). The MIC runner runs the block below against the slim fixture in
|
| 7 |
+
[`integration.json`](../../../integration.json). Lines marked `# doc-builder: hide` only matter there.
|
| 8 |
|
| 9 |
The check is differential: Transformers and vLLM run the same weights in the same process, and the contract
|
| 10 |
asserts that vLLM picked the Transformers backend, generates the same greedy tokens and produces the same logits
|
|
|
|
| 13 |
propagation, positions, weight names, config fields), not when modeling math changes, which moves both sides alike
|
| 14 |
and is covered by the Transformers contract.
|
| 15 |
|
| 16 |
+
The input case is `text`; the MIC runner runs every case, for every variant.
|
| 17 |
+
|
| 18 |
## Greedy generation: vLLM vs Transformers
|
| 19 |
|
| 20 |
```py runnable:usage
|
|
|
|
| 30 |
model_id = os.environ.get("MIC_MODEL", model_id) # doc-builder: hide
|
| 31 |
revision = os.environ.get("MIC_MODEL_REVISION") or None # doc-builder: hide
|
| 32 |
variant = json.loads(os.environ.get("MIC_MODEL_KWARGS", "{}")) # doc-builder: hide
|
| 33 |
+
case = "text" # the input case: "text"
|
| 34 |
+
case = os.environ.get("MIC_CASE", case) # doc-builder: hide
|
| 35 |
dtype = variant.get("dtype", "float32")
|
| 36 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 37 |
+
prompts = {
|
| 38 |
+
"text": ["The capital of France is", "The sky is blue because"],
|
| 39 |
+
}[case]
|
| 40 |
max_new_tokens = 6
|
| 41 |
|
| 42 |
# Reference: Transformers, one prompt at a time (no padding), greedy
|