datalab-to/chandra-ocr-2Qwen3_5ForConditionalGeneration (qwen3_5) - Vision-Language OCR, not tabular重要: 本模型被任务标记为“表格数据”,但实际架构为 VLM (image-text-to-text),npu-adapt-tabular 的 inspect_model.py 判定为 unknown 家族,不属于 tabular/time-series 路线。按 tabular 技能的硬性规则,表格图片应路由到视觉/OCR 技能。本仓按 VLM 逻辑实现 NPU 适配,并如实记录 tabular 路由的失败原因。
npu-smi OK执行:
npu-smi info
python -c "import torch; import torch_npu; print(torch.npu.is_available()); print(torch.npu.get_device_name(0))"结果: torch.npu.is_available()=True, device_name=Ascend910_9362
pip install torch==2.9.0 torch-npu==2.9.0.post1 transformers==4.57.1 pillow numpy pandas safetensors
# 注意: 完整推理需 transformers>=5.2.0: pip install git+https://github.com/huggingface/transformers.git
pip install -r requirements.txtpython inference.py默认会:
/tmp/chandra-full 优先) 和权重完整性npu:0 上执行 dummy tensor 同步测试AutoModelForImageTextToText 并 generate (若权重完整且 transformers 兼容)由于权重下载带宽限制 (见第 9 节) 和 transformers 版本不匹配,当前环境下真实端到端 generate 未完成,但 NPU 设备调用已验证。
NPU 设备调用 (真实执行):
torch_npu_available: True
npu_device: Ascend910_9362
NPU dummy tensor: device=npu:0 shape=torch.Size([2, 3]) PASS
torch.npu.synchronize() ok权重状态 (真实):
/tmp/chandra-full/model.safetensors size=335544320 bytes (0.31 GiB) header incomplete
expected 10591220088 bytes (9.86 GiB)
Error while deserializing header: incomplete metadata, file not fully coveredTransformers 兼容性 (真实):
processor load failed: model type `qwen3_5` but Transformers does not recognize this architecture.
Requires transformers>=5.2.0 (current 4.57.1)合成表格输入 (真实):
synthetic_image: size=(800, 400) mode=RGB, 3x3 table with headers结论: NPU 设备 PASS,模型核心 generate 因权重不完整和版本不匹配而 FAIL。已如实记录,未伪造文本输出。
由于模型权重不完整,无法进行 CPU vs NPU 的 logits/probabilities 对比。按 tabular 技能要求,一致性工具 compare_outputs.py 需完整输出,本次仅完成 NPU 设备可用性验证 (dummy tensor)。
若权重完整且 transformers 升级后,预期对比:
python scripts/compare_outputs.py --cpu cpu.npy --npu npu.npy --task regression --atol 1e-4 --rtol 1e-3当前: 未完成 - 需完整权重和兼容环境。
NPU 同步耗时 (dummy):
torch.npu.synchronize() 前后计时的 2x3 dummy tensor: <1msmodel.generate 延迟完整模型预期 (官方 H100 0.7-1.44 pages/s),Ascend 上需完整权重后重测,报告 avg/min/max/p50/p90/p95, batch=1, dtype=bf16, 峰值显存。
本次三张证据图由 scripts/render_xterm_evidence.mjs --style raw 从真实日志生成,固定提示符 atomgit@pod-a94f8701860f4700b161b00e290de466:~$ :
assets/agent_workflow.png - 侦察、下载、NPU 检查、验证流程assets/npu_device_call.png - npu-smi info, torch.npu.is_available(), 设备名, dummy NPU tensorassets/model_result.png - python inference.py 完整输出 (含 PASS/FAIL)图片由 xterm.js 根据本次真实日志渲染,非 Pillow 模拟。

npu-adapt-tabular 判定 unknown, 按技能应转视觉/OCR 路线。本仓为满足“表格数据”标题,按 VLM 表格抽取实现,但 tabular 专项验收 (分类/回归) 不适用。us.aws.cdn.hf.co 直接 0.3 MB/s, ModelScope 1.5 MB/s, 10.5GB 需 90-540 分钟。30 分钟内仅下载 0.3GB (3%),测试中 335MB 耗时 15 分钟。transformers==5.2.0 (qwen3_5), 环境为 4.57.1, 需 pip install git+https://github.com/huggingface/transformers.git。/tmp/chandra-full/model.safetensors 仅 0.31GB, header 不完整,无法 safe_open。generate 未完成。按硬性规则,不应宣称“适配成功”。#NPU
Hardware: NPU, Ascend910, Ascend910B, OCR, VLM, table-extraction
本 README 按
npu-adapt-tabular的submission-gitcode.md结构编写,但如实披露了 VLM 路由和未完成的 NPU 端到端验证。