mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
[aoti][win] add support for a list of shim libraries (#165914)
As title, support passing in a list of shim libraries when cross compiling artifacts Pull Request resolved: https://github.com/pytorch/pytorch/pull/165914 Approved by: https://github.com/desertfire
This commit is contained in:
parent
8daef35cf1
commit
16745a882a
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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, (
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user