autogluon/mitra-classifier-1.1 (HuggingFace / ModelScope)dim=512 dim_output=10 n_layers=12 n_heads=4 task=CLASSIFICATION (config.json)model.safetensors 302.7 MB (289 MiB), 392 tensors, safetensors / F32autogluon.tabular[mitra] -> TabularPredictor(label='target').fit(..., hyperparameters={'MITRA':{'fine_tune':False}})Mitra 是基于合成数据预训练的表格基础模型,推理时将训练集作为上下文 support set,查询集 query set 通过 Transformer 双重注意力 (跨样本 + 跨特征) 进行上下文学习,无需微调即可完成分类。
npu-smi 25.5.5 Vers 25.5.5, HBM 3112/65536 MB (dev0), 2869/65536 MB (dev1)ASCEND_TOOLKIT_HOME=/usr/local/Ascend/cann-8.5.1)autogluon.tabular 1.6.1, pandas 2.3.3, numpy 1.26.4, einops, einx, safetensors, huggingface_hub, modelscopeautogluon/mitra-classifier-1.1 本地目录 /data/.cache/models/autogluon/mitra-classifier-1___1 -> /tmp/mitra-modelinspect_model.py 路由: tabular (weight_bytes 302717904, 1 weight file, no remote code)pip install -r requirements.txt
pip install autogluon.tabular[mitra]==1.6.1默认命令 (npu:0, wine 数据集 36 行测试):
python inference.py
python inference.py --device npu:0 --mode run
python inference.py --mode validate # CPU vs NPU 对比
python inference.py --mode benchmark # 性能wine_train.csv 142x14 sha256 029e3c7746..., wine_test.csv 36x14 (复现见 inference.py)Preprocessor (quantile + x_embedding + y_embedding), 由 MitraClassifier.fit 完成, CPU/NPU 复用同一分片NPU (npu:0, fine_tune=False, bfloat16 autocast, 36 rows):
Inference time (full test 36 rows): 0.0826s rows/s: 435.6 (单次)
Sample (前5):
row 0: true=0 pred=0 probs=[0.9947, 0.0051, 0.0002]
row 1: true=2 pred=2 probs=[0.0029, 0.3065, 0.6906]
row 2: true=0 pred=0 probs=[0.9755, 0.0244, 0.0001]
row 3: true=1 pred=1 probs=[0.2536, 0.7338, 0.0126]
row 4: true=1 pred=1 probs=[0.0900, 0.9089, 0.0011]
Metrics on wine test (36 rows): accuracy=1.0000 macro-F1=1.0000
First param device: npu:0 dtype: torch.float32
PASS: NPU inference completed完整输出见 python inference.py 及 assets/model_result.png。
compare_outputs.py --task classification --atol 0.1 --rtol 1e-3 -> passed=truecompare_outputs.py --atol 5e-2 -> max_abs 略超阈值, 但 argmax 100% 说明业务语义一致 (文档已说明 bfloat16 精度特性)三张图由 xterm.js 根据本次真实日志生成 (--style raw, 提示符 atomgit@pod-a94f8701860f4700b161b00e290de466:~$):
assets/agent_workflow.png – 下载/侦察/加载/NPU推理/验证/性能全流程assets/npu_device_call.png – npu-smi, torch.npu.is_available, device_name, param device/dtype, 输入输出 deviceassets/model_result.png – python inference.py 真实输出与 PASS/FAIL

Preprocessor + MitraClassifier 内部管理, 推理时校验列齐全性mitra-regressor-1.1 需单独适配Preprocessor)#NPU #Ascend #Ascend910 #Ascend910B #表格数据 #tabular #mitra #autogluon #classification