Repository navigation
Commit 9b8bc3a
fix: qwen3_5_moe CUDA graphs capture into a new pool after the buffers grow
With expandable segments (PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True), the first request whose
prompt plus max_tokens passed 8192 rows, and every request after it, failed at capture:
"it->second->use_count > 0 INTERNAL ASSERT FAILED at CUDACachingAllocator.cpp:3332".
Growing the buffers drops every graph but kept the pool handle. Torch counts a private pool's expandable
mappings per allocation and its unmaps per free range, so once freed blocks coalesce the count stays above
zero, the pool is never unregistered, and a capture into it finds a pool no graph uses. A growth now takes
a new handle.
RTX PRO 6000, torch 2.13 (NGC 26.07), Vontra/Qwen3.6-35B-A3B-MLX-4bit-MTP: 40 label-style requests from
8 clients, three past 8192 rows, fail from the first growth on before and pass after, with unchanged token
SHA-256s equal to "draft": false. The new test_graphs_recapture_after_the_buffers_grow fails 2 of 4 cases
before; tests/cuda/test_qwen36_moe.py and tests/test_qwen36_family.py: 16 passed.1 parent 603d3bc commit 9b8bc3a
2 files changed
Lines changed: 36 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
157 | 184 | | |
158 | 185 | | |
159 | 186 | | |
| |||
0 commit comments