今天在调试应用LatentSync的时候发现有的电脑正常运行,有的电脑会报错,部分错误信息如下:
from .sequence_parallel_fused_ops import * File “D:\dy\LatentSync\py310\lib\site-packages\xformers\ops\sequence_parallel_fused_ops.py”, line 18, in <module> from ._triton.sequence_parallel_fused_kernels import * File “D:\dy\LatentSync\py310\lib\site-packages\xformers\ops\_triton\sequence_parallel_fused_kernels.py”, line 403, in <module> def _xformers_seqpar_matmul_kernel( File “D:\dy\LatentSync\py310\lib\site-packages\triton\runtime\jit.py”, line 389, in decorator return JITFunction(fn, **kwargs, debug=debug)
TypeError: JITFunction.__init__() got an unexpected keyword argument ‘debug’
意思就是多请求了一个参数debug,可以按照下列方法进行修复
首先打开文件lib\site-packages\xformers\ops\_triton\sequence_parallel_fused_kernels.py
大约在第401行,原代码如下:
@triton.jit(
do_not_specialize=[
"wait_counters",
"blocks_done_counters",
"write_counters",
"do_wait",
"do_write",
"direction",
"stripe",
"seq_num",
"num_stripes",
"_wait",
"my_rank",
"world_size",
"timeout_ns",
],
debug=True, # To avoid stripping device asserts
)
将debug=True前面添加一个#注释掉这行,上面]后面的逗号,删除掉,修改后代码如下
@triton.jit(
do_not_specialize=[
"wait_counters",
"blocks_done_counters",
"write_counters",
"do_wait",
"do_write",
"direction",
"stripe",
"seq_num",
"num_stripes",
"_wait",
"my_rank",
"world_size",
"timeout_ns",
]
#debug=True, # To avoid stripping device asserts
)
保存文件,重新启动应用运行不会再报类似错误了。