Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
763963aa
Unverified
Commit
763963aa
authored
Dec 13, 2025
by
Laith Sakka
Committed by
GitHub
Dec 13, 2025
Browse files
set assume_32bit_indexing and pass unbacked hints (#30459)
Signed-off-by:
Laith Sakka
<
lsakka@meta.com
>
parent
39cefbdf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
vllm/compilation/decorators.py
vllm/compilation/decorators.py
+22
-3
No files found.
vllm/compilation/decorators.py
View file @
763963aa
...
@@ -28,7 +28,7 @@ from vllm.config.compilation import DynamicShapesType
...
@@ -28,7 +28,7 @@ from vllm.config.compilation import DynamicShapesType
from
vllm.logger
import
init_logger
from
vllm.logger
import
init_logger
from
vllm.sequence
import
IntermediateTensors
from
vllm.sequence
import
IntermediateTensors
from
vllm.utils.import_utils
import
resolve_obj_by_qualname
from
vllm.utils.import_utils
import
resolve_obj_by_qualname
from
vllm.utils.torch_utils
import
supports_dynamo
from
vllm.utils.torch_utils
import
is_torch_equal_or_newer
,
supports_dynamo
from
.monitor
import
start_monitoring_torch_compile
from
.monitor
import
start_monitoring_torch_compile
...
@@ -316,7 +316,13 @@ def _support_torch_compile(
...
@@ -316,7 +316,13 @@ def _support_torch_compile(
def
_mark_dynamic_inputs
(
mod
,
type
,
*
args
,
**
kwargs
):
def
_mark_dynamic_inputs
(
mod
,
type
,
*
args
,
**
kwargs
):
def
mark_dynamic
(
arg
,
dims
):
def
mark_dynamic
(
arg
,
dims
):
if
type
==
DynamicShapesType
.
UNBACKED
:
if
type
==
DynamicShapesType
.
UNBACKED
:
torch
.
_dynamo
.
decorators
.
mark_unbacked
(
arg
,
dims
)
if
is_torch_equal_or_newer
(
"2.10.0.dev"
):
for
dim
in
dims
:
torch
.
_dynamo
.
decorators
.
mark_unbacked
(
arg
,
dim
,
hint_override
=
arg
.
size
()[
dim
]
)
else
:
torch
.
_dynamo
.
decorators
.
mark_unbacked
(
arg
,
dims
)
else
:
else
:
torch
.
_dynamo
.
mark_dynamic
(
arg
,
dims
)
torch
.
_dynamo
.
mark_dynamic
(
arg
,
dims
)
...
@@ -350,7 +356,13 @@ def _support_torch_compile(
...
@@ -350,7 +356,13 @@ def _support_torch_compile(
if
isinstance
(
arg
,
torch
.
Tensor
):
if
isinstance
(
arg
,
torch
.
Tensor
):
# In case dims is specified with negative indexing
# In case dims is specified with negative indexing
dims
=
[
arg
.
ndim
+
dim
if
dim
<
0
else
dim
for
dim
in
dims
]
dims
=
[
arg
.
ndim
+
dim
if
dim
<
0
else
dim
for
dim
in
dims
]
torch
.
_dynamo
.
decorators
.
mark_unbacked
(
arg
,
dims
)
if
is_torch_equal_or_newer
(
"2.10.0.dev"
):
for
dim
in
dims
:
torch
.
_dynamo
.
decorators
.
mark_unbacked
(
arg
,
dim
,
hint_override
=
arg
.
size
()[
dim
]
)
else
:
torch
.
_dynamo
.
decorators
.
mark_unbacked
(
arg
,
dims
)
def
__call__
(
self
,
*
args
,
**
kwargs
):
def
__call__
(
self
,
*
args
,
**
kwargs
):
# torch.compiler.is_compiling() means we are inside the compilation
# torch.compiler.is_compiling() means we are inside the compilation
...
@@ -488,6 +500,12 @@ def _support_torch_compile(
...
@@ -488,6 +500,12 @@ def _support_torch_compile(
if
ds_type
==
DynamicShapesType
.
BACKED_SIZE_OBLIVIOUS
:
if
ds_type
==
DynamicShapesType
.
BACKED_SIZE_OBLIVIOUS
:
fx_config_patches
[
"backed_size_oblivious"
]
=
True
fx_config_patches
[
"backed_size_oblivious"
]
=
True
# Prepare inductor config patches
# assume_32bit_indexing is only available in torch 2.10.0.dev+
inductor_config_patches
=
{}
if
is_torch_equal_or_newer
(
"2.10.0.dev"
):
inductor_config_patches
[
"assume_32bit_indexing"
]
=
True
with
(
with
(
patch
.
object
(
patch
.
object
(
InliningInstructionTranslator
,
"inline_call_"
,
patched_inline_call
InliningInstructionTranslator
,
"inline_call_"
,
patched_inline_call
...
@@ -496,6 +514,7 @@ def _support_torch_compile(
...
@@ -496,6 +514,7 @@ def _support_torch_compile(
maybe_use_cudagraph_partition_wrapper
(
self
.
vllm_config
),
maybe_use_cudagraph_partition_wrapper
(
self
.
vllm_config
),
torch
.
fx
.
experimental
.
_config
.
patch
(
**
fx_config_patches
),
torch
.
fx
.
experimental
.
_config
.
patch
(
**
fx_config_patches
),
_torch27_patch_tensor_subclasses
(),
_torch27_patch_tensor_subclasses
(),
torch
.
_inductor
.
config
.
patch
(
**
inductor_config_patches
),
):
):
if
envs
.
VLLM_USE_AOT_COMPILE
:
if
envs
.
VLLM_USE_AOT_COMPILE
:
self
.
aot_compiled_fn
=
self
.
aot_compile
(
*
args
,
**
kwargs
)
self
.
aot_compiled_fn
=
self
.
aot_compile
(
*
args
,
**
kwargs
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment