在openi启智社区的dcu bw1000使用llama.cpp推理 stelterlab/Qwen3-Coder-30B-A3B-Instruct-AWQ(失败)

openi启智社区的dcu新推出 bw1000计算卡,不耗费积分,可以可劲用!

但是提供的镜像只有一个,感觉用起来很麻烦....

用llmfit看看模型情况

llmfit info stelterlab/Qwen3-Coder-30B-A3B-Instruct-AWQ

=== stelterlab/Qwen3-Coder-30B-A3B-Instruct-AWQ ===

Provider: stelterlab
Parameters: 4.6B
Quantization: Q4_K_M
Best Quant: Q8_0
Context Length: 262144 tokens
Use Case: Code generation and completion
Category: Coding
Released: 2025-07-31
Runtime: llama.cpp (est. ~17.2 tok/s)

Score Breakdown:
  Overall Score: 66.7 / 100
  Quality: 68  Speed: 43  Fit: 61  Context: 100
  Estimated Speed: 17.2 tok/s

Resource Requirements:
  Min VRAM: 2.4 GB
  Min RAM: 2.6 GB (CPU inference)
  Recommended RAM: 4.3 GB

MoE Architecture:
  Experts: 8 active / 128 total per token
  Active VRAM: 0.5 GB (vs 2.4 GB full model)

Fit Analysis:
  Status: 🟡 Good
  Run Mode: CPU+GPU
  Memory Utilization: 0.6% (2.6 / 405.5 GB)

Notes:
  MoE: insufficient VRAM for expert offloading
  Spilling entire model to system RAM
  Performance will be significantly reduced
  Best quantization for hardware: Q8_0 (model default: Q4_K_M)
  Estimated speed: 17.2 tok/s

安装llama.cpp

下载 llama.cpp源代码

git clone https://gitcode.com/GitHub_Trending/ll/llama.cpp

编译llama.cpp

cd llama.cpp cmake -B build cmake --build build --config Release


加入路径
 

export PATH=/root/llama.cpp/build/bin:$PATH

或者也可以直击用make install

cd build make install 

但是安装好后报错

oot@crdnotebook-2027598444851879937-denglf-12859:~/llama.cpp/build# llama-cli llama-cli: error while loading shared libraries: libmtmd.so.0: cannot open shared object file: No such file or directory root@crdnotebook-2027598444851879937-denglf-12859:~/llama.cpp/build# llama-gguf llama-gguf: error while loading shared libraries: libggml-base.so.0: cannot open shared object file: No such file or directory

原来是没有把路径加入的缘故,加入路径,问题解决:

export PATH=/root/llama.cpp/build/bin:$PATH

模型下载

安装modelscope

pip install modelscope

下载

from modelscope import snapshot_download snapshot_download('tclf90/Qwen3-Coder-30B-A3B-Instruct-AWQ', cache_dir="models")

推理

用llama-cli推理

llama-cli -m models/tclf90/Qwen3-Coder-30B-A3B-Instruct-AWQ

报错:

root@crdnotebook-2027598444851879937-denglf-12859:~# llama-cli -m models/tclf90/Qwen3-Coder-30B-A3B-Instruct-AWQ

Loading model... |gguf_init_from_file_impl: failed to read magic
llama_model_load: error loading model: llama_model_loader: failed to load model from models/tclf90/Qwen3-Coder-30B-A3B-Instruct-AWQ
llama_model_load_from_file_impl: failed to load model
llama_params_fit: encountered an error while trying to fit params to free device memory: failed to load model
gguf_init_from_file_impl: failed to read magic
llama_model_load: error loading model: llama_model_loader: failed to load model from models/tclf90/Qwen3-Coder-30B-A3B-Instruct-AWQ
llama_model_load_from_file_impl: failed to load model
common_init_from_params: failed to load model 'models/tclf90/Qwen3-Coder-30B-A3B-Instruct-AWQ'
srv    load_model: failed to load model, 'models/tclf90/Qwen3-Coder-30B-A3B-Instruct-AWQ'
 
Failed to load the model

看了一下,应该是这个模型: stelterlab/Qwen3-Coder-30B-A3B-Instruct-AWQ

问题是这个模型魔搭没有....

尝试用transformers推理

from transformers import AutoModelForCausalLM, AutoTokenizer model_name = "/root/models/tclf90/Qwen3-Coder-30B-A3B-Instruct-AWQ" # load the tokenizer and the model tokenizer = AutoTokenizer.from_pretrained(model_name) model = AutoModelForCausalLM.from_pretrained( model_name, torch_dtype="auto", device_map="auto" ) # prepare the model input prompt = "Write a quick sort algorithm." messages = [ {"role": "user", "content": prompt} ] text = tokenizer.apply_chat_template( messages, tokenize=False, add_generation_prompt=True, ) model_inputs = tokenizer([text], return_tensors="pt").to(model.device) # conduct text completion generated_ids = model.generate( **model_inputs, max_new_tokens=65536 ) output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist() content = tokenizer.decode(output_ids, skip_special_tokens=True) print("content:", content) 

也是失败

File /opt/conda/lib/python3.10/site-packages/transformers/quantizers/quantizer_awq.py:48, in AwqQuantizer.validate_environment(self, **kwargs) 46 def validate_environment(self, **kwargs): 47 if not is_gptqmodel_available(): ---> 48 raise ImportError( 49 "Loading an AWQ quantized model requires gptqmodel. Please install it with `pip install gptqmodel`" 50 ) 52 if not is_accelerate_available(): 53 raise ImportError("Loading an AWQ quantized model requires accelerate (`pip install accelerate`)") ImportError: Loading an AWQ quantized model requires gptqmodel. Please install it with `pip install gptqmodel`

总结

没调通,先搁置

llama.cpp是因为魔搭没有那个模型,所以模型不匹配

transformers是因为库的问题,需要重新安装torch等库,导致需要的库无法安装上,推理失败。

调试

报错ImportError: Loading an AWQ quantized model requires gptqmodel.

File /opt/conda/lib/python3.10/site-packages/transformers/quantizers/quantizer_awq.py:48, in AwqQuantizer.validate_environment(self, **kwargs) 46 def validate_environment(self, **kwargs): 47 if not is_gptqmodel_available(): ---> 48 raise ImportError( 49 "Loading an AWQ quantized model requires gptqmodel. Please install it with `pip install gptqmodel`" 50 ) 52 if not is_accelerate_available(): 53 raise ImportError("Loading an AWQ quantized model requires accelerate (`pip install accelerate`)") ImportError: Loading an AWQ quantized model requires gptqmodel. Please install it with `pip install gptqmodel`

安装提示执行

pip install gptqmodel

安装失败,

 Exception: Unable to detect torch version via uv/pip/conda/importlib. Please install torch >= 2.7.1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed to build 'gptqmodel' when getting requirements to build wheel

用conda试试

conda install gptqmodel

也失败了。

PackagesNotFoundError: The following packages are not available from current channels:

  - gptqmodel

Read more

Copilot Prompt 工程实战:如何设计高效提示词提升开发效率

背景痛点:提示词写得越随意,返工越频繁 第一次把 GitHub Copilot 请进 IDE 时,我以为“会说话就能写代码”。结果三天后,同一段逻辑被它反复生成三种完全不同的写法:变量命名一会儿匈牙利、一会儿驼峰;边界条件时而 <= 时而 <;最离谱的是把 async/await 和 .then 混在一个文件里。问题根源不在模型,而在我的提示词——太模糊、太短、没有上下文。总结下来,开发者最容易踩的坑集中在三点: 1. 任务描述像“帮我写个排序”这种一句话,模型只能猜数据规模、猜稳定性需求,结果当然随缘。 2. 上下文缺失,Copilot 只能看到当前打开的文件,对项目里已有的工具函数、类型定义、测试风格一无所知,于是“重复造轮子”或“风格打架”

Whisper语音识别:零基础打造个人专属的智能转录神器

想要将语音内容瞬间转换为精准文字吗?OpenAI Whisper作为业界领先的语音识别解决方案,能够帮助你在本地设备上实现专业级的语音转文字功能,无需任何技术背景即可轻松上手。 【免费下载链接】whisper-base.en 项目地址: https://ai.gitcode.com/hf_mirrors/openai/whisper-base.en 为什么这款工具值得你立即尝试? 🎙️ 解放双手的智能转录体验 告别传统的手动打字记录,Whisper能够自动识别各类音频内容,无论是会议录音、学习讲座还是个人笔记,都能快速生成结构清晰的文字文档。想象一下,重要会议结束后,完整的会议纪要已经自动生成,这是多么高效的工作方式! 🛡️ 隐私安全的本地化处理 所有音频处理都在你的设备上完成,无需上传到云端,完美保护你的隐私安全。这对于涉及商业机密、个人隐私的录音内容尤为重要。 🌐 多语言无障碍沟通 支持全球99种语言的识别和翻译,无论是中文普通话、英语对话还是其他小语种,都能准确处理,真正实现语言无界限。 三步开启你的智能转录之旅 第一步:环境准备与基础配置 确保你

多模态模型Qwen3-VL在Llama-Factory嵌套量化QLoRA训练+测试+导出+部署(Ollama/LMDeploy)全流程--以具身智能数据集open-eqa为例

多模态模型Qwen3-VL在Llama-Factory嵌套量化QLoRA训练+测试+导出+部署(Ollama/LMDeploy)全流程--以具身智能数据集open-eqa为例

前期环境配置等准备可参考教程: 多模态模型Qwen3-VL在Llama-Factory中断LoRA微调训练+测试+导出+部署全流程--以具身智能数据集open-eqa为例 这里数据来源 Open-EQA 多模态具身智能数据集,经过处理每个样本八张图片,划分为训练-验证集和测试集。 若对下载和处理open-eqa数据集代码有兴趣,可以通过网盘分享的文件:OpenEQACode.zip 链接: https://pan.baidu.com/s/1DqmIp1Xw6HJPX77O-iOXdQ?pwd=dgn8 提取码: dgn8 如果不方便下载和处理open-eqa数据集,可以通过网盘分享的文件:OpenEQA8s.zip 链接: https://pan.baidu.com/s/1_6G4YwI5tmYXUSDLssJ13A?pwd=hfvw 提取码: hfvw 1.微调训练 有cuda显卡可以执行pip install unsloth可以安装Unsloth加快训练和推理 执行pip install tensorboard安装保存完整训练过程的数据,避免中断只能部分曲线

VSCode + Copilot下:配置并使用 DeepSeek

以下是关于在 VSCode + Copilot 中,通过 OAI Compatible Provider for Copilot 插件配置使用 DeepSeek 系列模型 (deepseek-chat, deepseek-reasoner, deepseek-coder) 的完整汇总指南。 🎯 核心目标 通过该插件,将支持 OpenAI API 格式的第三方大模型(此处为 DeepSeek)接入 VSCode 的官方 Copilot 聊天侧边栏,实现调用。 📦 第一步:准备工作 在开始配置前,确保完成以下准备: 步骤操作说明1. 安装插件在 VSCode 扩展商店搜索并安装 OAI Compatible Provider for Copilot。这是连接 Copilot 与第三方模型的核心桥梁。2. 获取 API