Compare commits

...

1 Commits

Author SHA1 Message Date
db7b9f8bee [aoti][win] add support for a list of shim libraries 2025-10-21 09:36:58 -07:00
2 changed files with 9 additions and 3 deletions

View File

@ -1670,7 +1670,7 @@ class aot_inductor:
# If link_libtorch is False and cross_target_platform is windows,
# a library needs to be provided to provide the shim implementations.
aoti_shim_library: Optional[str] = None
aoti_shim_library: Optional[str | list[str]] = None
aoti_shim_library_path: Optional[str] = None

View File

@ -1147,10 +1147,16 @@ def _get_torch_related_args(
else:
libraries_dirs = []
if config.aot_inductor.cross_target_platform == "windows":
assert config.aot_inductor.aoti_shim_library, (
aoti_shim_library = config.aot_inductor.aoti_shim_library
assert aoti_shim_library, (
"'config.aot_inductor.aoti_shim_library' must be set when 'cross_target_platform' is 'windows'."
)
libraries.append(config.aot_inductor.aoti_shim_library)
if isinstance(aoti_shim_library, str):
libraries.append(aoti_shim_library)
else:
assert isinstance(aoti_shim_library, list)
libraries.extend(aoti_shim_library)
if config.aot_inductor.cross_target_platform == "windows":
assert config.aot_inductor.aoti_shim_library_path, (