Instructions to use OpensourceWTF/Qwen3.8-Flash-Next-MTPLX-oQ4-MTP with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use OpensourceWTF/Qwen3.8-Flash-Next-MTPLX-oQ4-MTP with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir Qwen3.8-Flash-Next-MTPLX-oQ4-MTP OpensourceWTF/Qwen3.8-Flash-Next-MTPLX-oQ4-MTP
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Refresh final guarded MTPLX acceptance receipt
Browse files- MTPLX_VALIDATION.json +18 -10
- README.md +10 -10
- receipts/qwen38-flash-next-oq4-exact-16k-1k.json +19 -18
MTPLX_VALIDATION.json
CHANGED
|
@@ -33,14 +33,18 @@
|
|
| 33 |
},
|
| 34 |
"runtime": {
|
| 35 |
"implementation_pr": "https://github.com/youssofal/MTPLX/pull/368",
|
| 36 |
-
"receipt_commit": "
|
| 37 |
"moe_streaming": false,
|
| 38 |
"ngram_cache": {
|
| 39 |
"eviction": "lru",
|
| 40 |
"requested_payload_ceiling_bytes": 10737418240,
|
| 41 |
"selected_payload_bytes": 1677721600,
|
| 42 |
-
"overhead_bytes":
|
| 43 |
-
"total_reserved_bytes":
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
}
|
| 45 |
},
|
| 46 |
"guarded_exact_run": {
|
|
@@ -48,17 +52,21 @@
|
|
| 48 |
"profile": "sustained",
|
| 49 |
"prompt_tokens": 16384,
|
| 50 |
"generated_tokens": 1024,
|
| 51 |
-
"accepted_by_depth": [
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
"measured_base_residency_bytes": 80435213384,
|
| 56 |
"kv_mtp_reserve_bytes": 637046792,
|
| 57 |
-
"projected_residency_bytes":
|
| 58 |
-
"peak_memory_bytes":
|
| 59 |
"target_residency_bytes": 88046829568,
|
| 60 |
"prompt_token_sha256": "74a389866e6ae77542db2063be379cb220f6045c5c45a260f9beaec472346e26",
|
| 61 |
-
"output_token_sha256": "
|
| 62 |
"guard_lock_path": "/private/tmp/mtplx-gpu-exclusive.lock"
|
| 63 |
},
|
| 64 |
"receipts": {
|
|
|
|
| 33 |
},
|
| 34 |
"runtime": {
|
| 35 |
"implementation_pr": "https://github.com/youssofal/MTPLX/pull/368",
|
| 36 |
+
"receipt_commit": "446c95f651663c390097bf05e09c7a66045756df",
|
| 37 |
"moe_streaming": false,
|
| 38 |
"ngram_cache": {
|
| 39 |
"eviction": "lru",
|
| 40 |
"requested_payload_ceiling_bytes": 10737418240,
|
| 41 |
"selected_payload_bytes": 1677721600,
|
| 42 |
+
"overhead_bytes": 892502016,
|
| 43 |
+
"total_reserved_bytes": 2570223616,
|
| 44 |
+
"prefill_chunk_tokens": 2048,
|
| 45 |
+
"manifest_sha256": "2de8c0579123e43add47a5f6e4f251482523d31405346ac88c98d8651ddbf897",
|
| 46 |
+
"slot_policy": "packed-linked-lru",
|
| 47 |
+
"io_tasks_per_acquisition": 1
|
| 48 |
}
|
| 49 |
},
|
| 50 |
"guarded_exact_run": {
|
|
|
|
| 52 |
"profile": "sustained",
|
| 53 |
"prompt_tokens": 16384,
|
| 54 |
"generated_tokens": 1024,
|
| 55 |
+
"accepted_by_depth": [
|
| 56 |
+
241,
|
| 57 |
+
126,
|
| 58 |
+
58
|
| 59 |
+
],
|
| 60 |
+
"prefill_tps": 396.5944152990156,
|
| 61 |
+
"decode_tps": 27.186181197322167,
|
| 62 |
+
"wall_s": 102.29749158300001,
|
| 63 |
"measured_base_residency_bytes": 80435213384,
|
| 64 |
"kv_mtp_reserve_bytes": 637046792,
|
| 65 |
+
"projected_residency_bytes": 87937451088,
|
| 66 |
+
"peak_memory_bytes": 85222315432,
|
| 67 |
"target_residency_bytes": 88046829568,
|
| 68 |
"prompt_token_sha256": "74a389866e6ae77542db2063be379cb220f6045c5c45a260f9beaec472346e26",
|
| 69 |
+
"output_token_sha256": "4d876b2e83ed4f4ab63027955b3d7b5494200d837564c7077791927d69e8695f",
|
| 70 |
"guard_lock_path": "/private/tmp/mtplx-gpu-exclusive.lock"
|
| 71 |
},
|
| 72 |
"receipts": {
|
README.md
CHANGED
|
@@ -31,7 +31,7 @@ The ngram cache has a configurable 10 GiB payload ceiling. Construction
|
|
| 31 |
measures base residency once and selects the smaller safe payload after
|
| 32 |
reserving KV/MTP, Metal working memory, safety margin, metadata, hash/route
|
| 33 |
tables, alignment, and transient buffers. LRU eviction affects residency only;
|
| 34 |
-
SSD rows remain authoritative.
|
| 35 |
|
| 36 |
## Guarded validation
|
| 37 |
|
|
@@ -42,20 +42,20 @@ Validated on Apple M5 Max unified memory through the canonical
|
|
| 42 |
|---|---:|
|
| 43 |
| Prompt tokens | 16,384 |
|
| 44 |
| Generated tokens | 1,024 exactly |
|
| 45 |
-
| MTP accepted by depth | [
|
| 46 |
-
| Prefill |
|
| 47 |
-
| Decode |
|
| 48 |
-
| Wall time |
|
| 49 |
| Measured base residency | 80,435,213,384 bytes |
|
| 50 |
| Selected ngram payload | 1,677,721,600 bytes |
|
| 51 |
-
| Ngram cache overhead |
|
| 52 |
| KV/MTP reserve | 637,046,792 bytes |
|
| 53 |
-
| Projected residency | 87,
|
| 54 |
-
| Peak memory | 85,222,
|
| 55 |
| Runtime target | 88,046,829,568 bytes (82 GiB) |
|
| 56 |
|
| 57 |
The generated completion token hash is
|
| 58 |
-
`
|
| 59 |
Raw smoke and 16K/1K receipts are included under `receipts/`.
|
| 60 |
|
| 61 |
## Download
|
|
@@ -72,7 +72,7 @@ validation host was performed only through the canonical exclusive GPU guard.
|
|
| 72 |
|
| 73 |
- Source repository: `Vontra/Qwen3.8-Flash-Next-MLX-oQ4-MTP`
|
| 74 |
- Source revision: `43a82b3f0ff64fa417fd09ca046580f08d19b0d6`
|
| 75 |
-
- MTPLX receipt commit: `
|
| 76 |
- Safetensor shards: 22
|
| 77 |
- Artifact bytes measured locally: 113,324,747,928
|
| 78 |
- Source files matching the pinned revision by size and Hub blob identity: 33
|
|
|
|
| 31 |
measures base residency once and selects the smaller safe payload after
|
| 32 |
reserving KV/MTP, Metal working memory, safety margin, metadata, hash/route
|
| 33 |
tables, alignment, and transient buffers. LRU eviction affects residency only;
|
| 34 |
+
SSD rows remain authoritative. The server reserves its selected context and the full supported live prefill-chunk range before MLX load. Cache slots use a packed O(1) free chain/linked LRU, and each acquisition submits one bounded I/O task.
|
| 35 |
|
| 36 |
## Guarded validation
|
| 37 |
|
|
|
|
| 42 |
|---|---:|
|
| 43 |
| Prompt tokens | 16,384 |
|
| 44 |
| Generated tokens | 1,024 exactly |
|
| 45 |
+
| MTP accepted by depth | [241, 126, 58] |
|
| 46 |
+
| Prefill | 396.594 tok/s |
|
| 47 |
+
| Decode | 27.186 tok/s |
|
| 48 |
+
| Wall time | 102.297 s |
|
| 49 |
| Measured base residency | 80,435,213,384 bytes |
|
| 50 |
| Selected ngram payload | 1,677,721,600 bytes |
|
| 51 |
+
| Ngram cache overhead | 892,502,016 bytes |
|
| 52 |
| KV/MTP reserve | 637,046,792 bytes |
|
| 53 |
+
| Projected residency | 87,937,451,088 bytes |
|
| 54 |
+
| Peak memory | 85,222,315,432 bytes (79.37 GiB) |
|
| 55 |
| Runtime target | 88,046,829,568 bytes (82 GiB) |
|
| 56 |
|
| 57 |
The generated completion token hash is
|
| 58 |
+
`4d876b2e83ed4f4ab63027955b3d7b5494200d837564c7077791927d69e8695f`.
|
| 59 |
Raw smoke and 16K/1K receipts are included under `receipts/`.
|
| 60 |
|
| 61 |
## Download
|
|
|
|
| 72 |
|
| 73 |
- Source repository: `Vontra/Qwen3.8-Flash-Next-MLX-oQ4-MTP`
|
| 74 |
- Source revision: `43a82b3f0ff64fa417fd09ca046580f08d19b0d6`
|
| 75 |
+
- MTPLX receipt commit: `446c95f651663c390097bf05e09c7a66045756df`
|
| 76 |
- Safetensor shards: 22
|
| 77 |
- Artifact bytes measured locally: 113,324,747,928
|
| 78 |
- Source files matching the pinned revision by size and Hub blob identity: 33
|
receipts/qwen38-flash-next-oq4-exact-16k-1k.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
| 1 |
{
|
| 2 |
"accepted_by_depth": [
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
],
|
| 7 |
-
"decode_tps":
|
| 8 |
"generated_tokens": 1024,
|
| 9 |
"guard": {
|
| 10 |
-
"child_pid":
|
| 11 |
-
"guard_pid":
|
| 12 |
"lock_path": "/private/tmp/mtplx-gpu-exclusive.lock"
|
| 13 |
},
|
| 14 |
"mode": "mtp",
|
| 15 |
"ngram_cache": {
|
| 16 |
"cache_alignment_bytes": 0,
|
| 17 |
-
"cache_metadata_bytes":
|
| 18 |
-
"cache_overhead_bytes":
|
| 19 |
"cache_payload_bytes": 1677721600,
|
| 20 |
"cache_route_table_bytes": 268435456,
|
| 21 |
"cache_slot_count": 16777216,
|
| 22 |
-
"cache_total_reserved_bytes":
|
| 23 |
"cache_transient_bytes": 3276800,
|
| 24 |
"cache_transient_metadata_bytes": 32768,
|
| 25 |
"eviction": "lru",
|
|
@@ -29,8 +29,9 @@
|
|
| 29 |
"metal_working_reserve_bytes": 2147483648,
|
| 30 |
"mlx_cache_limit_bytes": 2147483648,
|
| 31 |
"payload_formula_ceiling_bytes": 2679602096,
|
|
|
|
| 32 |
"previous_mlx_cache_limit_bytes": 130567005798,
|
| 33 |
-
"projected_residency_bytes":
|
| 34 |
"requested_payload_ceiling_bytes": 10737418240,
|
| 35 |
"safety_margin_bytes": 2147483648,
|
| 36 |
"source_repo": "Vontra/Qwen3.8-Flash-Next-MLX-oQ4-MTP",
|
|
@@ -38,14 +39,14 @@
|
|
| 38 |
"storage": "affine-q4-g32",
|
| 39 |
"target_residency_bytes": 88046829568
|
| 40 |
},
|
| 41 |
-
"output_text": "The user wants me to add a `summarize_generation_outputs`
|
| 42 |
-
"output_token_sha256": "
|
| 43 |
-
"peak_memory_bytes":
|
| 44 |
-
"prefill_tps":
|
| 45 |
"preflight": {
|
| 46 |
-
"available_memory_bytes":
|
| 47 |
-
"cache_overhead_bytes":
|
| 48 |
-
"cache_payload_bytes":
|
| 49 |
"embedded_mtp_bytes": 1633330336,
|
| 50 |
"kv_mtp_reserve_bytes": 637046792,
|
| 51 |
"metal_working_reserve_bytes": 2147483648,
|
|
@@ -64,5 +65,5 @@
|
|
| 64 |
"schema": "mtplx-qwen38-resident-oq4-harness-v1",
|
| 65 |
"source_revision": "43a82b3f0ff64fa417fd09ca046580f08d19b0d6",
|
| 66 |
"status": "passed",
|
| 67 |
-
"wall_s":
|
| 68 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"accepted_by_depth": [
|
| 3 |
+
241,
|
| 4 |
+
126,
|
| 5 |
+
58
|
| 6 |
],
|
| 7 |
+
"decode_tps": 27.186181197322167,
|
| 8 |
"generated_tokens": 1024,
|
| 9 |
"guard": {
|
| 10 |
+
"child_pid": 48464,
|
| 11 |
+
"guard_pid": 48452,
|
| 12 |
"lock_path": "/private/tmp/mtplx-gpu-exclusive.lock"
|
| 13 |
},
|
| 14 |
"mode": "mtp",
|
| 15 |
"ngram_cache": {
|
| 16 |
"cache_alignment_bytes": 0,
|
| 17 |
+
"cache_metadata_bytes": 620756992,
|
| 18 |
+
"cache_overhead_bytes": 892502016,
|
| 19 |
"cache_payload_bytes": 1677721600,
|
| 20 |
"cache_route_table_bytes": 268435456,
|
| 21 |
"cache_slot_count": 16777216,
|
| 22 |
+
"cache_total_reserved_bytes": 2570223616,
|
| 23 |
"cache_transient_bytes": 3276800,
|
| 24 |
"cache_transient_metadata_bytes": 32768,
|
| 25 |
"eviction": "lru",
|
|
|
|
| 29 |
"metal_working_reserve_bytes": 2147483648,
|
| 30 |
"mlx_cache_limit_bytes": 2147483648,
|
| 31 |
"payload_formula_ceiling_bytes": 2679602096,
|
| 32 |
+
"prefill_chunk_tokens": 2048,
|
| 33 |
"previous_mlx_cache_limit_bytes": 130567005798,
|
| 34 |
+
"projected_residency_bytes": 87937451088,
|
| 35 |
"requested_payload_ceiling_bytes": 10737418240,
|
| 36 |
"safety_margin_bytes": 2147483648,
|
| 37 |
"source_repo": "Vontra/Qwen3.8-Flash-Next-MLX-oQ4-MTP",
|
|
|
|
| 39 |
"storage": "affine-q4-g32",
|
| 40 |
"target_residency_bytes": 88046829568
|
| 41 |
},
|
| 42 |
+
"output_text": "The user wants me to add a `summarize_generation_outputs` function to the module that:\n\n1. Takes `outputs: Sequence[GenerationOutput]` as input\n2. Returns a `dict[str, Any]` that is JSON-serializable\n3. Contains: request count, total generated tokens, mean and p95 prefill TPS, mean and p95 decode TPS, mean wall time, and peak memory in GiB\n4. Handles empty sequence without raising\n5. Ignores unavailable optional metrics\n6. Preserves the module's existing type style\n7. Add focused pytest tests for empty input and representative outputs\n8. Return only a unified diff\n\nFirst, I need to understand what `GenerationOutput` likely looks like based on the context. Looking at the code, I see references to `GenerationStats` and various timing/token fields. Let me infer a reasonable structure for `GenerationOutput` based on the patterns in the code:\n\n- It likely has fields like `generated_tokens`, `prompt_tokens`, `prefill_time_s`, `decode_time_s`, `elapsed_s`, `peak_memory_bytes`, etc.\n- Looking at `_generation_rate_fields`, there are fields like `tok_s`, `decode_elapsed_s`, `decode_tok_s`, `end_to_end_tok_s`\n- Looking at `_attach_runtime_diagnostics`, there's `prefill_chunk_size`, timing fields, etc.\n- The `_mlx_memory_stats` returns `peak_memory_bytes`\n\nLet me design a `GenerationOutput` dataclass that captures the relevant fields, then write the `summarize_generation_outputs` function.\n\nActually, looking more carefully, the user says \"add a reusable `summarize_generation_outputs` helper\" - this means `GenerationOutput` might already exist or needs to be defined. Let me create a reasonable dataclass and the summarization function.\n\nLooking at the style:\n- Uses `from __future__ import annotations`\n- Uses `dataclass` from dataclasses\n- Uses `Literal` from typing\n- Uses `Any`, `Callable`, `Mapping`, `Sequence` from typing\n- Uses `numpy` as `np`\n- Heavy use of `getattr` for optional fields\n- Functions are module-level (not class methods)\n- Type annotations are present\n\nLet me design this:\n\n1. A `GenerationOutput` dataclass with the relevant fields (optional ones defaulting to `None`)\n2. A `summarize_generation_outputs` function that:\n - Takes `Sequence[GenerationOutput]`\n - Returns `dict[str, Any]`\n - Computes: request count, total generated tokens, mean/p95 prefill TPS, mean/p95 decode TPS, mean wall time, peak memory in GiB\n - Handles empty sequence\n - Ignores unavailable optional metrics (None fields)\n\nFor the p95 calculation, I'll use `numpy.percentile` since numpy is already imported.\n\nLet me also write focused pytest tests.\n\nHere's my plan:\n\n```python\n@dataclass\nclass GenerationOutput:\n \"\"\"Per-request generation telemetry record.\"\"\"\n prompt_tokens: int\n generated_tokens: int\n wall_time_s: float\n prefill_tps: float | None = None\n decode_tps: float | None = None\n peak_memory_bytes: int | None = None\n\n\ndef summarize_generation_outputs(\n outputs: Sequence[GenerationOutput],\n) -> dict[str, Any]:\n ...\n```\n\nFor the p95, I need to handle the case where there might be very few values (p95 with <2 elements doesn't make statistical sense, but we should still return a value or None).\n\nLet me write the diff now. I'll add:\n1. The `GenerationOutput` dataclass\n2. The `summarize_generation_outputs` function\n3. Tests in a separate test file\n\nActually, re-reading: \"Return only a unified diff against the existing code.\" So I need to produce a diff. Let me structure this as:\n- A diff that adds the dataclass and function to the existing module\n- A separate diff (or part of the same) that adds test file\n\nLet me think about what makes sense. The module already has `import numpy as np` and `import json`, `from typing import Any`, etc. I need to add `import statistics` or use numpy for percentile.\n\nFor the test file, I'll create a new test file.\n\nLet me also look at the existing `GenerationStats` reference - it's referenced as a string annotation `\"GenerationStats\"` in `_attach_runtime_diagnostics`. So `GenerationOutput` would be a new addition.\n\nLet me finalize my design:\n\n```python\n@dataclass\nclass GenerationOutput:\n \"\"\"Per-request generation telemetry record consumed by summarize_generation_outputs.\"\"\"\n",
|
| 43 |
+
"output_token_sha256": "4d876b2e83ed4f4ab63027955b3d7b5494200d837564c7077791927d69e8695f",
|
| 44 |
+
"peak_memory_bytes": 85222315432,
|
| 45 |
+
"prefill_tps": 396.5944152990156,
|
| 46 |
"preflight": {
|
| 47 |
+
"available_memory_bytes": 119380082688,
|
| 48 |
+
"cache_overhead_bytes": 681852944,
|
| 49 |
+
"cache_payload_bytes": 1108361200,
|
| 50 |
"embedded_mtp_bytes": 1633330336,
|
| 51 |
"kv_mtp_reserve_bytes": 637046792,
|
| 52 |
"metal_working_reserve_bytes": 2147483648,
|
|
|
|
| 65 |
"schema": "mtplx-qwen38-resident-oq4-harness-v1",
|
| 66 |
"source_revision": "43a82b3f0ff64fa417fd09ca046580f08d19b0d6",
|
| 67 |
"status": "passed",
|
| 68 |
+
"wall_s": 102.29749158300001
|
| 69 |
}
|