This repository provides a local-only Ascend NPU inference entry for
infinity1096/UFM-Refine-980. It performs a real optical-flow refinement
forward and does not provide CPU or CUDA execution paths.
f3de6c4308664331d56dff4f4e014f42703d7300ff78d6c3db807c91578acccb58ee67d4394d5e5fee7fa0b50d8295b3f0485e42c1d133fb534bfce77764ea0f912e53c92e82eb78a2a1631e92725fc8Prepare the pinned model and source repositories next to this repository:
git clone https://gitcode.com/hf_mirrors/infinity1096/UFM-Refine-980.git ../model
git -C ../model checkout f3de6c4308664331d56dff4f4e014f42703d7300
git -C ../model lfs pull
mkdir -p ../third_party
git clone https://github.com/infinity1096/UFM.git ../third_party/uniflowmatch
git -C ../third_party/uniflowmatch checkout ff78d6c3db807c91578acccb58ee67d4394d5e5f
git clone https://github.com/infinity1096/UniCeption.git ../third_party/UniCeption
git -C ../third_party/UniCeption checkout ee7fa0b50d8295b3f0485e42c1d133fb534bfce7
git clone https://github.com/facebookresearch/dinov2.git ../third_party/dinov2-source
git -C ../third_party/dinov2-source checkout 7764ea0f912e53c92e82eb78a2a1631e92725fc8Use compatible CANN, PyTorch and torch_npu platform packages and install only
the model-layer dependencies into a relative overlay:
python3 -m pip install --target ../pydeps -r requirements.txt
export PYTHONPATH="$PWD/../pydeps:$PWD/../third_party/uniflowmatch:$PWD/../third_party/UniCeption:$PYTHONPATH"The verified environment used CANN 9.0.0, Python 3.11, PyTorch 2.10.0 and
torch_npu 2.10.0.
source /usr/local/Ascend/ascend-toolkit/set_env.sh
OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 python3 inference.py \
--model_path ../model \
--dinov2_path ../third_party/dinov2-source \
--device npu:0 \
--seed 20260812 \
--output_json result.jsonThe entry requires npu:N, strictly loads the local checkpoint, applies the
Ascend-compatible float32 attention and exact-erf GELU adaptations, moves the
model and inputs to the NPU, and invokes the real model forward. Exit 0 requires
8 samples, the expected output fields and shapes, 1,580,544 total values, finite
outputs, and model/input/output device consistency.
The public GitCode repository contains the primary three images:
assets/agent_workflow.pngassets/npu_device_call.pngassets/model_result.pngThe secondary set is archived at modelagent-picture/UFM-Refine-980.
Weights are not redistributed here. The deterministic synthetic inputs verify the execution contract and are not an optical-flow benchmark.
本仓为 2301_76761127 队伍交付件(与备份账号合并提交)。