Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

ratnampa
Copy link

@ratnampa ratnampa commented Nov 6, 2024

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

execute_process(COMMAND cmd /c mklink /D ${LinkPATH} ${TargetPATH})

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.

Copy link
Contributor

@EikanWang EikanWang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls. check the build failures.

execute_process(COMMAND cmd /c mklink /D ${LinkPATH} ${TargetPATH})
string(REPLACE "/" "\\" DestPATH "${CODEGEN_TEMPLATE}templates")
string(REPLACE "/" "\\" SrcPATH "${CMAKE_SOURCE_DIR}/aten/src/ATen/templates")
execute_process(COMMAND cmd /c xcopy ${SrcPATH} ${DestPATH} /E /H /C /I /Y > nul)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ratnampa , do you know why mklink did not impact the Windows build in the past?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EikanWang I am not sure why this wasn't an issue before, but seems that the admin privileges is the only issue. I have updated the code, it should pass CI, and copy should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants