vllm.compilation.inductor_pass ¶
CallableInductorPass ¶
Bases: InductorPass
This class is a wrapper for a callable that automatically provides an implementation of the UUID.
Source code in vllm/compilation/inductor_pass.py
CustomGraphPass ¶
Bases: ABC
This class replaces CustomGraphPass from torch==2.6 when using torch<2.6. It conforms to the 2.6 interface but also supports pickling, as that's what the inductor code cache uses to determine the cache key before 2.6. (in 2.6 and above, uuid() is used.)
Subclasses can just "pretend" that uuid is used.
Source code in vllm/compilation/torch25_custom_graph_pass.py
__getstate__ ¶
__getstate__() -> Any | None
Pickling is used instead of uuid() in torch<2.6. Just return uuid() to enable subclasses to only have to implement uuid.
__setstate__ ¶
InductorPass ¶
Bases: Torch25CustomGraphPass
A custom graph pass that uses a hash of its source as the UUID. This is defined as a convenience and should work in most cases.
Source code in vllm/compilation/inductor_pass.py
hash_dict staticmethod ¶
Utility method to hash a dictionary, can alternatively be used for uuid. :return: A sha256 hash of the json rep of the dictionary.
Source code in vllm/compilation/inductor_pass.py
hash_source staticmethod ¶
Utility method to hash the sources of functions or objects. :param srcs: strings or objects to add to the hash. Objects and functions have their source inspected. :return:
Source code in vllm/compilation/inductor_pass.py
is_applicable_for_range ¶
PassContext ¶
Source code in vllm/compilation/inductor_pass.py
enable_fake_mode ¶
Applies a FakeTensorMode context. This is useful when you don't want to create or run things with real tensors.
Source code in vllm/compilation/inductor_pass.py
get_pass_context ¶
get_pass_context() -> PassContext
pass_context ¶
A context manager that stores the current pass context, usually it is a list of sizes to specialize.