[ROCm] Remove stale SDPA and skinny GEMM workarounds (#50907)
Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com> Signed-off-by: Andreas Karatzas <akaratza@amd.com> Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
co-authored by
OpenAI Codex
parent
4f2f31b82e
commit
1ab2801dde
@@ -619,8 +619,7 @@ def resolve_kv_cache_block_sizes(
|
||||
``cache_config.prefix_match_unit`` override if set, else the GCD of
|
||||
group block sizes; every group's block size must be divisible by it.
|
||||
Returns the scheduler block size (i.e. disables finer hashing) if block
|
||||
hashing is inactive or a mamba group's block size diverges from the
|
||||
cache block size (mamba_cache_mode != "align").
|
||||
hashing is inactive or a mamba group is not using cache mode "align".
|
||||
"""
|
||||
cache_config = vllm_config.cache_config
|
||||
dcp = vllm_config.parallel_config.decode_context_parallel_size
|
||||
|
||||
@@ -634,9 +634,11 @@ class SingleDirectionOffloadingHandler:
|
||||
else torch.Event(enable_timing=True)
|
||||
)
|
||||
|
||||
if self.gpu_to_cpu:
|
||||
# wait for model computation to finish before offloading
|
||||
stream.wait_stream(current_platform.current_stream())
|
||||
# Stores must wait for the model to finish writing the KV they read.
|
||||
# Loads must wait for pending writes (including zeroing) to their
|
||||
# destination blocks; otherwise an earlier transfer can be overwritten
|
||||
# by compute-stream work that was already queued when the load began.
|
||||
stream.wait_stream(current_platform.current_stream())
|
||||
if self._transfers:
|
||||
last_transfer: Transfer = self._transfers[-1]
|
||||
last_event = last_transfer.end_event
|
||||
|
||||
@@ -6420,6 +6420,21 @@ class GPUModelRunner(
|
||||
logits,
|
||||
dummy_metadata,
|
||||
)
|
||||
# All-greedy is a separate Triton specialization from the
|
||||
# mixed-sampling path above. Compile and exercise it before serving.
|
||||
all_greedy_metadata = replace(
|
||||
dummy_metadata,
|
||||
temperature=None,
|
||||
all_greedy=True,
|
||||
all_random=False,
|
||||
)
|
||||
self.rejection_sampler(
|
||||
dummy_spec_decode_metadata,
|
||||
draft_probs,
|
||||
logits,
|
||||
all_greedy_metadata,
|
||||
)
|
||||
torch.accelerator.synchronize()
|
||||
return sampler_output
|
||||
|
||||
def _dummy_pooler_run_task(
|
||||
@@ -6615,16 +6630,26 @@ class GPUModelRunner(
|
||||
@staticmethod
|
||||
@contextmanager
|
||||
def _freeze_gc():
|
||||
gc_was_enabled = gc.isenabled()
|
||||
gc.collect()
|
||||
should_freeze = not envs.VLLM_ENABLE_CUDAGRAPH_GC
|
||||
if should_freeze:
|
||||
gc.freeze()
|
||||
# A Triton kernel finalized during stream capture unloads its
|
||||
# module and invalidates the captured graph.
|
||||
gc.disable()
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
if should_freeze:
|
||||
gc.unfreeze()
|
||||
gc.collect()
|
||||
try:
|
||||
gc.unfreeze()
|
||||
gc.collect()
|
||||
finally:
|
||||
if gc_was_enabled:
|
||||
gc.enable()
|
||||
else:
|
||||
gc.disable()
|
||||
|
||||
def shutdown(self) -> None:
|
||||
"""Release GPU tensors (model weights, KV caches, workspace) so that
|
||||
|
||||
Reference in New Issue
Block a user