Open FurkanGozukara opened 3 weeks ago
torch 2.4.1 same error
I am ready to try debugging the reason
test.py works on this venv - the test code on readme
(venv) G:\OmniGen_v1>python test.py ptxas info : 0 bytes gmem ptxas info : Compiling entry function 'add_kernel' for 'sm_86' ptxas info : Function properties for add_kernel 0 bytes stack frame, 0 bytes spill stores, 0 bytes spill loads ptxas info : Used 26 registers, 380 bytes cmem[0] tensor([0., 0., 0.], device='cuda:0') If you see tensor([0., 0., 0.], device='cuda:0'), then it works
(venv) G:\OmniGen_v1>
@woct0rdho i am waiting your return for debugging :D
It can be tricky to make sure which Python a venv uses. Are you sure that you're using the same Python in your call venv\Scripts\activate.bat
and python test.py
?
It can be tricky to make sure which Python a venv uses. Are you sure that you're using the same Python in your
call venv\Scripts\activate.bat
andpython test.py
?
yep using 100% same python and venv
what else i can test?
What is your activate.bat
, is it from a Python venv, or a conda venv?
In your first post, why does it run Python code like import triton
after you run call venv\Scripts\activate.bat
? Did you run something else?
What is your
activate.bat
, is it from a Python venv, or a conda venv?In your first post, why does it run Python code like
import triton
after you runcall venv\Scripts\activate.bat
? Did you run something else?
ok here i modified bat file to test all at once
cd OmniGen
call venv\Scripts\activate.bat
pip freeze
python test.py
python app.py
pause
[import torch
import triton
import triton.language as tl
@triton.jit
def add_kernel(x_ptr, y_ptr, output_ptr, n_elements, BLOCK_SIZE: tl.constexpr):
pid = tl.program_id(axis=0)
block_start = pid * BLOCK_SIZE
offsets = block_start + tl.arange(0, BLOCK_SIZE)
mask = offsets < n_elements
x = tl.load(x_ptr + offsets, mask=mask)
y = tl.load(y_ptr + offsets, mask=mask)
output = x + y
tl.store(output_ptr + offsets, output, mask=mask)
def add(x: torch.Tensor, y: torch.Tensor):
output = torch.empty_like(x)
assert x.is_cuda and y.is_cuda and output.is_cuda
n_elements = output.numel()
grid = lambda meta: (triton.cdiv(n_elements, meta["BLOCK_SIZE"]),)
add_kernel[grid](x, y, output, n_elements, BLOCK_SIZE=1024)
return output
a = torch.rand(3, device="cuda")
b = a + a
b_compiled = add(a, a)
print(b_compiled - b)
print("If you see tensor([0., 0., 0.], device='cuda:0'), then it works")](url)
@woct0rdho
G:\OmniGen_v1>cd OmniGen
G:\OmniGen_v1\OmniGen>call venv\Scripts\activate.bat
accelerate==0.26.1
aiofiles==23.2.1
aiohappyeyeballs==2.4.3
aiohttp==3.10.10
aiosignal==1.3.1
annotated-types==0.7.0
anyio==4.6.2.post1
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
asttokens==2.4.1
async-lru==2.0.4
async-timeout==4.0.3
attrs==24.2.0
babel==2.16.0
beautifulsoup4==4.12.3
bleach==6.2.0
certifi==2024.8.30
cffi==1.17.1
charset-normalizer==3.4.0
click==8.1.7
colorama==0.4.6
comm==0.2.2
datasets==2.20.0
debugpy==1.8.7
decorator==5.1.1
defusedxml==0.7.1
diffusers==0.30.3
dill==0.3.8
exceptiongroup==1.2.2
executing==2.1.0
fastapi==0.115.4
fastjsonschema==2.20.0
ffmpy==0.4.0
filelock==3.16.1
fqdn==1.5.1
frozenlist==1.5.0
fsspec==2024.5.0
gradio==5.4.0
gradio_client==1.4.2
h11==0.14.0
httpcore==1.0.6
httpx==0.27.2
huggingface-hub==0.26.2
idna==3.10
importlib_metadata==8.5.0
intel-openmp==2021.4.0
ipykernel==6.29.5
ipython==8.29.0
ipywidgets==8.1.5
isoduration==20.11.0
jedi==0.19.1
Jinja2==3.1.4
json5==0.9.25
jsonpointer==3.0.0
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
jupyter==1.0.0
jupyter-console==6.6.3
jupyter-events==0.10.0
jupyter-lsp==2.2.5
jupyter_client==8.6.3
jupyter_core==5.7.2
jupyter_server==2.14.2
jupyter_server_terminals==0.5.3
jupyterlab==4.2.5
jupyterlab_pygments==0.3.0
jupyterlab_server==2.27.3
jupyterlab_widgets==3.0.13
markdown-it-py==3.0.0
MarkupSafe==2.1.5
matplotlib-inline==0.1.7
mdurl==0.1.2
mistune==3.0.2
mkl==2021.4.0
mpmath==1.3.0
multidict==6.1.0
multiprocess==0.70.16
nbclient==0.10.0
nbconvert==7.16.4
nbformat==5.10.4
nest-asyncio==1.6.0
networkx==3.4.2
notebook==7.2.2
notebook_shim==0.2.4
numpy==1.26.3
orjson==3.10.11
overrides==7.7.0
packaging==24.1
pandas==2.2.3
pandocfilters==1.5.1
parso==0.8.4
peft==0.13.2
pillow==10.2.0
platformdirs==4.3.6
prometheus_client==0.21.0
prompt_toolkit==3.0.48
propcache==0.2.0
psutil==5.9.8
pure_eval==0.2.3
pyarrow==18.0.0
pyarrow-hotfix==0.6
pycparser==2.22
pydantic==2.9.2
pydantic_core==2.23.4
pydub==0.25.1
Pygments==2.18.0
python-dateutil==2.9.0.post0
python-json-logger==2.0.7
python-multipart==0.0.12
pytz==2024.2
pywin32==308
pywinpty==2.0.14
PyYAML==6.0.2
pyzmq==26.2.0
qtconsole==5.6.1
QtPy==2.4.1
referencing==0.35.1
regex==2024.9.11
requests==2.32.3
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rich==13.9.4
rpds-py==0.20.1
ruff==0.7.2
safehttpx==0.1.1
safetensors==0.4.5
semantic-version==2.10.0
Send2Trash==1.8.3
shellingham==1.5.4
six==1.16.0
sniffio==1.3.1
soupsieve==2.6
spaces==0.30.4
stack-data==0.6.3
starlette==0.41.2
sympy==1.13.1
tbb==2021.13.1
terminado==0.18.1
timm==0.9.16
tinycss2==1.4.0
tokenizers==0.20.1
tomli==2.0.2
tomlkit==0.12.0
torch==2.5.1+cu124
torchvision==0.20.1+cu124
tornado==6.4.1
tqdm==4.66.6
traitlets==5.14.3
transformers==4.45.2
triton @ https://github.com/woct0rdho/triton-windows/releases/download/v3.1.0-windows.post5/triton-3.1.0-cp310-cp310-win_amd64.whl
typer==0.12.5
types-python-dateutil==2.9.0.20241003
typing_extensions==4.12.2
tzdata==2024.2
uri-template==1.3.0
urllib3==2.2.3
uvicorn==0.32.0
wcwidth==0.2.13
webcolors==24.8.0
webencodings==0.5.1
websocket-client==1.8.0
websockets==12.0
widgetsnbextension==4.0.13
xformers==0.0.28.post3
xxhash==3.5.0
yarl==1.17.1
zipp==3.20.2
tensor([0., 0., 0.], device='cuda:0')
If you see tensor([0., 0., 0.], device='cuda:0'), then it works
A matching Triton is not available, some optimizations will not be enabled
Traceback (most recent call last):
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\xformers\__init__.py", line 57, in _is_triton_available
import triton # noqa
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\__init__.py", line 20, in <module>
from .runtime import (
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\runtime\__init__.py", line 1, in <module>
from .autotuner import (Autotuner, Config, Heuristics, autotune, heuristics)
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\runtime\autotuner.py", line 9, in <module>
from ..testing import do_bench, do_bench_cudagraph
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\testing.py", line 7, in <module>
from . import language as tl
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\language\__init__.py", line 4, in <module>
from . import math
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\language\math.py", line 1, in <module>
from . import core
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\language\core.py", line 10, in <module>
from ..runtime.jit import jit
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\runtime\jit.py", line 12, in <module>
from ..runtime.driver import driver
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\runtime\driver.py", line 1, in <module>
from ..backends import backends
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\backends\__init__.py", line 50, in <module>
backends = _discover_backends()
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\backends\__init__.py", line 43, in _discover_backends
compiler = _load_module(name, os.path.join(root, name, 'compiler.py'))
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\backends\__init__.py", line 12, in _load_module
spec.loader.exec_module(module)
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\backends\amd\compiler.py", line 2, in <module>
from triton._C.libtriton import ir, passes, llvm, amd
ImportError: DLL load failed while importing libtriton: A dynamic link library (DLL) initialization routine failed.
Fetching 10 files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<?, ?it/s]
Loading safetensors
INFO: Could not find files for the given pattern(s).
* Running on local URL: http://127.0.0.1:7860
To create a public link, set `share=True` in `launch()`.
I honestly have no idea...
I honestly have no idea...
any hint that i can try to debug?
i can also send you scripts this is my linked in : https://www.linkedin.com/in/furkangozukara/
this is my email : monstermmorpg@gmail.com
In xformers/__init__.py
, there is
try:
import triton # noqa
return True
except (ImportError, AttributeError):
logger.warning(
"A matching Triton is not available, some optimizations will not be enabled",
exc_info=True,
)
return False
Maybe you can remove the try ... except
and let it fail, then we can see what package imports xformers
, and whether it modifies PATH
(Remember to revert the modifications after the debugging)
@woct0rdho
If you see tensor([0., 0., 0.], device='cuda:0'), then it works
Traceback (most recent call last):
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\diffusers\utils\import_utils.py", line 830, in _get_module
return importlib.import_module("." + module_name, self.__name__)
File "C:\Python310\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\diffusers\models\autoencoders\__init__.py", line 1, in <module>
from .autoencoder_asym_kl import AsymmetricAutoencoderKL
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\diffusers\models\autoencoders\autoencoder_asym_kl.py", line 23, in <module>
from .vae import DecoderOutput, DiagonalGaussianDistribution, Encoder, MaskConditionDecoder
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\diffusers\models\autoencoders\vae.py", line 24, in <module>
from ..attention_processor import SpatialNorm
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\diffusers\models\attention_processor.py", line 35, in <module>
import xformers.ops
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\xformers\ops\__init__.py", line 8, in <module>
from .fmha import (
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\xformers\ops\fmha\__init__.py", line 10, in <module>
from . import (
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\xformers\ops\fmha\triton_splitk.py", line 109, in <module>
if TYPE_CHECKING or _is_triton_available():
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\xformers\__init__.py", line 38, in func_wrapper
value = func()
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\xformers\__init__.py", line 46, in _is_triton_available
import triton
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\__init__.py", line 20, in <module>
from .runtime import (
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\runtime\__init__.py", line 1, in <module>
from .autotuner import (Autotuner, Config, Heuristics, autotune, heuristics)
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\runtime\autotuner.py", line 9, in <module>
from ..testing import do_bench, do_bench_cudagraph
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\testing.py", line 7, in <module>
from . import language as tl
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\language\__init__.py", line 4, in <module>
from . import math
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\language\math.py", line 1, in <module>
from . import core
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\language\core.py", line 10, in <module>
from ..runtime.jit import jit
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\runtime\jit.py", line 12, in <module>
from ..runtime.driver import driver
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\runtime\driver.py", line 1, in <module>
from ..backends import backends
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\backends\__init__.py", line 50, in <module>
backends = _discover_backends()
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\backends\__init__.py", line 43, in _discover_backends
compiler = _load_module(name, os.path.join(root, name, 'compiler.py'))
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\backends\__init__.py", line 12, in _load_module
spec.loader.exec_module(module)
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\triton\backends\amd\compiler.py", line 2, in <module>
from triton._C.libtriton import ir, passes, llvm, amd
ImportError: DLL load failed while importing libtriton: A dynamic link library (DLL) initialization routine failed.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "G:\OmniGen_v1\OmniGen\app.py", line 7, in <module>
from OmniGen import OmniGenPipeline
File "G:\OmniGen_v1\OmniGen\OmniGen\__init__.py", line 4, in <module>
from .pipeline import OmniGenPipeline
File "G:\OmniGen_v1\OmniGen\OmniGen\pipeline.py", line 11, in <module>
from diffusers.models import AutoencoderKL
File "<frozen importlib._bootstrap>", line 1075, in _handle_fromlist
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\diffusers\utils\import_utils.py", line 820, in __getattr__
module = self._get_module(self._class_to_module[name])
File "G:\OmniGen_v1\OmniGen\venv\lib\site-packages\diffusers\utils\import_utils.py", line 832, in _get_module
raise RuntimeError(
RuntimeError: Failed to import diffusers.models.autoencoders.autoencoder_kl because of the following error (look up to see its traceback):
DLL load failed while importing libtriton: A dynamic link library (DLL) initialization routine failed.
the same problem:
import triton
File "D:\ProgramData\miniconda3\envs\vision\lib\site-packages\triton__init.py", line 20, in
the same problem:
import triton File "D:\ProgramData\miniconda3\envs\vision\lib\site-packages\tritoninit.py", line 20, in from .runtime import ( File "D:\ProgramData\miniconda3\envs\vision\lib\site-packages\triton\runtimeinit.py", line 1, in from .autotuner import (Autotuner, Config, Heuristics, autotune, heuristics) File "D:\ProgramData\miniconda3\envs\vision\lib\site-packages\triton\runtime\autotuner.py", line 9, in from ..testing import do_bench, do_bench_cudagraph File "D:\ProgramData\miniconda3\envs\vision\lib\site-packages\triton\testing.py", line 7, in from . import language as tl File "D:\ProgramData\miniconda3\envs\vision\lib\site-packages\triton\languageinit.py", line 4, in from . import math File "D:\ProgramData\miniconda3\envs\vision\lib\site-packages\triton\language\math.py", line 1, in from . import core File "D:\ProgramData\miniconda3\envs\vision\lib\site-packages\triton\language\core.py", line 10, in from ..runtime.jit import jit File "D:\ProgramData\miniconda3\envs\vision\lib\site-packages\triton\runtime\jit.py", line 12, in from ..runtime.driver import driver File "D:\ProgramData\miniconda3\envs\vision\lib\site-packages\triton\runtime\driver.py", line 1, in from ..backends import backends File "D:\ProgramData\miniconda3\envs\vision\lib\site-packages\triton\backendsinit.py", line 50, in backends = _discover_backends() File "D:\ProgramData\miniconda3\envs\vision\lib\site-packages\triton\backendsinit.py", line 43, in _discover_backends compiler = _load_module(name, os.path.join(root, name, 'compiler.py')) File "D:\ProgramData\miniconda3\envs\vision\lib\site-packages\triton\backendsinit.py", line 12, in _load_module spec.loader.exec_module(module) File "D:\ProgramData\miniconda3\envs\vision\lib\site-packages\triton\backends\amd\compiler.py", line 2, in from triton._C.libtriton import ir, passes, llvm, amd ImportError: DLL load failed while importing libtriton: 动态链接库(DLL)初始化例程失败。
follow the readme, the update these files, work on successful msvcp140.dll, vcruntime140.dll, and vcruntime140_1.dll
@zeusftk you were having error when running test python code right? it works on my case
i noticed when installing triton 3.1.0 update5 after first uninstalling all triton versions, when reinstalling it shows - Requirement already satisfied: filelock in c:\ai\comfyui_windows_portable\python_embeded\lib\site-packages (from triton==3.1.0) (3.13.1)
yet when i check installed version it shows 3.1.0 not 3.13.1, which doesnt show up in pip. im wondering if some of the dependencies have been changed in the original pull from openai's triton-lang repo. when i uninstall all works fine without the triton hooks, yet 3.13.1 is still installed but not called/used.
@synystersocks 3.13.1 is the version of the package filelock
. This should not be a problem
@synystersocks 3.13.1 is the version of the package
filelock
. This should not be a problem
@woct0rdho Thank you for replying and confirming this is an expected dependancy :D il continue digging :)