Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tools/evaluation/hymotion/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
artifacts/
cache/
runtime/
sources/
data/
history/
WORK_LOG.md
*.local.json
__pycache__/
.pytest_cache/
13 changes: 13 additions & 0 deletions tools/evaluation/hymotion/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 评测项目工程约束

先读README了解运行,DATA了解输入/协议,configs/README了解参数归属;新平台实施与结果交付严格按PLATFORMS.md检查。

- 本项目服务于开发者整模型质量与性能评测;普通用户推理仍使用模型仓库CLI/API。
- 用户明确禁止history/及全部子文件进入PR或提交包。artifacts/、cache/、runtime/、sources/、data/、WORK_LOG.md也只保留本地。检查真实PR文件清单,不能仅依赖.gitignore排除已跟踪文件。
- 运行必需元数据保存在configs/,代码不得读取history/。参考源码依赖通过固定提交与兼容补丁重建,不把完整仓库快照加入提交。
- 评测执行、计时、指标和报告集中在evaluate.py,日常入口为run_eval.sh;外部模型源码不属于评测实现文件合并范围。
- 新平台需要真实设备API、容器/监控和参考基线适配及目标硬件验证;不能只复制JSON或去掉MLU检查。详细步骤、A100接线点、测试矩阵和结果目录见PLATFORMS.md。
- 源码、权重、输入、配置及计时边界必须固定;旧结果不能冒充新源码/平台的新实测,失败和缺失不能从分母删除。
- 变更运行前准备/路径时,验证只含拟提交文件的目录可完成源码准备和输入检查;不依赖作者工作区、预装runtime或旧缓存。
- 修改配置/指标时先运行相关CPU测试,再按受影响范围补实际设备smoke;已有有效证据可复用,不无故重跑整套性能矩阵。
- 原始大产物在独立存储保留SHA清单;经过清理的正式摘要可按PLATFORMS.md提交results/。README保持简洁,不堆放本地工作历史和平台bring-up清单。
19 changes: 19 additions & 0 deletions tools/evaluation/hymotion/DATA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Frozen inputs and assets

HumanML3D official test split: 4,384 motions, first caption per motion; 4,198 references satisfy the official 40 <= frames < 200 feature-evaluator interval. All 4,384 are generated and timed. Original 20–360-frame model clamping is retained; requested-length completeness is reported separately.

The checked-in JSONL manifests under configs/common freeze IDs, prompts and selection. They contain no generated results or local workspace paths. Manifests and external assets have SHA256 locks. `--paths` maps relative paths to your provisioned roots; it is not a dataset download switch. Do not regenerate a different fixture under the same name. Preserve failed/missing inputs in the denominator.

HumanML3D mirror: `TeoGchx/HumanML3D@9265d4c3669b95d848607954fa653884ff7715ab`, data/test-00000-of-00002.parquet and test-00001-of-00002.parquet, laid out as `data_root/bench/humanml3d/TeoGchx/data/`. Test order matches the official test split; first caption tokens are frozen in the manifest. Original HY-Motion geometry/stats must be materialized with git-lfs in the pinned native checkout. The complete native LFS assets are used, not the pruned inference-only assets.



Model repository and revision are in `configs/common/weight-lock.json`. Use `huggingface_hub.snapshot_download(repo_id=..., revision=..., local_dir=...)`, then verify every listed file with check-inputs. Inference PR requirements/installers document accelerator and model dependencies; preserve licenses and obtain access to gated model weights yourself. This PR distributes no weights. Weight hashes include tokenizers/configs used by the inference and metric networks.

Qwen3-8B and CLIP ViT-L/14 need complete tokenizer/config/safetensors trees. HumanML author assets: Google Drive evaluator archive `19C_eiEr0kMGlYVJy_yFL6_Dhk3RvmwhM` and GloVe archive `1cmXKUT31pqd7_XpJAiWEo1K81TMYHA5n`, referenced by the pinned Momask prepare/download_evaluator.sh and download_glove.sh. Extract to metric_assets; expose evaluator checkpoint as metric_checkpoints/t2m/text_mot_match/model/finest.tar. The asset lock verifies the actual files. prepare-sources downloads just the locked author evaluator modules and applies two explicit compatibility fixes: removed np.float→np.float64 and clip negative distance roundoff before sqrt. Both original and patched hashes are locked.



Quality protocol: Authors’ Momask/HumanML3D evaluator: R-Precision@1/2/3, matching score, FID, diversity. Native fixed-skeleton FK, linear 30→20 FPS resampling and authors’ canonical 263-D extraction. Paired central crop to min(prediction, reference, 196), multiple of 4; original evaluator normalization; retrieval batch size 32 including last batch; diversity seed 42, 300 pairs. Length exclusions are explicit, never removed from generation coverage.

Duration-to-frame conversion follows the original Python expression `int(round(duration_s * 30))`, followed by its 20–360 clamp. Do not substitute a theoretically rounded precomputed frame field: binary floating-point values such as 4.15 and 2.05 can differ by one frame. The reference environment follows the original requirements without optional ftfy; the inference configuration explicitly selects its matching `clip_text_cleanup: basic`, reusing Transformers BasicTokenizer.
5 changes: 5 additions & 0 deletions tools/evaluation/hymotion/PLATFORMS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Platform validation

Only NVIDIA A100 has an implementation in this package. For MLU/MetaX/Ascend NPU, provide native-project runtime parity, device synchronization/seed/memory APIs, a host-visible resource attribution mechanism, dependency/source locks and single-device complete-dataset evidence before enabling a launcher. Copying CUDA JSON values is not validation. Placeholder launchers fail immediately with exit code 2.

Submit only this evaluation directory. Exclude history/, artifacts/, cache/, runtime/, sources/, data/, WORK_LOG.md and all local paths. Before submission inspect the actual git diff and GitHub PR file list. Put sanitized proven summaries under results/nvidia; record source/evaluator hashes, full coverage, failures, quality metrics, end-to-end distribution, native ratios, GPU UUID and evidence archive hashes. Never describe a partial smoke test as a complete campaign.
50 changes: 50 additions & 0 deletions tools/evaluation/hymotion/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# hymotion original-project / LightX2V evaluation

This developer-only package calls the pinned original implementation and inference PR from `configs/nvidia/source-lock.json`. It does not copy model networks or modify the user-facing inference API. Each implementation runs the full frozen dataset once at batch size one.

## Reproduce

Use Python 3.10 on an otherwise idle NVIDIA A100 40 GB. Native and LightX2V can have separate Python environments; do not mix their torch/transformers installations. Keep outputs on a filesystem with sufficient space. CPU-only source preparation and input checking use the standard library.

```bash
EVAL=tools/evaluation/hymotion
python3 "$EVAL/evaluate.py" prepare-sources --workspace /absolute/eval-sources
# Provision weights/data/evaluator assets according to DATA.md, install the
# native upstream dependencies plus runtime-requirements-native.txt.
# For LightX2V use the pinned inference source's scripts/hymotion/install_a100.sh.
# Copy configs/nvidia/paths.json to paths.local.json and fill all absolute roots.
python3 "$EVAL/evaluate.py" check-inputs --paths paths.local.json
bash "$EVAL/scripts/platform/nvidia/run_eval.sh" campaign \
--paths paths.local.json --dataset humanml3d \
--gpu GPU-REPLACE-WITH-FULL-UUID --output /absolute/results/hymotion --count 256
```

Run each model–dataset campaign on exactly one fixed GPU. Different campaigns may run on different idle GPUs. Native and LightX2V chunks alternate serially on that same device; no cross-card sharding. Resource capture/check reuse the pinned LightX2V `tools/runtime/gpu_watch.py`; the host must expose real GPU PIDs and their /proc ancestry. MPS, MIG and proxy attribution are unsupported. Execute the campaign from the GPU host, not an isolated PID namespace.

Each child workload has GNU timeout 3300 s, kill-after 20 s, and live resource checks. A campaign consists of successive bounded chunks; the parent may live longer than one hour. Keep the parent terminal/job alive. Resume with the same dataset, GPU, source and paths: completed verified input ranges are skipped. `--count` may change within [1,256] for future workers; it bounds process lifetime while per-request batch size remains one. The original plan and every subsequent requested chunk size are retained. Existing outputs, timing records and source fingerprints are preserved. Failed, partial or resource-invalid chunks stop the campaign and retain evidence; investigate before attempting a fresh campaign. Formal samples are never silently retried or dropped. `--skip-score` stops after generation; `score` and `compare` are also available independently.

## Protocol

HumanML3D official test split: 4,384 motions, first caption per motion; 4,198 references satisfy the official 40 <= frames < 200 feature-evaluator interval. All 4,384 are generated and timed. Original 20–360-frame model clamping is retained; requested-length completeness is reported separately.

Authors’ Momask/HumanML3D evaluator: R-Precision@1/2/3, matching score, FID, diversity. Native fixed-skeleton FK, linear 30→20 FPS resampling and authors’ canonical 263-D extraction. Paired central crop to min(prediction, reference, 196), multiple of 4; original evaluator normalization; retrieval batch size 32 including last batch; diversity seed 42, 300 pairs. Length exclusions are explicit, never removed from generation coverage.

End-to-end latency begins before request decoding and input file read, and ends after inference, CPU conversion, final NPZ serialization, fsync and GPU synchronization. Model loading, RNG reset, harness directory creation, SHA hashing, output validation, logs and quality scoring are outside this interval. Loading is recorded separately. Each loaded process uses one separate synthetic/upstream-demo warmup, never a dataset sample. Report mean, median, P95 and every sample’s latency. No five-repeat averaging. Final artifact durability measures the filesystem’s fsync contract, not independent storage replication. No auxiliary preview is required; old timings with preview/export or different boundaries are not interchangeable.

The comparison requires complete one-to-one coverage, verified resource isolation/cleanup, exact final PNG/GLB bytes or exact NPZ array keys/dtypes/shapes/elements, finite quality metrics matching within 1e-5 absolute roundoff, and default latency ratios mean≤1.25/P95≤1.5. These configurable latency gates are engineering criteria, not official dataset thresholds. A failure remains a failure and blocks an alignment claim. Discrete GPU sampling cannot establish absence of sub-sample interference or CPU/network contention.

## Evidence and platforms

`run.json`, per-sample JSONL, immutable final outputs and hashes, commands, environments, original-source pins, resource samples and PID/start-tick/task cleanup records are retained outside git. `quality.json`, `latency.json` and `comparison.json` are generated from checked complete coverage. Large artifacts, datasets, weights, upstream repositories and local absolute paths never enter this PR. Sanitized full-run summaries may be published under `results/nvidia/` only after actual validation. CPU tests: `python -m unittest discover -s "$EVAL/tests"`.

NVIDIA A100 wiring is implemented. MLU, MetaX and Ascend NPU are explicit placeholders whose launchers exit 2; see PLATFORMS.md. No target-device results are inferred from A100.

Resource completion uses an explicit worker/controller acknowledgement: after all work and outputs complete, the worker retains its PID until capture obtains a post-workload sample. Process/CUDA teardown then occurs with separate cleanup verification. This prevents disappearing /proc lineage at interpreter exit from being mistaken for a competing process; unknown lineage within the measured workload still fails. The acknowledgement wait is outside per-input end-to-end latency.

NVIDIA capture defaults to a 0.25 s polling interval, a bounded 2.5 s query budget and a 3 s maximum completed-sample gap. `LIGHTX2V_EVAL_RESOURCE_QUERY_TIMEOUT` and `LIGHTX2V_EVAL_RESOURCE_MAX_GAP` select explicit per-run limits. Every archived capture retains its actual limits and sampler fingerprint; published full-run summaries group those profiles under `resources.*.capture_sources`. An earlier failed attempt is never accepted retroactively under different limits. Query failures within the checked coverage window, missing coverage and unknown process ancestry invalidate that attempt; partial timing records are retained separately.

NVIDIA telemetry, worker logs and completion acknowledgements use local `/tmp` during execution (`LIGHTX2V_EVAL_RESOURCE_SCRATCH` can select another fast local directory). Evidence is archived to the configured result directory before a completed chunk becomes resumable. Failed archives retain local files and record their location in `resources/*/staging.json`. Model artifacts and their fsync are timed on the configured output filesystem.

For bounded minimal NVML acquisition, install `nvidia-ml-py==12.550.52` in a separate Python environment, export `LIGHTX2V_EVAL_RESOURCE_BACKEND=nvml` and `LIGHTX2V_EVAL_RESOURCE_PYTHON=/absolute/monitor-env/bin/python`. The shared `tools/runtime/nvml_capture.py` calls the pinned inference source's existing `gpu_watch` capture/check and ancestry policy. It reads UUID, memory, utilization, compute/graphics and MPS inventories; missing APIs, MIG or MPS fail closed. Query and gap limits use the explicit settings above, including the 2.5 s / 3 s defaults. Include that shared file when copying this evaluation package. The default XML backend needs no extra binding.

Generation workers initialize their single visible CUDA primary context before CPU model preparation. This reduces the window in which another automatic device selector can mistake the loading worker for an idle card. Resource attribution and early/late samples still apply; model preparation remains outside request timing.
7 changes: 7 additions & 0 deletions tools/evaluation/hymotion/THIRD_PARTY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# External code and weights

Model inference comes from the fixed ModelTC/LightX2V inference PR, and the original model project/package pinned in configs/nvidia/source-lock.json. No external model implementation is vendored in this evaluation PR. Check each source’s license and model/data access terms before downloading or redistribution.

The HumanML feature networks, skeleton/motion conversion and metric functions are imported from EricGuo5513/momask-codes at the locked commit. Runtime compatibility changes have both source and patched SHA256 values in source-lock.json. Benchmark-specific FK/resampling, cropping and aggregation live in evaluate.py. HumanML3D, GloVe, Qwen and CLIP assets remain external.

Optional NVIDIA resource acquisition uses NVIDIA `nvidia-ml-py` 12.550.52 (BSD license), installed separately and not vendored. Resource policy and PID ancestry remain provided by the pinned LightX2V `gpu_watch.py`.
11 changes: 11 additions & 0 deletions tools/evaluation/hymotion/configs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Configuration ownership

common/suite.json defines immutable coverage, fixture SHA256 and timing boundaries. The sibling JSONL manifests fix exact input selection. common/weight-lock.json fixes model revision and every required weight/evaluator/data asset hash.

nvidia/model.json is the inference PR’s supported configuration. nvidia/source-lock.json pins external original/LightX2V/evaluator code. nvidia/runtime.json documents one-device admission, limits and alignment gates. nvidia/paths.json is a portable template, never a ready-to-run machine configuration: copy it to an ignored *.local.json and replace placeholders with absolute paths. native_python/lightx2v_python/metric_python select independent environments. The native and adapted runs share inputs, model checkpoint, seed and final artifact format.

For GenEval, geneval_python selects the legacy detector environment; geneval_weights holds the detector .pth; geneval_configs is the mmdetection config tree; geneval_config is its complete mask2former_swin-s-p4-w7-224_lsj_8x2_50e_coco.py filename. geneval_clip is the cache directory holding the locked OpenAI ViT-L-14.pt checkpoint. metric_python for CLIPScore/HumanML must have the necessary torch/transformers/pyarrow/SciPy packages and the metric assets. Local configuration files are never imported as Python.

Other platform JSONs are explicit unimplemented slots. There is no claim that their original reference runtime or operators have been validated.

For recovery of an interrupted campaign after a controller-only fix, an ignored local paths file may optionally set `worker_script` to the archived measured evaluate.py. The controller requires identical non-controller Python AST and identical JSON/JSONL configurations, retains that worker’s original SHA in measurement records and campaign identity, and records the new resource-bootstrap SHA separately. Changed model, timing, input or metric functions are rejected. This option does not rewrite or rebrand previous measurements. Fresh campaigns use the submitted evaluate.py itself.
4 changes: 4 additions & 0 deletions tools/evaluation/hymotion/configs/ascend_npu/model.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"model": "hymotion",
"status": "not_implemented"
}
3 changes: 3 additions & 0 deletions tools/evaluation/hymotion/configs/ascend_npu/paths.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"status": "not_implemented"
}
4 changes: 4 additions & 0 deletions tools/evaluation/hymotion/configs/ascend_npu/runtime.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"status": "not_implemented",
"reason": "Requires device-specific runtime and original-project baseline validation."
}
3 changes: 3 additions & 0 deletions tools/evaluation/hymotion/configs/ascend_npu/source-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"status": "not_implemented"
}
Loading