[AOTI XPU] Support AOT Inductor for Intel GPU. (#140269)

This PR add XPU support for AOT Inductor, and reuse the corresponding UT.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/140269
Approved by: https://github.com/desertfire, https://github.com/EikanWang
ghstack dependencies: #140268

Co-authored-by: Bin Bao <binbao@meta.com>
This commit is contained in:
Bin Bao
2024-12-09 13:59:19 -08:00
committed by PyTorch MergeBot
parent a1c6cf7e9f
commit 6680a83e89
17 changed files with 513 additions and 184 deletions

View File

@ -1531,7 +1531,9 @@ class AotCodeCompiler:
object_output_dir,
) = get_name_and_dir_from_output_file_path(consts_s)
object_build_options = CppTorchDeviceOptions(
device_type=device_type,
# Intel compiler failed to compile this manully constructed assembly file.
# it is ok to use gcc to compile the .S to a .o and linked with Intel comiler .
device_type=device_type if device_type != "xpu" else "cpu",
aot_mode=graph.aot_mode,
compile_only=True,
use_absolute_path=use_absolute_path,