gcw_6a3w2yXz/SampurNER_Bengali_MuRIL-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

SampurNER Bengali MuRIL on Ascend NPU

prachuryyaIITG/SampurNER_Bengali_MuRIL (MuRIL-large-cased backbone fine-tuned on the SampurNER Bengali dataset for fine-grained named entity recognition) adapted and verified on a single Huawei Ascend 910B NPU (npu:0) with PyTorch + torch_npu.

  • Task route: token-classification (BertForTokenClassification, 133 Few-NERD style labels)
  • Validation inputs: real Bengali sentences containing person / location / organization entities
  • CPU vs NPU consistency: entity span sets fully identical, logits cosine 0.9999974, argmax agreement 100%
  • Throughput on npu:0: ~135 sentences/s (fp32, batch=2, max_len=256), vs ~4 sentences/s on CPU

Repository layout

inference.py            # run Bengali FgNER on Ascend NPU (npu:0 by default)
readme.md               # this file
requirements.txt        # python dependencies
assets/
  agent_workflow.png    # end-to-end adaptation workflow evidence
  npu_device_call.png   # NPU environment and device placement evidence
  model_result.png      # span results, consistency metrics and performance evidence

Quick start

pip install -r requirements.txt
python inference.py --device npu:0 \
  --text "রবীন্দ্রনাথ ঠাকুর ১৮৬১ সালে কলকাতার জোড়াসাঁকোতে জন্মগ্রহণ করেন।"

The script downloads the original weights from HuggingFace on first use (or point --model at a local checkpoint directory), moves every tensor to the requested NPU device, synchronizes with torch.npu.synchronize() before timing, and decodes subword predictions into entity spans with text offsets and fine-grained labels such as person-artist/author, location-GPE and organization-company.

Verification evidence

Workflow log (environment check, route inspection, weight download, validation):

agent workflow

NPU device call proof (npu-smi info, model/input/output tensors all on npu:0, no CPU fallback):

npu device call

Model result (extracted spans, CPU/NPU consistency, throughput):

model result

Notes

  • Weights are not stored in this repository; load them from the original prachuryyaIITG/SampurNER_Bengali_MuRIL release.
  • fp32 is used on both CPU and NPU for comparability; the residual logits difference comes from fused-operator numerics on the NPU vector cores and does not change any predicted label.