@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 5a66c9cc76
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 9, 10:00 UTC

[ez] Delete torch25_custom_graph_pass (#33287)

Signed-off-by: angelayi <yiangela7@gmail.com>

Angela Yi committed Jan 29, 2026 at 08:47 UTC 5a66c9cc760958036ee3f71a78f548b19e89b984
1 file changed -44
vllm/compilation/torch25_custom_graph_pass.py deleted
-44
@@ -1,44 +0,0 @@
1 -# SPDX-License-Identifier: Apache-2.0
2 -# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3 -from abc import ABC, abstractmethod
4 -from typing import Any, NoReturn
5 -
6 -import torch
7 -
8 -
9 -class Torch25CustomGraphPass(ABC): # noqa (redefinition)
10 - """
11 - This class replaces CustomGraphPass from torch==2.6 when using torch<2.6.
12 - It conforms to the 2.6 interface but also supports pickling, as that's what
13 - the inductor code cache uses to determine the cache key before 2.6.
14 - (in 2.6 and above, uuid() is used.)
15 -
16 - Subclasses can just "pretend" that uuid is used.
17 - """
18 -
19 - @abstractmethod
20 - def __call__(self, graph: torch.fx.graph.Graph) -> None:
21 - """
22 - Implementation of the custom pass.
23 - """
24 -
25 - @abstractmethod
26 - def uuid(self) -> Any | None:
27 - """
28 - Return an ID to uniquely identify your custom pass implementation.
29 - Return None to skip inductor code caching entirely.
30 - """
31 -
32 - def __getstate__(self) -> Any | None:
33 - """
34 - Pickling is used instead of uuid() in torch<2.6. Just return uuid()
35 - to enable subclasses to only have to implement uuid.
36 - """
37 - return self.uuid()
38 -
39 - def __setstate__(self, state: Any) -> NoReturn:
40 - raise ValueError(
41 - "Cannot unpickle CustomGraphPass because pickling"
42 - " is used for cache key uuid. Use torch>=2.6 with"
43 - " native uuid support for custom passes."
44 - )