intel / torch-xpu-ops

Apache License 2.0
30 stars 21 forks source link

[PT2.6][Windows] Fix Windows Codegen #1057

Closed ratnampa closed 5 days ago

ratnampa commented 2 weeks ago

Running codegen on windows is running into below error recently,

FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/sdp/ratnam-work/pytorch/third_party/torch-xpu-ops/yaml/templates\\RegisterDispatchDefinitions.ini'

This is caused due to this symlink command in windows not running a shell or cmd as an administrator https://github.com/intel/torch-xpu-ops/blob/b1582e14f9e27bcbc0666ff636389d2be61783e4/cmake/Codegen.cmake#L61

Also, when symlink is not performed due to access issues, cmake throws such error: You do not have sufficient privilege to perform this operation.

Resolution Change symlink to copy templates folder and delete it once codegen is complete.