woct0rdho / triton-windows

Fork of the Triton language and compiler for Windows support
MIT License
183 stars 9 forks source link

ReadFile: The handle is invalid. #2

Closed osadchi closed 1 month ago

osadchi commented 1 month ago

Thank you for your effort, I'm trying to build with your guide, I've tried both 3.0.0 and the 'main' branch. Both the same error. Llvm getting with hash in repo. https://github.com/llvm/llvm-project/tree/61f8a7f618901797ee8663389a29722f29216a96 this is my environment

$Env:Path =
"C:\Users\user\AppData\Local\Programs\Python\Python310;" +
"C:\Users\user\AppData\Local\Programs\Python\Python310\Scripts;" +
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;" +
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.41.34120\bin\Hostx64\x64;" +
"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64"
$Env:INCLUDE =
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.41.34120\include;" +
"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared;" +
"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt;" +
"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\um;" +
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include;" +
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\extras\CUPTI\include"
$Env:LIB =
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.41.34120\lib\x64;" +
"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\ucrt\x64;" +
"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\x64"
$Env:LLVM_SYSPATH = "C:/llvm-project/build/"
$Env:LLVM_INCLUDE_DIRS = "C:/llvm-project/build/include"
$Env:LLVM_LIBRARY_DIR = "C:/llvm-project/build/lib"
$Env:JSON_SYSPATH = "C:/json"
$Env:PYBIND11_SYSPATH = "C:/pybind11"
$Env:TRITON_OFFLINE_BUILD = "1"
$Env:TRITON_BUILD_WITH_CCACHE = "1"
$Env:SETUPTOOLS_ENABLE_FEATURES="legacy-editable"
PS C:\triton> pip install -e python --verbose
Using pip 22.3.1 from C:\Users\user\AppData\Local\Programs\Python\Python310\lib\site-packages\pip (python 3.10)
Obtaining file:///C:/triton/python
  Running command pip subprocess to install build dependencies
  Collecting setuptools>=40.8.0
    Using cached setuptools-75.1.0-py3-none-any.whl (1.2 MB)
  Collecting wheel
    Using cached wheel-0.44.0-py3-none-any.whl (67 kB)
  Collecting cmake>=3.18
    Using cached cmake-3.30.4-py3-none-win_amd64.whl (35.6 MB)
  Collecting ninja>=1.11.1
    Using cached ninja-1.11.1.1-py2.py3-none-win_amd64.whl (312 kB)
  Collecting pybind11>=2.13.1
    Using cached pybind11-2.13.6-py3-none-any.whl (243 kB)
  Installing collected packages: ninja, wheel, setuptools, pybind11, cmake
  Successfully installed cmake-3.30.4 ninja-1.11.1.1 pybind11-2.13.6 setuptools-75.1.0 wheel-0.44.0

  [notice] A new release of pip available: 22.3.1 -> 24.2
  [notice] To update, run: python.exe -m pip install --upgrade pip
  Installing build dependencies ... done
  Running command Checking if build backend supports build_editable
  Checking if build backend supports build_editable ... done
  Running command Getting requirements to build wheel
  C:\Users\user\AppData\Local\Temp\pip-build-env-1_rb0bor\overlay\Lib\site-packages\setuptools\_distutils\dist.py:261: UserWarning: Unknown distribution option: 'test_suite'
    warnings.warn(msg)
  running egg_info
  writing triton.egg-info\PKG-INFO
  writing dependency_links to triton.egg-info\dependency_links.txt
  writing entry points to triton.egg-info\entry_points.txt
  writing requirements to triton.egg-info\requires.txt
  writing top-level names to triton.egg-info\top_level.txt
  reading manifest file 'triton.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'triton.egg-info\SOURCES.txt'
  Getting requirements to build wheel ... done
  Running command Preparing metadata (pyproject.toml)
  C:\Users\user\AppData\Local\Temp\pip-build-env-1_rb0bor\overlay\Lib\site-packages\setuptools\_distutils\dist.py:261: UserWarning: Unknown distribution option: 'test_suite'
    warnings.warn(msg)
  running dist_info
  creating C:\Users\user\AppData\Local\Temp\pip-modern-metadata-yro8t2e1\triton.egg-info
  writing C:\Users\user\AppData\Local\Temp\pip-modern-metadata-yro8t2e1\triton.egg-info\PKG-INFO
  writing dependency_links to C:\Users\user\AppData\Local\Temp\pip-modern-metadata-yro8t2e1\triton.egg-info\dependency_links.txt
  writing entry points to C:\Users\user\AppData\Local\Temp\pip-modern-metadata-yro8t2e1\triton.egg-info\entry_points.txt
  writing requirements to C:\Users\user\AppData\Local\Temp\pip-modern-metadata-yro8t2e1\triton.egg-info\requires.txt
  writing top-level names to C:\Users\user\AppData\Local\Temp\pip-modern-metadata-yro8t2e1\triton.egg-info\top_level.txt
  writing manifest file 'C:\Users\user\AppData\Local\Temp\pip-modern-metadata-yro8t2e1\triton.egg-info\SOURCES.txt'
  reading manifest file 'C:\Users\user\AppData\Local\Temp\pip-modern-metadata-yro8t2e1\triton.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'C:\Users\user\AppData\Local\Temp\pip-modern-metadata-yro8t2e1\triton.egg-info\SOURCES.txt'
  creating 'C:\Users\user\AppData\Local\Temp\pip-modern-metadata-yro8t2e1\triton-3.0.0.dist-info'
  Preparing metadata (pyproject.toml) ... done
Installing collected packages: triton
  Running setup.py develop for triton
    Running command python setup.py develop
    C:\Users\user\AppData\Local\Temp\pip-build-env-1_rb0bor\overlay\Lib\site-packages\setuptools\_distutils\dist.py:261: UserWarning: Unknown distribution option: 'test_suite'
      warnings.warn(msg)
    running develop
    C:\Users\user\AppData\Local\Temp\pip-build-env-1_rb0bor\overlay\Lib\site-packages\setuptools\command\develop.py:41: EasyInstallDeprecationWarning: easy_install command is deprecated.
    !!

            ********************************************************************************
            Please avoid running ``setup.py`` and ``easy_install``.
            Instead, use pypa/build, pypa/installer or other
            standards-based tools.

            See https://github.com/pypa/setuptools/issues/917 for details.
            ********************************************************************************

    !!
      easy_install.initialize_options(self)
    running egg_info
    writing triton.egg-info\PKG-INFO
    writing dependency_links to triton.egg-info\dependency_links.txt
    writing entry points to triton.egg-info\entry_points.txt
    writing requirements to triton.egg-info\requires.txt
    writing top-level names to triton.egg-info\top_level.txt
    reading manifest file 'triton.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'triton.egg-info\SOURCES.txt'
    running build_ext
    CMake Deprecation Warning at CMakeLists.txt:6 (cmake_policy):
      The OLD behavior for policy CMP0116 will be removed from a future version
      of CMake.

      The cmake-policies(7) manual explains that the OLD behaviors of all
      policies are deprecated and that a policy should be set to OLD only under
      specific short-term circumstances.  Projects should be ported to the NEW
      behavior and not rely on setting a policy to OLD.

    -- Adding Python module
    -- CUPTI lib directory: C:/triton/third_party/nvidia/backend/lib/cupti
    -- Triton backends tuple: nvidia,amd
    -- Configuring done (1.4s)
    -- Generating done (0.9s)
    -- Build files have been written to: C:/triton/python/build/cmake.win-amd64-cpython-3.10
    Change Dir: 'C:/triton/python/build/cmake.win-amd64-cpython-3.10'

    Run Build Command(s): C:\Users\user\AppData\Local\Temp\pip-build-env-1_rb0bor\overlay\Scripts\ninja.EXE -v
    [1/198] ccache C:\PROGRA~2\MICROS~2\2022\BUILDT~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe   /TP -DGTEST_HAS_RTTI=0 -D_HAS_EXCEPTIONS=0 -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\lib\Dialect\Triton\IR -IC:\triton\lib\Dialect\Triton\IR -IC:\triton\include -IC:\triton\. -IC:\llvm-project\mlir\include -IC:\llvm-project\build\tools\mlir\include -IC:\llvm-project\llvm\include -IC:\llvm-project\build\include -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\include -IC:\triton\third_party -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\third_party /DWIN32 /D_WINDOWS /GR /EHsc /nologo /Zc:__STDC__ /Zc:preprocessor /wd4244 /wd4624 /wd4819 /WX /O2 -std:c++17 -MD  /EHs-c- /GR- /showIncludes /Folib\Dialect\Triton\IR\CMakeFiles\TritonIR.dir\Dialect.cpp.obj /Fdlib\Dialect\Triton\IR\CMakeFiles\TritonIR.dir\ /FS -c C:\triton\lib\Dialect\Triton\IR\Dialect.cpp
    FAILED: lib/Dialect/Triton/IR/CMakeFiles/TritonIR.dir/Dialect.cpp.obj
    ccache C:\PROGRA~2\MICROS~2\2022\BUILDT~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe   /TP -DGTEST_HAS_RTTI=0 -D_HAS_EXCEPTIONS=0 -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\lib\Dialect\Triton\IR -IC:\triton\lib\Dialect\Triton\IR -IC:\triton\include -IC:\triton\. -IC:\llvm-project\mlir\include -IC:\llvm-project\build\tools\mlir\include -IC:\llvm-project\llvm\include -IC:\llvm-project\build\include -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\include -IC:\triton\third_party -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\third_party /DWIN32 /D_WINDOWS /GR /EHsc /nologo /Zc:__STDC__ /Zc:preprocessor /wd4244 /wd4624 /wd4819 /WX /O2 -std:c++17 -MD  /EHs-c- /GR- /showIncludes /Folib\Dialect\Triton\IR\CMakeFiles\TritonIR.dir\Dialect.cpp.obj /Fdlib\Dialect\Triton\IR\CMakeFiles\TritonIR.dir\ /FS -c C:\triton\lib\Dialect\Triton\IR\Dialect.cpp
    CreateProcess failed: The system cannot find the file specified.
    [2/198] ccache C:\PROGRA~2\MICROS~2\2022\BUILDT~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe   /TP -DGTEST_HAS_RTTI=0 -D_HAS_EXCEPTIONS=0 -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\lib\Dialect\Triton\IR -IC:\triton\lib\Dialect\Triton\IR -IC:\triton\include -IC:\triton\. -IC:\llvm-project\mlir\include -IC:\llvm-project\build\tools\mlir\include -IC:\llvm-project\llvm\include -IC:\llvm-project\build\include -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\include -IC:\triton\third_party -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\third_party /DWIN32 /D_WINDOWS /GR /EHsc /nologo /Zc:__STDC__ /Zc:preprocessor /wd4244 /wd4624 /wd4819 /WX /O2 -std:c++17 -MD  /EHs-c- /GR- /showIncludes /Folib\Dialect\Triton\IR\CMakeFiles\TritonIR.dir\Ops.cpp.obj /Fdlib\Dialect\Triton\IR\CMakeFiles\TritonIR.dir\ /FS -c C:\triton\lib\Dialect\Triton\IR\Ops.cpp
    FAILED: lib/Dialect/Triton/IR/CMakeFiles/TritonIR.dir/Ops.cpp.obj
    ccache C:\PROGRA~2\MICROS~2\2022\BUILDT~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe   /TP -DGTEST_HAS_RTTI=0 -D_HAS_EXCEPTIONS=0 -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\lib\Dialect\Triton\IR -IC:\triton\lib\Dialect\Triton\IR -IC:\triton\include -IC:\triton\. -IC:\llvm-project\mlir\include -IC:\llvm-project\build\tools\mlir\include -IC:\llvm-project\llvm\include -IC:\llvm-project\build\include -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\include -IC:\triton\third_party -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\third_party /DWIN32 /D_WINDOWS /GR /EHsc /nologo /Zc:__STDC__ /Zc:preprocessor /wd4244 /wd4624 /wd4819 /WX /O2 -std:c++17 -MD  /EHs-c- /GR- /showIncludes /Folib\Dialect\Triton\IR\CMakeFiles\TritonIR.dir\Ops.cpp.obj /Fdlib\Dialect\Triton\IR\CMakeFiles\TritonIR.dir\ /FS -c C:\triton\lib\Dialect\Triton\IR\Ops.cpp
    CreateProcess failed: The system cannot find the file specified.
    [3/198] ccache C:\PROGRA~2\MICROS~2\2022\BUILDT~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe   /TP -DGTEST_HAS_RTTI=0 -D_HAS_EXCEPTIONS=0 -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\lib\Dialect\Triton\IR -IC:\triton\lib\Dialect\Triton\IR -IC:\triton\include -IC:\triton\. -IC:\llvm-project\mlir\include -IC:\llvm-project\build\tools\mlir\include -IC:\llvm-project\llvm\include -IC:\llvm-project\build\include -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\include -IC:\triton\third_party -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\third_party /DWIN32 /D_WINDOWS /GR /EHsc /nologo /Zc:__STDC__ /Zc:preprocessor /wd4244 /wd4624 /wd4819 /WX /O2 -std:c++17 -MD  /EHs-c- /GR- /showIncludes /Folib\Dialect\Triton\IR\CMakeFiles\TritonIR.dir\Traits.cpp.obj /Fdlib\Dialect\Triton\IR\CMakeFiles\TritonIR.dir\ /FS -c C:\triton\lib\Dialect\Triton\IR\Traits.cpp
    FAILED: lib/Dialect/Triton/IR/CMakeFiles/TritonIR.dir/Traits.cpp.obj
    ccache C:\PROGRA~2\MICROS~2\2022\BUILDT~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe   /TP -DGTEST_HAS_RTTI=0 -D_HAS_EXCEPTIONS=0 -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\lib\Dialect\Triton\IR -IC:\triton\lib\Dialect\Triton\IR -IC:\triton\include -IC:\triton\. -IC:\llvm-project\mlir\include -IC:\llvm-project\build\tools\mlir\include -IC:\llvm-project\llvm\include -IC:\llvm-project\build\include -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\include -IC:\triton\third_party -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\third_party /DWIN32 /D_WINDOWS /GR /EHsc /nologo /Zc:__STDC__ /Zc:preprocessor /wd4244 /wd4624 /wd4819 /WX /O2 -std:c++17 -MD  /EHs-c- /GR- /showIncludes /Folib\Dialect\Triton\IR\CMakeFiles\TritonIR.dir\Traits.cpp.obj /Fdlib\Dialect\Triton\IR\CMakeFiles\TritonIR.dir\ /FS -c C:\triton\lib\Dialect\Triton\IR\Traits.cpp
    CreateProcess failed: The system cannot find the file specified.
    [4/198] ccache C:\PROGRA~2\MICROS~2\2022\BUILDT~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe   /TP -DGTEST_HAS_RTTI=0 -D_HAS_EXCEPTIONS=0 -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\lib\Dialect\Triton\IR -IC:\triton\lib\Dialect\Triton\IR -IC:\triton\include -IC:\triton\. -IC:\llvm-project\mlir\include -IC:\llvm-project\build\tools\mlir\include -IC:\llvm-project\llvm\include -IC:\llvm-project\build\include -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\include -IC:\triton\third_party -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\third_party /DWIN32 /D_WINDOWS /GR /EHsc /nologo /Zc:__STDC__ /Zc:preprocessor /wd4244 /wd4624 /wd4819 /WX /O2 -std:c++17 -MD  /EHs-c- /GR- /showIncludes /Folib\Dialect\Triton\IR\CMakeFiles\TritonIR.dir\Types.cpp.obj /Fdlib\Dialect\Triton\IR\CMakeFiles\TritonIR.dir\ /FS -c C:\triton\lib\Dialect\Triton\IR\Types.cpp
    FAILED: lib/Dialect/Triton/IR/CMakeFiles/TritonIR.dir/Types.cpp.obj
    ccache C:\PROGRA~2\MICROS~2\2022\BUILDT~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe   /TP -DGTEST_HAS_RTTI=0 -D_HAS_EXCEPTIONS=0 -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\lib\Dialect\Triton\IR -IC:\triton\lib\Dialect\Triton\IR -IC:\triton\include -IC:\triton\. -IC:\llvm-project\mlir\include -IC:\llvm-project\build\tools\mlir\include -IC:\llvm-project\llvm\include -IC:\llvm-project\build\include -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\include -IC:\triton\third_party -IC:\triton\python\build\cmake.win-amd64-cpython-3.10\third_party /DWIN32 /D_WINDOWS /GR /EHsc /nologo /Zc:__STDC__ /Zc:preprocessor /wd4244 /wd4624 /wd4819 /WX /O2 -std:c++17 -MD  /EHs-c- /GR- /showIncludes /Folib\Dialect\Triton\IR\CMakeFiles\TritonIR.dir\Types.cpp.obj /Fdlib\Dialect\Triton\IR\CMakeFiles\TritonIR.dir\ /FS -c C:\triton\lib\Dialect\Triton\IR\Types.cpp
    CreateProcess failed: The system cannot find the file specified.
    [5/198] C:\WINDOWS\system32\cmd.exe /C "cd /D C:\triton\python\build\cmake.win-amd64-cpython-3.10 && C:\llvm-project\build\bin\mlir-tblgen.exe -gen-enum-defs -I C:/triton/include/triton/Dialect/TritonGPU/IR -IC:/triton/include -IC:/triton/. -IC:/llvm-project/mlir/include -IC:/llvm-project/build/tools/mlir/include -IC:/llvm-project/llvm/include -IC:/llvm-project/build/include -IC:/triton/include -IC:/triton/python/build/cmake.win-amd64-cpython-3.10/include -IC:/triton/third_party -IC:/triton/python/build/cmake.win-amd64-cpython-3.10/third_party C:/triton/include/triton/Dialect/TritonGPU/IR/TritonGPUAttrDefs.td --write-if-changed -o include/triton/Dialect/TritonGPU/IR/OpsEnums.cpp.inc -d include/triton/Dialect/TritonGPU/IR/OpsEnums.cpp.inc.d"
    [6/198] C:\WINDOWS\system32\cmd.exe /C "cd /D C:\triton\python\build\cmake.win-amd64-cpython-3.10 && C:\llvm-project\build\bin\mlir-tblgen.exe -gen-enum-decls -I C:/triton/include/triton/Dialect/TritonGPU/IR -IC:/triton/include -IC:/triton/. -IC:/llvm-project/mlir/include -IC:/llvm-project/build/tools/mlir/include -IC:/llvm-project/llvm/include -IC:/llvm-project/build/include -IC:/triton/include -IC:/triton/python/build/cmake.win-amd64-cpython-3.10/include -IC:/triton/third_party -IC:/triton/python/build/cmake.win-amd64-cpython-3.10/third_party C:/triton/include/triton/Dialect/TritonGPU/IR/TritonGPUAttrDefs.td --write-if-changed -o include/triton/Dialect/TritonGPU/IR/OpsEnums.h.inc -d include/triton/Dialect/TritonGPU/IR/OpsEnums.h.inc.d"
    [7/198] C:\WINDOWS\system32\cmd.exe /C "cd /D C:\triton\python\build\cmake.win-amd64-cpython-3.10 && C:\llvm-project\build\bin\mlir-tblgen.exe -gen-attrdef-defs -I C:/triton/include/triton/Dialect/TritonGPU/IR -IC:/triton/include -IC:/triton/. -IC:/llvm-project/mlir/include -IC:/llvm-project/build/tools/mlir/include -IC:/llvm-project/llvm/include -IC:/llvm-project/build/include -IC:/triton/include -IC:/triton/python/build/cmake.win-amd64-cpython-3.10/include -IC:/triton/third_party -IC:/triton/python/build/cmake.win-amd64-cpython-3.10/third_party C:/triton/include/triton/Dialect/TritonGPU/IR/TritonGPUAttrDefs.td --write-if-changed -o include/triton/Dialect/TritonGPU/IR/TritonGPUAttrDefs.cpp.inc -d include/triton/Dialect/TritonGPU/IR/TritonGPUAttrDefs.cpp.inc.d"
    [8/198] C:\WINDOWS\system32\cmd.exe /C "cd /D C:\triton\python\build\cmake.win-amd64-cpython-3.10 && C:\llvm-project\build\bin\mlir-tblgen.exe -gen-attrdef-decls -I C:/triton/include/triton/Dialect/TritonGPU/IR -IC:/triton/include -IC:/triton/. -IC:/llvm-project/mlir/include -IC:/llvm-project/build/tools/mlir/include -IC:/llvm-project/llvm/include -IC:/llvm-project/build/include -IC:/triton/include -IC:/triton/python/build/cmake.win-amd64-cpython-3.10/include -IC:/triton/third_party -IC:/triton/python/build/cmake.win-amd64-cpython-3.10/third_party C:/triton/include/triton/Dialect/TritonGPU/IR/TritonGPUAttrDefs.td --write-if-changed -o include/triton/Dialect/TritonGPU/IR/TritonGPUAttrDefs.h.inc -d include/triton/Dialect/TritonGPU/IR/TritonGPUAttrDefs.h.inc.d"
    [9/198] C:\WINDOWS\system32\cmd.exe /C "cd /D C:\triton\python\build\cmake.win-amd64-cpython-3.10 && C:\llvm-project\build\bin\mlir-tblgen.exe -gen-attr-interface-defs -I C:/triton/include/triton/Dialect/TritonGPU/IR -IC:/triton/include -IC:/triton/. -IC:/llvm-project/mlir/include -IC:/llvm-project/build/tools/mlir/include -IC:/llvm-project/llvm/include -IC:/llvm-project/build/include -IC:/triton/include -IC:/triton/python/build/cmake.win-amd64-cpython-3.10/include -IC:/triton/third_party -IC:/triton/python/build/cmake.win-amd64-cpython-3.10/third_party C:/triton/include/triton/Dialect/TritonGPU/IR/TritonGPUAttrDefs.td --write-if-changed -o include/triton/Dialect/TritonGPU/IR/TritonGPUAttrInterfaces.cpp.inc -d include/triton/Dialect/TritonGPU/IR/TritonGPUAttrInterfaces.cpp.inc.d"
    [10/198] C:\WINDOWS\system32\cmd.exe /C "cd /D C:\triton\python\build\cmake.win-amd64-cpython-3.10 && C:\llvm-project\build\bin\mlir-tblgen.exe -gen-attr-interface-decls -I C:/triton/include/triton/Dialect/TritonGPU/IR -IC:/triton/include -IC:/triton/. -IC:/llvm-project/mlir/include -IC:/llvm-project/build/tools/mlir/include -IC:/llvm-project/llvm/include -IC:/llvm-project/build/include -IC:/tninja: fatal: ReadFile: The handle is invalid.

    riton/include -IC:/triton/python/build/cmake.win-amd64-cpython-3.10/include -IC:/triton/third_party -IC:/triton/python/build/cmake.win-amd64-cpython-3.10/third_party C:/triton/include/triton/Dialect/TritonGPU/IR/TritonGPUAttrDefs.td --write-if-changed -o include/triton/Dialect/TritonGPU/IR/TritonGPUAttrInterfaces.h.inc -d include/triton/Dialect/TritonGPU/IR/TritonGPUAttrInterfaces.h.inc.d"

    Traceback (most recent call last):
      File "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 34, in <module>
      File "C:\triton\python\setup.py", line 695, in <module>
        setup(
      File "C:\Users\user\AppData\Local\Temp\pip-build-env-1_rb0bor\overlay\Lib\site-packages\setuptools\__init__.py", line 117, in setup
        return distutils.core.setup(**attrs)
      File "C:\Users\user\AppData\Local\Temp\pip-build-env-1_rb0bor\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 183, in setup
        return run_commands(dist)
      File "C:\Users\user\AppData\Local\Temp\pip-build-env-1_rb0bor\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 199, in run_commands
        dist.run_commands()
      File "C:\Users\user\AppData\Local\Temp\pip-build-env-1_rb0bor\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 954, in run_commands
        self.run_command(cmd)
      File "C:\Users\user\AppData\Local\Temp\pip-build-env-1_rb0bor\overlay\Lib\site-packages\setuptools\dist.py", line 950, in run_command
        super().run_command(command)
      File "C:\Users\user\AppData\Local\Temp\pip-build-env-1_rb0bor\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command
        cmd_obj.run()
      File "C:\triton\python\setup.py", line 613, in run
        develop.run(self)
      File "C:\Users\user\AppData\Local\Temp\pip-build-env-1_rb0bor\overlay\Lib\site-packages\setuptools\command\develop.py", line 35, in run
        self.install_for_development()
      File "C:\Users\user\AppData\Local\Temp\pip-build-env-1_rb0bor\overlay\Lib\site-packages\setuptools\command\develop.py", line 112, in install_for_development
        self.run_command('build_ext')
      File "C:\Users\user\AppData\Local\Temp\pip-build-env-1_rb0bor\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
        self.distribution.run_command(command)
      File "C:\Users\user\AppData\Local\Temp\pip-build-env-1_rb0bor\overlay\Lib\site-packages\setuptools\dist.py", line 950, in run_command
        super().run_command(command)
      File "C:\Users\user\AppData\Local\Temp\pip-build-env-1_rb0bor\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command
        cmd_obj.run()
      File "C:\triton\python\setup.py", line 373, in run
        self.build_extension(ext)
      File "C:\triton\python\setup.py", line 486, in build_extension
        subprocess.check_call(["cmake", "--build", "."] + build_args, cwd=cmake_dir)
      File "C:\Users\user\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'TritonRelBuildWithAsserts']' returned non-zero exit status 1.
    LLVM pre-compiled image is not available for Windows-AMD64. Proceeding with user-configured LLVM from source build.
    error: subprocess-exited-with-error

    × python setup.py develop did not run successfully.
    │ exit code: 1
    ╰─> See above for output.

    note: This error originates from a subprocess, and is likely not a problem with pip.
    full command: 'C:\Users\user\AppData\Local\Programs\Python\Python310\python.exe' -c '
    exec(compile('"'"''"'"''"'"'
    # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
    #
    # - It imports setuptools before invoking setup.py, to enable projects that directly
    #   import from `distutils.core` to work with newer packaging standards.
    # - It provides a clear error message when setuptools is not installed.
    # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
    #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
    #     manifest_maker: standard file '"'"'-c'"'"' not found".
    # - It generates a shim setup.py, for handling setup.cfg-only projects.
    import os, sys, tokenize

    try:
        import setuptools
    except ImportError as error:
        print(
            "ERROR: Can not execute `setup.py` since setuptools is not available in "
            "the build environment.",
            file=sys.stderr,
        )
        sys.exit(1)

    __file__ = %r
    sys.argv[0] = __file__

    if os.path.exists(__file__):
        filename = __file__
        with tokenize.open(__file__) as f:
            setup_py_code = f.read()
    else:
        filename = "<auto-generated setuptools caller>"
        setup_py_code = "from setuptools import setup; setup()"

    exec(compile(setup_py_code, filename, "exec"))
    '"'"''"'"''"'"' % ('"'"'C:\\triton\\python\\setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' develop --no-deps
    cwd: C:\triton\python\
error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
FurkanGozukara commented 1 month ago

it is super hard to self compile i hope pre compiled wheels get published for python 3.10 and 3.11

osadchi commented 1 month ago

it is super hard to self compile i hope pre compiled wheels get published for python 3.10 and 3.11

But there's 2.0.0 and 2.1.0 is this too old?

FurkanGozukara commented 1 month ago

it is super hard to self compile i hope pre compiled wheels get published for python 3.10 and 3.11

But there's 2.0.0 and 2.1.0 is this too old?

yes we need 3.0

osadchi commented 1 month ago

it is super hard to self compile i hope pre compiled wheels get published for python 3.10 and 3.11

But there's 2.0.0 and 2.1.0 is this too old?

yes we need 3.0

I think I'm on the right way, but cant clearly see what's the point of the error. May be its llvm incompatible with current triton :C

osadchi commented 1 month ago

wsl> > > it is super hard to self compile i hope pre compiled wheels get published for python 3.10 and 3.11

But there's 2.0.0 and 2.1.0 is this too old?

yes we need 3.0

https://github.com/jakaline-dev/Triton_win/releases/tag/3.0.0

Did you try this ones? I have an error with this module

    from triton.language.extra import libdevice
ImportError: cannot import name 'libdevice' from 'triton.language.extra'
osadchi commented 1 month ago

After all so far, I can successfully run llamafactory It loads the model and can run good. But I still cant fine-tune it

Getting this error from jit it calls wrong attribute?!

10/17/2024 02:15:19 - INFO - llamafactory.model.model_utils.checkpointing - Gradient checkpointing enabled.
10/17/2024 02:15:19 - INFO - llamafactory.model.adapter - Upcasting trainable params to float32.
10/17/2024 02:15:19 - INFO - llamafactory.model.adapter - Fine-tuning method: LoRA
10/17/2024 02:15:19 - INFO - llamafactory.model.model_utils.misc - Found linear modules: o_proj,down_proj,up_proj,k_proj,q_proj,gate_proj,v_proj
[WARNING|logging.py:328] 2024-10-17 02:15:21,142 >> Unsloth 2024.7 patched 32 layers with 32 QKV layers, 32 O layers and 32 MLP layers.
10/17/2024 02:15:22 - INFO - llamafactory.model.loader - trainable params: 20,971,520 || all params: 8,051,232,768 || trainable%: 0.2605
[INFO|trainer.py:642] 2024-10-17 02:15:22,197 >> Using auto half precision backend
[WARNING|<string>:223] 2024-10-17 02:15:22,472 >> ==((====))==  Unsloth - 2x faster free finetuning | Num GPUs = 1
   \\   /|    Num examples = 1 | Num Epochs = 1
O^O/ \_/ \    Batch size per device = 1 | Gradient Accumulation steps = 8
\        /    Total batch size = 8 | Total steps = 1
 "-____-"     Number of trainable parameters = 20,971,520
  0%|                                                                                            | 0/1 [00:00<?, ?it/s]ptxas info    : 11 bytes gmem
ptxas info    : Compiling entry function '_rms_layernorm_forward' for 'sm_86'
ptxas info    : Function properties for _rms_layernorm_forward
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Used 40 registers, 408 bytes cmem[0]
ptxas info    : 0 bytes gmem
ptxas info    : Compiling entry function '_fg_kernel' for 'sm_86'
ptxas info    : Function properties for _fg_kernel
    0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads
ptxas info    : Used 30 registers, 380 bytes cmem[0]
Traceback (most recent call last):
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\Scripts\llamafactory-cli.exe\__main__.py", line 7, in <module>
    sys.exit(main())
  File "C:\LLaMA-Factory\src\llamafactory\cli.py", line 111, in main
    run_exp()
  File "C:\LLaMA-Factory\src\llamafactory\train\tuner.py", line 50, in run_exp
    run_sft(model_args, data_args, training_args, finetuning_args, generating_args, callbacks)
  File "C:\LLaMA-Factory\src\llamafactory\train\sft\workflow.py", line 96, in run_sft
    train_result = trainer.train(resume_from_checkpoint=training_args.resume_from_checkpoint)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\transformers\trainer.py", line 1932, in train
    return inner_training_loop(
  File "<string>", line 367, in _fast_inner_training_loop
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\transformers\trainer.py", line 3307, in training_step
    loss = self.compute_loss(model, inputs)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\transformers\trainer.py", line 3338, in compute_loss
    outputs = model(**inputs)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\accelerate\utils\operations.py", line 820, in forward
    return model_forward(*args, **kwargs)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\accelerate\utils\operations.py", line 808, in __call__
    return convert_to_fp32(self.model_forward(*args, **kwargs))
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\torch\amp\autocast_mode.py", line 16, in decorate_autocast
    return func(*args, **kwargs)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\unsloth\models\llama.py", line 930, in PeftModelForCausalLM_fast_forward
    return self.base_model(
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
    return forward_call(*args, **kwargs)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\peft\tuners\tuners_utils.py", line 179, in forward
    return self.model.forward(*args, **kwargs)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\unsloth\models\llama.py", line 890, in _CausalLM_fast_forward
    loss = fast_cross_entropy_loss(
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\unsloth\kernels\cross_entropy_loss.py", line 317, in fast_cross_entropy_loss
    loss = Fast_CrossEntropyLoss.apply(
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\torch\autograd\function.py", line 598, in apply
    return super().apply(*args, **kwargs)  # type: ignore[misc]
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\unsloth\kernels\cross_entropy_loss.py", line 256, in forward
    _chunked_cross_entropy_forward[(n_rows, n_chunks,)](
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\triton\runtime\jit.py", line 345, in <lambda>
    return lambda *args, **kwargs: self.run(grid=grid, warmup=False, *args, **kwargs)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\triton\runtime\autotuner.py", line 338, in run
    return self.fn.run(*args, **kwargs)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\triton\runtime\jit.py", line 662, in run
    kernel = self.compile(
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\triton\compiler\compiler.py", line 244, in compile
    key = f"{triton_key()}-{src.hash()}-{backend.hash()}-{options.hash()}-{str(sorted(env_vars.items()))}"
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\triton\compiler\compiler.py", line 109, in hash
    key = f"{self.fn.cache_key}-{self.attrs.hash()}-{sorted_sig}-{sorted_constants}"
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\triton\runtime\jit.py", line 758, in cache_key
    dependencies_finder.visit(self.parse())
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\ast.py", line 418, in visit
    return visitor(node)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\ast.py", line 426, in generic_visit
    self.visit(item)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\ast.py", line 418, in visit
    return visitor(node)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\triton\runtime\jit.py", line 167, in visit_FunctionDef
    self.generic_visit(node)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\ast.py", line 426, in generic_visit
    self.visit(item)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\ast.py", line 418, in visit
    return visitor(node)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\ast.py", line 426, in generic_visit
    self.visit(item)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\ast.py", line 418, in visit
    return visitor(node)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\triton\runtime\jit.py", line 221, in visit_Assign
    self.generic_visit(node)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\ast.py", line 428, in generic_visit
    self.visit(value)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\ast.py", line 418, in visit
    return visitor(node)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\ast.py", line 428, in generic_visit
    self.visit(value)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\ast.py", line 418, in visit
    return visitor(node)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\triton\runtime\jit.py", line 127, in visit_Call
    func = self.visit(node.func)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\ast.py", line 418, in visit
    return visitor(node)
  File "C:\ProgramData\anaconda3\envs\unsloth_env\lib\site-packages\triton\runtime\jit.py", line 117, in visit_Attribute
    return getattr(lhs, node.attr)
AttributeError: module 'triton.language.math' has no attribute 'tanh'
woct0rdho commented 1 month ago

triton.language.math has functions like sin and cos, but no tanh yet. You can ask in the official triton repo