Add files using upload-large-folder tool
Browse files
code/models/common/models/qwen3_32b/hf_adaptor.py
CHANGED
|
@@ -172,7 +172,14 @@ def _qwen_stop_token_ids(tokenizer) -> tuple[int, ...]:
|
|
| 172 |
def _trace_seq_lens(num_devices: int, max_prefill_chunk_size: int, max_seq_len: int) -> tuple[int, ...]:
|
| 173 |
if num_devices not in (4, 8):
|
| 174 |
raise ValueError(f"Qwen3-32B supports T3K (8 devices) or P150x4 (4 devices), got {num_devices}")
|
| 175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
return tuple(length for length in candidates if length <= min(max_prefill_chunk_size, max_seq_len))
|
| 177 |
|
| 178 |
|
|
|
|
| 172 |
def _trace_seq_lens(num_devices: int, max_prefill_chunk_size: int, max_seq_len: int) -> tuple[int, ...]:
|
| 173 |
if num_devices not in (4, 8):
|
| 174 |
raise ValueError(f"Qwen3-32B supports T3K (8 devices) or P150x4 (4 devices), got {num_devices}")
|
| 175 |
+
# Every prefill shape the planner can emit: the 128/1024 padding buckets plus
|
| 176 |
+
# the power-of-two chunk sizes bounded by max_prefill_chunk_size (2048, 4096).
|
| 177 |
+
# A shape absent here is neither trace-eligible nor warmed, so under
|
| 178 |
+
# trace_mode="all" the first such prompt dies with TraceCoverageError (and
|
| 179 |
+
# under decode_only with "not compiled after trace activation"). See the
|
| 180 |
+
# planner: _padded_prefill_length rounds to 128/1024/next-pow2 and
|
| 181 |
+
# _max_prefill_chunk_size caps chunks at max_prefill_chunk_size.
|
| 182 |
+
candidates = (128, 1024, 2048, 4096)
|
| 183 |
return tuple(length for length in candidates if length <= min(max_prefill_chunk_size, max_seq_len))
|
| 184 |
|
| 185 |
|