在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

ChatGPT免费版与微软Copilot深度对比:技术选型与新手避坑指南

作为一名开发者,最近在项目里想集成一个AI助手,面对市面上眼花缭乱的选择,尤其是免费的ChatGPT和微软力推的Copilot,到底该选哪个?这确实是个让人纠结的问题。我花了一些时间,从技术实现、实际调用到性能表现,做了一次比较深入的对比和测试,希望能给同样有选择困难的朋友们一些参考。 1. 市场定位与典型场景:它们各自擅长什么? 简单来说,你可以把ChatGPT免费版看作一个“通用型对话专家”,而微软Copilot更像一个“深度集成在微软生态里的专业副驾驶”。 * ChatGPT免费版:它的核心优势在于强大的通用对话和文本生成能力。无论是头脑风暴、撰写邮件、学习新概念,还是进行开放式的创意讨论,它都能提供质量不错的回应。对于开发者而言,它非常适合用于: * 学习新技术:解释复杂的编程概念或算法。 * 代码解释与重构:将一段代码丢给它,让它解释逻辑或提出优化建议。 * 生成示例代码:根据自然语言描述,快速生成某个功能的代码片段原型。 * 微软Copilot:它的设计初衷就是提升开发和生产效率,与Visual Studio Code、GitHub、Micros

By Ne0inhk

Z-Image-GGUF实战落地:设计师团队用Z-Image替代Midjourney的迁移方案

Z-Image-GGUF实战落地:设计师团队用Z-Image替代Midjourney的迁移方案 1. 项目背景与迁移价值 最近和几个设计师朋友聊天,发现他们都在为同一件事发愁:Midjourney的订阅费用越来越高,而且对中文提示词的支持总感觉差那么点意思。每次想生成一张符合中国审美的设计图,都得绞尽脑汁把中文翻译成“地道”的英文,效果还不一定理想。 正好,阿里通义实验室开源了Z-Image模型,而且现在有了GGUF量化版本,能在消费级显卡上流畅运行。我花了些时间把它部署起来,让设计师团队试用了一个月,结果出乎意料地好。 这篇文章,我就来分享一下我们团队从Midjourney迁移到Z-Image-GGUF的完整方案。这不是简单的技术部署指南,而是经过实战验证的迁移路径,包括成本对比、效果评估、工作流调整,以及我们踩过的那些坑。 2. 为什么选择Z-Image-GGUF? 2.1 成本优势:算一笔经济账 先说说最实在的——钱。 我们团队原来有5个设计师使用Midjourney,每人每月30美元的标准计划,一年下来就是: 5人 × $30/月 × 12月 = $180

By Ne0inhk
DAMODEL平台|Llama 3.1 开源模型快速部署:从零到上线

DAMODEL平台|Llama 3.1 开源模型快速部署:从零到上线

文章目录 * 一、Llama 3.1 系列的演进与发展历程 * 二、大型语言模型的力量:Llama 3.1 405B * 三、Llama 3.1 405B 部署教程 * 四、Llama 3.1在客户服务中的运用 一、Llama 3.1 系列的演进与发展历程 自开源LLM(大语言模型)兴起以来,Meta公司凭借其Llama系列逐步在全球AI领域占据重要地位。2024年7月23日,Meta发布了Llama 3.1系列,标志着该系列在技术上的一次重要飞跃。 Llama 3.1的发布不仅在算法优化和性能提升方面做出了突破,还在数据处理和模型架构上进行了革新。随着版本的不断迭代,Llama系列逐步从最初的研究原型发展为一个功能强大、易于扩展的工具,深刻影响了开源AI生态的进步。 本篇文章将详细回顾Llama 3.1系列的演进历程,探讨其在开源领域的重要贡献以及未来发展的潜力。 这一成就的背后,是超过15万亿的Tokens和超过1.

By Ne0inhk

揭秘VSCode Copilot无法登录原因:5步快速恢复访问权限

第一章:VSCode Copilot无法登录问题概述 Visual Studio Code(VSCode)中的GitHub Copilot作为一款智能代码补全工具,极大提升了开发者的编码效率。然而,在实际使用过程中,部分用户频繁遭遇Copilot无法正常登录的问题,导致功能受限或完全不可用。该问题可能由多种因素引发,包括网络连接异常、身份验证失效、插件配置错误或系统环境限制等。 常见表现形式 * 点击“Sign in to GitHub”后无响应或弹窗无法加载 * 登录完成后仍提示“GitHub authentication failed” * Copilot状态始终显示为“Not signed in” 基础排查步骤 1. 确认网络可正常访问GitHub服务,必要时配置代理 2. 检查VSCode是否已更新至最新版本 3. 重新安装GitHub Copilot及GitHub Authentication扩展 验证身份认证状态 可通过开发者工具查看认证请求是否成功发出。在VSCode中按 F1,输入 Developer: Open

By Ne0inhk