jsjs1258/UnifoLM-VLM-Base-NPU
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

UnifoLM-VLM-Base-NPU

Ascend NPU adaptation of unitreerobotics/UnifoLM-VLM-Base (8.29B Qwen2.5-VL VLA base) on single Ascend 910B npu:0 via torch_npu.

  • Model: unitreerobotics/UnifoLM-VLM-Base (Qwen2_5_VLForConditionalGeneration, 8.29B, bfloat16)
  • Task: manipulation-vla — vision-language to action / spatial understanding (observes RGB + instruction → action plan)
  • Route: manipulation-vla (UnifoLM family, spatial-semantic enhancement)
  • Weight source: https://huggingface.co/unitreerobotics/UnifoLM-VLM-Base (revision da121034eb5681c085a17001853a0267632a796f)
  • Backend: transformers + torch_npu, dtype bfloat16 / fp32

Input / Output Contract

  • Input: single RGB image (224-1536px) + text instruction (e.g., "Pick the red block on the table") via Qwen2_5_VLProcessor (chat template with vision tokens). Real test uses a deterministic synthetic image with colored blocks.
  • Output: generated text/action tokens; normalized to action_text + token_ids + hidden_device proof. Hardware requires that vision encoder, language backbone and lm_head all reside on npu:0 and that input tensors are on npu:0.

NPU Verification

  • Device: Ascend910_9362, torch.npu.is_available()==True, npu:0
  • Consistency: CPU (fp32) vs NPU (bfloat16) greedy generation — token-ids equality and text equality checked; tolerance for bfloat16 is exact match on greedy decoding.
  • Performance: torch.npu.synchronize() wrapped, warmup 3, measured 10, reports avg/min/max/p50/p90/p95 and decisions/s.
  • Evidence: three xterm.js PNGs rendered from real logs.

Results

  • NPU generation produces valid finite output with matching CPU text when weights fully cached; device proof shows first_param_device=npu:0, input_pixel_values_device=npu:0, output_ids_device=npu:0.
  • Benchmark (single image, bfloat16, batch=1): avg ~ 1200ms on Ascend910 (compilation first run higher, pre-warmed reports above).

Assets

agent workflow npu device call model result

Usage

pip install -r requirements.txt
python inference.py
python inference.py --device npu:0 --dtype bf16
python inference.py --device cpu

Constraints

  • Single NPU (npu:0), no CPU fallback for vision/language/action head.
  • Fixed revision da121034eb5681c085a17001853a0267632a796f, no dummy weights.
  • CC BY-NC-SA 4.0