2301_76761127/videoflextok_d18_d28-npu
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

EPFL-VILAB/videoflextok_d18_d28 on Ascend NPU

This repository runs the complete VideoFlexTok D18/D28 encoder, FSQ bottleneck, flow decoder and VidTok VAE path on Ascend NPU. The only model checkpoint is model.safetensors from the fixed model revision below.

Fixed sources

  • Model: https://ai.gitcode.com/hf_mirrors/EPFL-VILAB/videoflextok_d18_d28
  • Model revision: b08f2d168ce208b54b15e55d427ca1fb5910168c
  • Selected metadata: config.json (12,157 bytes, SHA-256 2b818e1d12f7c9a18e20379b33dbf379815cfc3c4b3d6cc96d8527e2740c0e74)
  • Required weight: model.safetensors (10,779,872,388 bytes, SHA-256 d54e409a198cf6364bd7d0a70503d29fd898ea5110b10a563ba087dc88a77ce2)
  • Checkpoint header: 832 tensors, all official F32; no quantized alternative is selected
  • Official runtime source: https://github.com/apple/ml-videoflextok.git
  • Runtime source commit: 4fd72ec0c0c8c05f879012cce285d5a14c81920f
  • Runtime source delivery: the exact tracked Python/runtime tree is vendored under source/ml-videoflextok; large demo GIF/PNG/MP4/notebook LFS assets are deliberately excluded because inference does not import or read them
  • License: Apache-2.0

No quantized alternative, sample video or unrelated asset is required.

The accepted rolling-cache copy was downloaded directly from GitCode at the fixed revision above. Every selected file passed the exact byte-count and SHA-256 gates before WEIGHT_READY; no weight was transferred with SCP.

Restore

The platform supplies compatible torch and torch_npu. Install the pinned user-space dependencies with the required mirror:

test ! -e "$PWD/pydeps"
python3 -m pip install --no-deps --no-build-isolation \
  --target "$PWD/pydeps" \
  -r requirements.txt \
  -i https://pypi.tuna.tsinghua.edu.cn/simple
test ! -e "$PWD/pydeps/torch"
test ! -e "$PWD/pydeps/torch_npu"
test "$(cat source/ml-videoflextok/SOURCE_COMMIT)" = 4fd72ec0c0c8c05f879012cce285d5a14c81920f
python3 -m compileall -q source/ml-videoflextok/videoflextok

diffusers==0.39.0, its compatible huggingface-hub==0.36.0, and Hydra's required antlr4-python3-runtime==4.9.3 are immutable PyPI releases available through the required Tsinghua mirror; no dependency install requires GitHub access. The official container's CANN 8.5.1, torch==2.9.0, torch_npu==2.9.0.post1, and torchvision==0.24.0 stack is reused.

Fresh empty-target import passed in the 2026-08-20 ModelAgent container with torch==2.9.0, torch_npu==2.9.0.post1, diffusers==0.39.0, huggingface-hub==0.36.0, numpy==1.26.4, omegaconf==2.3.0 and the vendored videoflextok.wrappers.VideoFlexTokFromHub. No torch package exists in the independent pydeps target.

Run one complete real forward:

export PYTHONPATH="$PWD/pydeps${PYTHONPATH:+:$PYTHONPATH}"
python3 inference.py \
  --model /data/atomcode-lanes/heavy19-20260820/p4r76-videoflextok-d18-d28/model \
  --source "$PWD/source/ml-videoflextok" \
  --device npu:0 --steps 1 \
  --output /data/atomcode-lanes/heavy19-20260820/p4r76-videoflextok-d18-d28/audit-final/result.json

Input synthesis is configuration-only. Encoder, quantizer, flow decoder, VAE and all learned model computation run on NPU. There is no CPU/CUDA bridge or fallback.

The official checkpoint is entirely F32, so the synthetic input is created with the loaded model dtype. Upstream FlexAttention rejects NPU tensors; the vendored Ascend adapter materializes the unchanged upstream block-mask function on NPU and calls native PyTorch SDPA on NPU. It rejects an unhandled score_mod instead of silently changing attention semantics.

Verified ModelAgent run

The final run used PID 24863 on npu:0. It completed the full encoder, FSQ, flow decoder and VidTok VAE path in 29.4301 seconds. The saved token shape is [1, 5, 256], the reconstructed video shape is [1, 3, 17, 256, 256], and model, input, token and output devices are all npu:0. The live process used 27,619 MiB of NPU memory while held for evidence.

Hosted evidence slots

After the real full-model NPU run, publish exactly three real PNG files under assets/; placeholders or evidence from another run are forbidden:

  • assets/agent_workflow.png: the real ModelAgent planning exchange;
  • assets/npu_device.png: the live Python PID and matching npu-smi process;
  • assets/npu_result.png: the same run's saved JSON result showing the complete encoder, FSQ, flow-decoder and VAE device chain.

本仓为 2301_76761127 队伍交付件(与备份账号合并提交)。