Repository navigation
Conversation
从 cosdt-ci-test/workflows 迁入 MiniOneRec 的单卡 quick start:文档、 守卫测试、薄触发器与站点登记。 - sources/minionerec/quick_start.md:单卡 910B 上跑 SFT、约束解码评估与 推荐导向 RL 三个阶段。sft.py / evaluate.py 不改源码,评估与 RL 用 PYTHONPATH 挂一个 /tmp 下的 sitecustomize.py 注入 transfer_to_npu; RL 用一条 sed 改 rl.py 三处写死值(optim 无 NPU 后端、sample=-1 与 sample=10000 会展开整个商品目录)。模型与预处理数据统一从 HuggingFace 拉取,原先的 ModelScope 与 hf-mirror 依赖去掉;克隆不再做重试循环。 - tests/minionerec/:继承 doc_test.base.MarkdownDocTestBase, prepare_environment 只做 CANN 环境、git 与工作目录,其余步骤全部由文档 执行;RL 段只断言流程贯通与落盘产物(此规模下 reward 恒为 0)。 - .github/workflows/minionerec-quick-start.yml:只声明项目变量,回路复用 quick-start-template.yml;fixed_ref=main(上游无 release tag),cron 槽位 取 11:50/23:50 UTC,与现有守卫错开。 - index.rst 增加「训练与微调」卡片与 toctree 条目,conf.py 的 exclude_patterns 补上 quick_start.md(由 index.rst include,不单独成页)。
Contributor
|
📖 文档预览:https://ascend.github.io/docs/pr-preview/pr-271/sources/minionerec/ 也可打开整站首页。 构建自 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
从
cosdt-ci-test/workflows的 minionerec 看护迁入本站:单卡 910B 上跑 SFT、约束解码评估与推荐导向 RL 三个阶段,含文档、守卫测试、薄触发器与站点登记。文档
新增
sources/minionerec/quick_start.md,## 1–## 10按操作顺序编号,前置条件按「硬件 / 软件 / 本文验证环境」三张表,结尾## 相关链接。## 3克隆AkaliKong/MiniOneRec的main。## 4用与 CANN 9.1.0 配套的 torch 栈(torch 2.9.0 + torch_npu 2.9.0.post2)单独安装依赖:上游requirements.txt面向 CUDA(torchrec、fbgemm_gpu是+cu118安装包,另带整套nvidia-*-cu12运行库),NPU 上不适用。## 7的基座模型与预处理数据都从 HuggingFace 拉取(Qwen/Qwen2.5-0.5B、kkknight/MiniOneRec),没有 ModelScope 与 hf-mirror 依赖。两个入口的设备差异
sft.py与evaluate.py对torch.cuda的依赖不同。前者把设备选择交给TrainingArguments,transformers 的设备链里 NPU 分支排在 CUDA 之前,不做任何注入也能拿到npu:0;后者在模块级就写成device = "cuda" if torch.cuda.is_available() else "cpu",不注入必然落到 CPU。## 5用一段命令同时打印这两个结果,## 6把sitecustomize.py放进/tmp,只通过PYTHONPATH挂到评估与 RL 两条命令上——不写 site-packages,仓库源码保持字节级不变,由## 6的git status --porcelain断言。RL 的三处改动
rl.py有三个写死值与单卡运行冲突,用一条sed就地替换:optim="paged_adamw_32bit"走 bitsandbytes,而 bitsandbytes 只提供 CPU、CUDA 等后端,没有 NPU 实现;sample = -1会把整个商品目录展开,训练拉长到上万步;RLSeqTitle2SidDataset(..., sample=10000)的采样上限写在调用处,训练集切到 40 行后DataFrame.sample会抛Cannot take a larger sample than population。已知限制:这个规模下日志里的
reward、loss、grad_norm会一直是 0。rule_reward是精确匹配,1 epoch 的 SFT 命中率接近 0,ndcg_rule_reward在整组无命中时补 0,GRPO 的组内优势因此无从计算。所以 RL 段只断言流程贯通(退出码为 0,且rl_out/final_checkpoint下有权重、config、tokenizer),不比对指标。另外save_steps=0.1在按步触发下永不满足,训练过程不写 checkpoint,断言也据此避开trainer_state.json。守卫
tests/minionerec/test_quick_start_ascend.py继承doc_test.base.MarkdownDocTestBase,prepare_environment只做 CANN 环境、git与工作目录(/root/minionerec-test),其余步骤全部由文档执行。.github/workflows/minionerec-quick-start.yml只声明项目变量:fixed_ref: main(上游没有 release tag)、linux-aarch64-a2-1、cann:9.1.0-910b-ubuntu22.04-py3.12、timeout_minutes: 120,cron 取50 11,23 * * *,与现有槽位错开。克隆不做重试循环,只保留
--depth 1。该仓库单快照约 96 MiB 且集中在 4 个 17–20 MiB 的 CSV/npy,跨境链路上偶发early EOF;若后续频繁翻红再单独调整 clone 写法。站点
index.rst在「训练与微调」分组增加卡片(图标_static/images/minionerec.svg),toctree 增加sources/minionerec/index.rst。conf.py的exclude_patterns补上sources/minionerec/quick_start.md,由index.rstinclude,不单独成页。验证
PR 上的守卫已经把整份文档在 NPU 上真跑了一遍(run 42148748699,19 个步骤全部通过):克隆 9.9 s 一次成功(无重试)、依赖安装 147.6 s、HuggingFace 拉取 Qwen2.5-0.5B 与预处理数据正常、SFT 约 11 分钟、约束解码评估 CC=0、RL 13.7 分钟并落盘
rl_out/final_checkpoint。站点构建(Github Pagesbuild)也通过。doc_url在 PR 运行取 PR head SHA,GitHub 的 raw 服务可以在主仓命名空间下取到 PR head 提交,所以 fork 分支也能取到文档。