[AMD] Fix DeepSeek V4 MTP accuracy issue (#30333)
This commit is contained in:
@@ -129,6 +129,15 @@ class CompressStatePool:
|
|||||||
dtype=dtype, device=device, enable_memory_saver=enable_memory_saver
|
dtype=dtype, device=device, enable_memory_saver=enable_memory_saver
|
||||||
)
|
)
|
||||||
if not online:
|
if not online:
|
||||||
|
if _is_hip and ratio == 128:
|
||||||
|
# Request-scoped C128 state is addressed by req_pool_idx (or a
|
||||||
|
# per-request ring). The pool is allocated with torch.empty(),
|
||||||
|
# so a cold server can otherwise read uninitialized partial
|
||||||
|
# states before a request slot has been written for the first
|
||||||
|
# time. Initialize all C128 rows to the empty-state sentinel;
|
||||||
|
# C4 keeps the historical last-row sentinel behavior.
|
||||||
|
self.kv_score_buffer.clear()
|
||||||
|
else:
|
||||||
self.kv_score_buffer[-1].clear()
|
self.kv_score_buffer[-1].clear()
|
||||||
|
|
||||||
def _alloc_kv_score_buffer(
|
def _alloc_kv_score_buffer(
|
||||||
|
|||||||
Reference in New Issue
Block a user