已关闭
[Bug-Report|缺陷反馈]: Wikitext 数据集加载失败导致 PPL 评估中止 #192
李腾67创建于  12 天前关闭于  6 天前
李腾67
李腾67
12 天前 创建

Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.

Describe the current behavior / 问题描述 (Mandatory / 必填)

AMCT 在执行 Qwen3 PPL 评估时,调用 datasets 加载 Wikitext-2 测试集失败,导致评估流程中止。

原代码使用:
load_dataset("wikitext", "wikitext-2-raw-v1", split="test")

在当前 Hugging Face 依赖环境下,该名称被解析为:
hf://datasets/wikitext@.../.huggingface.yaml

随后报错:
Repository id must be 'namespace/name', got 'wikitext'

将数据集 ID 修改为完整名称 Salesforce/wikitext 后,数据可以下载,但读取 Parquet 文件时继续出现:
pyarrow.lib.ArrowInvalid: Index not in dictionary bounds

涉及环境版本:
datasets==5.0.1
pyarrow==25.0.0

该问题导致 Wikitext 测试集无法加载,PPL 评估无法继续。

临时解决方法

  1. 将数据集 ID 修改为 Salesforce/wikitext。
  2. 清理 Hugging Face 的 Wikitext 缓存。
  3. 使用兼容版本:
    datasets==3.6.0
    pyarrow==18.1.0

修改后,Wikitext 数据集能够正常加载,PPL 评估可以继续。

Steps to reproduce the issue / 重现步骤 (Optional / 选填)

  1. 进入 AMCT 仓库目录。
  2. 配置 CANN、torch_npu 和模型环境。
  3. 安装 datasets、pyarrow 等依赖。
  4. 执行:
    python3 -m amct_pytorch.eval
    --model "$MODEL_DIR"
    --model_name qwen3
    --seq_len 4096
    --granularity block
    --device npu:0
    --eval_mode bf16
    --bit_config amct_pytorch/configs/bf16.yaml
  5. 评估流程在加载 Wikitext-2 测试集阶段失败。

File: amct_pytorch/common/datasets/preproc.py

Original call:
load_dataset('wikitext', 'wikitext-2-raw-v1', split='test')

Error:
huggingface_hub.errors.HfUriError:
Invalid HF URI 'hf://datasets/wikitext@.../.huggingface.yaml'.
Repository id must be 'namespace/name', got 'wikitext'

After changing to Salesforce/wikitext:

pyarrow.lib.ArrowInvalid:
Index not in dictionary bounds

datasets.exceptions.DatasetGenerationError:
An error occurred while generating the dataset

likedislike
fujun19成员
11 天前 评论:

反馈已收到,我们将尽快评估

likedislike
fujun19成员
11 天前 评论:

/assign @SwaggyAlex

likedislike
CANN-robotCANN-robot成员
11 天前 将 SwaggyAlex 设为负责人
Ffujun19成员
6 天前 关联了pull request:修复 load_dataset 中 传参为wikitext2 带来的下载数据集报错问题
Ffujun19成员
6 天前 关联了pull request:fix: update remaining wikitext dataset references
zhangyi
zhangyi成员
6 天前 评论:

感谢您的建议,我们已经在PR#300 中做出了修改

likedislike
zhangyizhangyi成员
6 天前 issue状态由 进行中 改变为 已完成
zhangyizhangyi成员
6 天前 关闭了 issue
CANN-robotCANN-robot成员
5 天前 添加了label:resolved