qwen
Use QwenLM/Qwen for Qwen model loading, local generation, serving, fine-tuning, quantization, evaluation, system prompts, tool use, and tokenizer-aware workflows.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- qwen
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use QwenLM/Qwen for Qwen model loading, local generation, serving, fine-tuning, quantization, evaluation, system prompts, tool use, and tokenizer-aware workflows.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/model-family-overview.md4.0 KB
- 参考文档references/repo-provenance.md2.1 KB
- 参考文档references/repo-routing-metadata.json537 B
- 参考文档references/troubleshooting.md4.2 KB
- 脚本scripts/check_qwen_environment.py3.6 KB
03 SKILL.md 正文
Qwen
Use this skill when a task names Qwen, Qwen-7B/Qwen-14B/Qwen-72B, Qwen-Chat, Qwen/Qwen-*, ModelScope Qwen checkpoints, Qwen's Transformers examples, qwenllm/qwen Docker images, or the repository's fine-tuning, evaluation, serving, tokenizer, and tool-use workflows.
This is a repository operating graph, not a general model card. Start by deciding whether the request is about a base model or a chat model, whether the checkpoint is remote or local, and whether the desired action needs CPU, CUDA, Docker, a vendor accelerator, a cloud API, credentials, or a sandbox.
Fast start
- Base install for the documented Transformers workflows:
pip install -r requirements.txt. - Add only the optional dependency family needed by the route: web demo, API server, PEFT/DeepSpeed, AutoGPTQ, vLLM/FastChat, ModelScope, or a vendor runtime.
- Safe environment check:
python scripts/check_qwen_environment.py --check-dependencies. - Minimal public-package check:
python -c "import torch, transformers, tiktoken; print(torch.__version__, transformers.__version__)". - Do not download a checkpoint, start a service, run training, run a benchmark, or use a cloud key merely to prove that the package imports.
Route by task
| User request | Read first |
|---|---|
| Load Qwen with Transformers/ModelScope, chat, batch generation, CPU/multi-GPU, precision, local checkpoints, long context, or quantized inference | sub-skills/inference-model-loading/SKILL.md |
| Run the CLI/Web UI/OpenAI-compatible API, vLLM/FastChat, Docker, TensorRT, Ascend, or DCU deployment | sub-skills/serving-deployment/SKILL.md |
| Prepare SFT data, full fine-tuning, LoRA, Q-LoRA, DeepSpeed/FSDP, adapter merge, or GPTQ quantization | sub-skills/finetuning-quantization/SKILL.md |
| Reproduce C-Eval, MMLU, CMMLU, GSM8K, HumanEval, or plugin/tool-use benchmarks | sub-skills/evaluation-reproduction/SKILL.md |
| Use system prompts, ReAct, function calling, Hugging Face Agent patterns, ChatML, special tokens, or BPE merge extension | sub-skills/prompting-tool-use-tokenization/SKILL.md |
Cross-cutting rules
- Prefer a local checkpoint path when the user already has one. A model identifier such as
Qwen/Qwen-7B-Chatorqwen/Qwen-7B-Chatimplies a download and remote-code execution; state that prerequisite explicitly. - Keep
trust_remote_code=Trueexplicit for these historical Qwen checkpoints. Verify the checkpoint contains its config, tokenizer files, model shards, and any requiredqwen.tiktokenfile before diagnosing Python code. - Never treat a CPU import or a tiny CUDA tensor as proof that full model generation, training, vLLM, GPTQ, or benchmark performance works. Report hardware, memory, model size, and optional dependency gates separately.
- Treat
Qwen-*base models andQwen-*-Chatmodels differently: base models are for continuation; chat models providechat/chat_streamand alignment behavior. - Use the bundled helpers for dry-run command construction and local validation. They do not load models, download data, launch services, invoke Docker, or execute generated code.
Shared references
- Read
references/model-family-overview.mdfor model names, context, precision, quantization, and backend planning. - Read
references/troubleshooting.mdfor install/import, checkpoint, tokenizer, optional dependency, hardware, license, and safety failures. - Read
references/repo-provenance.mdbefore deciding whether this graph is stale for a newer checkout. - Read
references/repo-routing-metadata.jsononly when maintaining managed router placement; it is structured metadata, not a prose route.
Scope and safety
The repository contains historical GPU-heavy and vendor-specific workflows. Keep network, credentials, Docker, public sharing, generated-code execution, model downloads, training, and long-running servers explicit and user-approved. Preserve Qwen's license and safety obligations and perform application-specific red-teaming before deployment.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).