make assume_32_bit_indexing configurable (#32044)
Signed-off-by: Laith Sakka <lsakka@meta.com>
This commit is contained in:
@@ -522,7 +522,9 @@ def _support_torch_compile(
|
|||||||
# assume_32bit_indexing is only available in torch 2.10.0.dev+
|
# assume_32bit_indexing is only available in torch 2.10.0.dev+
|
||||||
inductor_config_patches = {}
|
inductor_config_patches = {}
|
||||||
if is_torch_equal_or_newer("2.10.0.dev"):
|
if is_torch_equal_or_newer("2.10.0.dev"):
|
||||||
inductor_config_patches["assume_32bit_indexing"] = True
|
inductor_config_patches["assume_32bit_indexing"] = (
|
||||||
|
self.compilation_config.dynamic_shapes_config.assume_32_bit_indexing
|
||||||
|
)
|
||||||
|
|
||||||
with (
|
with (
|
||||||
patch.object(
|
patch.object(
|
||||||
|
|||||||
@@ -278,7 +278,11 @@ class DynamicShapesConfig:
|
|||||||
artifacts also.
|
artifacts also.
|
||||||
When type is backed, aot_compile must be disabled for this mode to work.
|
When type is backed, aot_compile must be disabled for this mode to work.
|
||||||
until this change picked up https://github.com/pytorch/pytorch/pull/169239.
|
until this change picked up https://github.com/pytorch/pytorch/pull/169239.
|
||||||
|
"""
|
||||||
|
|
||||||
|
assume_32_bit_indexing: bool = True
|
||||||
|
"""
|
||||||
|
whether all tensor sizes can use 32 bit indexing.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def compute_hash(self) -> str:
|
def compute_hash(self) -> str:
|
||||||
@@ -640,6 +644,7 @@ class CompilationConfig:
|
|||||||
"compilation_time",
|
"compilation_time",
|
||||||
"static_forward_context",
|
"static_forward_context",
|
||||||
"pass_config", # handled separately below
|
"pass_config", # handled separately below
|
||||||
|
"dynamic_shapes_config", # handled separately below
|
||||||
}
|
}
|
||||||
|
|
||||||
from vllm.config.utils import get_hash_factors, hash_factors
|
from vllm.config.utils import get_hash_factors, hash_factors
|
||||||
@@ -647,6 +652,7 @@ class CompilationConfig:
|
|||||||
factors = get_hash_factors(self, ignored_factors)
|
factors = get_hash_factors(self, ignored_factors)
|
||||||
|
|
||||||
factors["pass_config"] = self.pass_config.compute_hash()
|
factors["pass_config"] = self.pass_config.compute_hash()
|
||||||
|
factors["dynamic_shapes_config"] = self.dynamic_shapes_config.compute_hash()
|
||||||
return hash_factors(factors)
|
return hash_factors(factors)
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user