llamafactory微调模型报错ModuleNotFoundError: No module named ‘triton.ops‘

一、问题

在阿里云Notebook上使用llamafactory微调Meta-Llama-3-8B-Instruct模型报错ModuleNotFoundError: No module named 'triton.ops'

复制代码
Traceback (most recent call last):
  File "/home/user/comfyui/nodes.py", line 2145, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/user/comfyui/custom_nodes/sd-lora-trainer/__init__.py", line 5, in <module>
    from node import Eden_LoRa_trainer
  File "/home/user/comfyui/custom_nodes/sd-lora-trainer/node.py", line 9, in <module>
    from main import train
  File "/home/user/comfyui/custom_nodes/sd-lora-trainer/main.py", line 14, in <module>
    from trainer.utils.utils import *
  File "/home/user/comfyui/custom_nodes/sd-lora-trainer/trainer/utils/utils.py", line 11, in <module>
    from diffusers import AutoencoderKL, DDPMScheduler, EulerDiscreteScheduler, UNet2DConditionModel, StableDiffusionPipeline, StableDiffusionXLPipeline
  File "<frozen importlib._bootstrap>", line 1229, in _handle_fromlist
  File "/mnt/comfyui/venv/lib/python3.11/site-packages/diffusers/utils/import_utils.py", line 911, in __getattr__
    value = getattr(module, name)
            ^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/comfyui/venv/lib/python3.11/site-packages/diffusers/utils/import_utils.py", line 910, in __getattr__
    module = self._get_module(self._class_to_module[name])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/comfyui/venv/lib/python3.11/site-packages/diffusers/utils/import_utils.py", line 922, 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):
No module named 'triton.ops'

Cannot import /home/user/comfyui/custom_nodes/sd-lora-trainer module for custom nodes: Failed to import diffusers.models.autoencoders.autoencoder_kl because of the following error (look up to see its traceback):
No module named 'triton.ops'
...
二、原因

在triton新版本中,triton.ops不存在了,可在triton的github上找到对应问题:
In version 3.2.0 of triton, triton.ops no longer exists (triton-lang/triton#5471)

from: https://github.com/edenartlab/sd-lora-trainer/issues/12

二、问题解决

参考github上Import error with latest version of triton #12

给出的解决方案,调整triton为旧版本

查看triton的版本(https://github.com/triton-lang/triton/blob/main/RELEASE.md)如下:

这里选择旧一点的版本: 2.3.0

复制代码
pip uninstall triton
pip install triton==2.3.0

重新启动llamafactory-cli webui,进行微调,可正常运行:


参考:

1.https://github.com/edenartlab/sd-lora-trainer/issues/12

2.https://github.com/triton-lang/triton/blob/main/RELEASE.md

相关推荐
一条大祥脚14 天前
GPU 编程 DSL 全景对比:TileLang、Triton、Mojo、cuTile、CuTe、ThunderKittens 与 CuTe DSL
mojo·triton·tilelang·cute·gpu dsl
兜里只有三分钱~21 天前
启元机器人 π0 与 GR00T N1 对比:VLA 模型的两条技术路线
机器人·微调·预训练·仿真·vla
智码看视界1 个月前
深度学习:迁移学习与预训练模型应用实践
深度学习·微调·迁移学习·小样本·特征提取·#预训练模型·领域适配
智码看视界2 个月前
AI 推理优化 | Triton Inference Server 架构解析:单机多模型并发推理的工业级方案
nvidia·模型部署·mlops·triton·gpu推理·推理服务化·动态批处理
Blockbuater_drug2 个月前
CyclicMPNN: 环肽序列设计专用模型——ProteinMPNN 的环肽微调版
微调·cyclicmpnn·环肽序列设计·proteinmpnn·highfold·序列多样性
CBeann2 个月前
如何设计CLAUDE.md
大模型·llm·微调
XLYcmy3 个月前
Self-Adapting Language Models论文分享
自然语言处理·llm·微调·sft·论文笔记·强化学习·自进化
VivienneLuo3 个月前
1. 联邦大模型微调综述 -《Federated Large Language Models...》
人工智能·语言模型·微调·联邦学习
阡之尘埃3 个月前
Python数据分析案例85——大模型微调全流程(SFT的LoRA微调)
人工智能·python·深度学习·语言模型·llm·微调·千问
weixin_440213293 个月前
大模型训练、微调、对齐、推理、量化、优化、数据集等
微调·数据集·sft·预训练·模型量化·gptq·kv cache