AGENT SKILL

setup-and-weights

Installs and diagnoses the official FlashVSR CUDA/LCSA runtime, validates v1 or v1.1 model bundles, and wires ModelManager, projection, decoder, and context assets.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
setup-and-weights
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Installs and diagnoses the official FlashVSR CUDA/LCSA runtime, validates v1 or v1.1 model bundles, and wires ModelManager, projection, decoder, and context assets.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

FlashVSR Setup and Weights

Use this sub-skill before any FlashVSR model allocation. It owns the Python, PyTorch, CUDA, Block-Sparse-Attention, model-bundle, ModelManager, projection, decoder, and positive-context gates. Route prepared video geometry, temporal framing, full/tiny/tiny-long selection, and pipeline calls to inference.

Route by symptom

  • Fresh install, pkg_resources, compiler, CUDA, or extension build: read install.md.
  • Acquire or validate v1/v1.1 files; wire ModelManager and support modules: read weights-and-model-manager.md.
  • Import, LFS pointer, detector, state-dict, context, or memory failure: read troubleshooting.md.

Required target profile

The verified backend-smoke profile is Python 3.11, PyTorch 2.6.0+cu124, CUDA 12.4, and NVIDIA A100 SM80. FlashVSR's official Wan DiT imports and calls block_sparse_attn; a CUDA-enabled torch import alone is not sufficient. Build the extension separately for the target toolkit/ABI/SM profile and require:

python -c "from block_sparse_attn import block_sparse_attn_func; print('LCSA import OK')"

The import gate and a small bf16 CUDA streaming-attention call passed on the profile above. Real FlashVSR checkpoint loading remains a separate native gate. Run the bundled read-only diagnostic from any directory:

python <skill-root>/sub-skills/setup-and-weights/scripts/check_environment.py

It reports target-version and backend readiness without downloading, building, or printing module/cache locations.

Version-atomic weight gate

Use one application-owned model directory containing the official v1 or v1.1 files:

diffusion_pytorch_model_streaming_dmd.safetensors
Wan2.1_VAE.pth
LQ_proj_in.ckpt
TCDecoder.ckpt
README.md

Before ModelManager, reject missing, empty, and Git LFS pointer files:

python <skill-root>/sub-skills/setup-and-weights/scripts/check_weights.py \
  <MODEL_DIR> --version v1.1

Do not mix versions. Full uses the DiT and Wan VAE; tiny and tiny-long use the DiT and TCDecoder. All routes use the matching LQ projection and positive cross-attention context.

Wiring invariants

  • Construct ModelManager(torch_dtype=torch.bfloat16, device="cpu"); load explicit local files and stop unless wan_video_dit is detected. Full must also detect wan_video_vae.
  • v1 uses Buffer_LQ4x_Proj; v1.1 uses Causal_LQ4x_Proj. Both use (in_dim=3, out_dim=1536, layer_num=1) and load LQ_proj_in.ckpt strictly.
  • Tiny routes build TCDecoder with channels [512,256,128,128] and latent channels 16+768; load non-strictly but review all missing/unexpected keys.
  • Package projection/decoder support in the application. They are not stable public diffsynth exports; do not depend on a source-checkout utility path.
  • Load an application-owned context tensor, require shape [1,512,4096], and call pipe.init_cross_kv(context_tensor=context) once before inference.

Verification boundary

Completed: package and FlashVSR-class imports, CUDA hardware probe, block_sparse_attn import, bf16 kernel smoke, diagnostic helper checks, and synthetic incomplete-bundle checks. Not completed: real v1/v1.1 checkpoint loading, strict projection/decoder compatibility against published weights, or full/tiny/tiny-long model inference. Do not promote setup checks into an end-to-end inference claim.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351