#!/usr/bin/env bash # Smoke: one EasyCom session on one GPU via streaming_turn_model_directly.py # # Short smoke (default): --end only, NO --target # (passing both requires --end == full target duration) # Full session: END= (empty) and --target is used set -euo pipefail # Remote defaults (override as needed) PROJECT_ROOT="${PROJECT_ROOT:-/data1/yfzx/wangx/Code/icassp2027-experiment}" MODEL="${MODEL:-/data1/yfzx/wangx/Models/Qwen2.5-Omni-3B}" VIDEO_ROOT="${VIDEO_ROOT:-/data1/yfzx/wangx/Datasets/easycom/extracted_easycom/Main/Video_Compressed}" TARGET_ROOT="${TARGET_ROOT:-/data1/yfzx/wangx/Datasets/easycom/target_frame}" FEATURE_ROOT="${FEATURE_ROOT:-${PROJECT_ROOT}/features/easycom_direct_smoke}" LOG_ROOT="${LOG_ROOT:-${PROJECT_ROOT}/logs/easycom_direct_smoke}" SESSION_ID="${SESSION_ID:-1}" GPU="${GPU:-0}" MODE="${MODE:-open-stream-replay}" # Short smoke: END=4. Full session smoke: END="" (empty). END="${END:-4}" MEMORY_SECONDS="${MEMORY_SECONDS:-20}" # The historical short smoke used persistent KV (0). Override this to 8 for # the matched bounded-memory chunk ablation. SHORT_MEMORY_SECONDS="${SHORT_MEMORY_SECONDS:-0}" VIDEO_FPS="${VIDEO_FPS:-2}" session="Session_${SESSION_ID}" session_dir="${VIDEO_ROOT}/${session}" target="${TARGET_ROOT}/${session}.npy" output="${FEATURE_ROOT}/${session}_${MODE}_gpu${GPU}.pt" log="${LOG_ROOT}/${session}_${MODE}_gpu${GPU}.log" mkdir -p "${FEATURE_ROOT}" "${LOG_ROOT}" cd "${PROJECT_ROOT}" [[ -d "${session_dir}" ]] || { echo "Missing: ${session_dir}" >&2; exit 1; } extra_args=() if [[ -n "${END}" ]]; then # Bounded smoke: do not pass --target (length would conflict with --end). extra_args+=(--end "${END}") MEMORY_SECONDS="${SHORT_MEMORY_SECONDS}" else [[ -s "${target}" ]] || { echo "Missing: ${target}" >&2; exit 1; } extra_args+=(--target "${target}") fi echo "GPU=${GPU} session=${session} mode=${MODE} end=${END:-full} memory=${MEMORY_SECONDS}" echo "log -> ${log}" { echo "$(date): smoke start ${session} on GPU ${GPU}" CUDA_VISIBLE_DEVICES="${GPU}" PYTHONUNBUFFERED=1 \ python streaming_turn_model_directly.py \ --model-id "${MODEL}" \ --easycom-session-dir "${session_dir}" \ --use-audio-in-video \ --mode "${MODE}" \ --memory-seconds "${MEMORY_SECONDS}" \ --video-fps "${VIDEO_FPS}" \ --dtype bfloat16 \ --flash-attention-2 \ --device cuda:0 \ --verify-every 5 \ --verify-continuous-every 5 \ "${extra_args[@]}" \ --output "${output}" echo "$(date): smoke done -> ${output}" } 2>&1 | tee "${log}"