[ROCm][CI] Fix ROCm LoRA Transformers fallback with full CUDA graphs (#41577)

Signed-off-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
Andreas Karatzas
2026-05-23 04:31:32 +00:00
committed by GitHub
parent 84e351555a
commit d28bdf9344
4 changed files with 88 additions and 19 deletions
+1
View File
@@ -150,6 +150,7 @@ def rocm_unquantized_gemm_impl(
envs.VLLM_ROCM_USE_SKINNY_GEMM
and on_gfx950()
and x.dtype in [torch.float16, torch.bfloat16]
and x.dim() == 2
and (
10 <= n <= 128
and k % 8 == 0
@@ -16,7 +16,6 @@
# limitations under the License.
"""Transformers modeling backend base class."""
import sys
from collections.abc import Callable, Iterable
from itertools import chain
from operator import attrgetter
@@ -268,21 +267,11 @@ class Base(
dynamic_arg_dims,
)
@support_torch_compile(
support_torch_compile(
dynamic_arg_dims=dynamic_arg_dims,
enable_if=enable_if,
is_encoder=is_encoder,
)
class SupportTorchCompileWrapper(cls): ...
# Preserve __module__ so transformers v5's source-file checks
# (e.g. _can_set_experts_implementation) read the original
# model's module instead of this file.
SupportTorchCompileWrapper.__module__ = cls.__module__
# Patch the class in its module
module = sys.modules[cls.__module__]
setattr(module, cls.__name__, SupportTorchCompileWrapper)
)(cls)
def _decorate_for_torch_compile(self, **kwargs: dict):
"""