ort icon indicating copy to clipboard operation
ort copied to clipboard

python -m torch_ort.configure fail

Open kimkeithvn opened this issue 1 year ago • 2 comments

it seems the length of filename result in this error. Here is the log. Any idea about solving the problem? thx

running build
running build_ext
building 'aten_op_executor' extension
Emitting ninja build file D:\python\Anaconda\envs\dl\lib\site-packages\onnxruntime\training\ortmodule\torch_cpp_extensions\build\temp.win-amd64-cpython-310\Release\build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
ninja: error: Stat(D:/python/Anaconda/envs/dl/lib/site-packages/onnxruntime/training/ortmodule/torch_cpp_extensions/build/temp.win-amd64-cpython-310/Release/python/Anaconda/envs/dl/lib/site-packages/onnxruntime/training/ortmodule/torch_cpp_extensions/cpu/aten_op_executor/aten_op_executor.obj): Filename longer than 260 characters
Traceback (most recent call last):
  File "D:\python\Anaconda\envs\dl\lib\site-packages\torch\utils\cpp_extension.py", line 1894, in _run_ninja_build
    subprocess.run(
  File "D:\python\Anaconda\envs\dl\lib\subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

kimkeithvn avatar Jul 25 '23 05:07 kimkeithvn

Not sure why the path is so long, the error reported is "ninja: error: Stat(D:/python/Anaconda/envs/dl/lib/site-packages/onnxruntime/training/ortmodule/torch_cpp_extensions/build/temp.win-amd64-cpython-310/Release/python/Anaconda/envs/dl/lib/site-packages/onnxruntime/training/ortmodule/torch_cpp_extensions/cpu/aten_op_executor/aten_op_executor.obj): Filename longer than 260 characters" Is that possible to shorten the python installation path?

pengwa avatar Apr 29 '24 03:04 pengwa

You can bypass this error by enabling long path name: Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name LongPathsEnabled -Type DWord -Value 1

However, you'll still bump into other issues since ORTModule does not support Windows for now.

AdamLouly avatar Apr 29 '24 16:04 AdamLouly