Skip to content

Conversation

@mengniwang95
Copy link
Contributor

@mengniwang95 mengniwang95 commented Nov 21, 2025

User description

Type of Change

example

Description

depends on main branch of auto_round


PR Type

Enhancement


Description

  • Added FramePack example with benchmark script

  • Included README with setup instructions and usage examples

  • Enhanced script to handle multiple GPU configurations


Diagram Walkthrough

flowchart LR
  A["Add run_benchmark.sh"] -- "Handles parameters and runs benchmark" --> B["Add README.md"]
  B -- "Provides setup and usage instructions" --> C["Enhance script for multi-GPU"]
Loading

File Walkthrough

Relevant files
Enhancement
run_benchmark.sh
Add benchmark script                                                                         

examples/pytorch/diffusion_model/diffusers/framepack/run_benchmark.sh

  • Added script to initialize parameters and run benchmark
  • Handles different topologies and GPU configurations
+128/-0 
Documentation
README.md
Add README for FramePack example                                                 

examples/pytorch/diffusion_model/diffusers/framepack/README.md

  • Added README with environment setup and usage examples
+57/-0   

Mengni Wang and others added 2 commits November 18, 2025 03:47
Signed-off-by: Mengni Wang <[email protected]>
Signed-off-by: Mengni Wang <[email protected]>
@PRAgent4INC
Copy link
Collaborator

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Error Handling

The script does not handle cases where required parameters (e.g., topology, dataset_location) are not provided. It should include checks to ensure all necessary parameters are set before proceeding.

function init_params {
  for var in "$@"
  do
    case $var in
      --topology=*)
          topology=$(echo $var |cut -f2 -d=)
      ;;
      --dataset_location=*)
          dataset_location=$(echo $var |cut -f2 -d=)
      ;;
      --ratio=*)
          ratio=$(echo $var |cut -f2 -d=)
      ;;
      --input_model=*)
          input_model=$(echo $var |cut -f2 -d=)
      ;;
      --limit=*)
          limit=$(echo $var |cut -f2 -d=)
      ;;
      --output_video_path=*)
          output_video_path=$(echo $var |cut -f2 -d=)
      ;;
      --result_path=*)
          result_path=$(echo $var |cut -f2 -d=)
      ;;
      --dimension_list=*)
          dimension_list=$(echo $var |cut -f2 -d=)
      ;;
      *)
          echo "Error: No such parameter: ${var}"
          exit 1
      ;;
    esac
Variable Initialization

Variables like topology, dataset_location, etc., are used without being initialized. Ensure these variables are either initialized with default values or checked for existence before use.

function init_params {
  for var in "$@"
  do
    case $var in
      --topology=*)
          topology=$(echo $var |cut -f2 -d=)
      ;;
      --dataset_location=*)
          dataset_location=$(echo $var |cut -f2 -d=)
      ;;
      --ratio=*)
          ratio=$(echo $var |cut -f2 -d=)
      ;;
      --input_model=*)
          input_model=$(echo $var |cut -f2 -d=)
      ;;
      --limit=*)
          limit=$(echo $var |cut -f2 -d=)
      ;;
      --output_video_path=*)
          output_video_path=$(echo $var |cut -f2 -d=)
      ;;
      --result_path=*)
          result_path=$(echo $var |cut -f2 -d=)
      ;;
      --dimension_list=*)
          dimension_list=$(echo $var |cut -f2 -d=)
      ;;
      *)
          echo "Error: No such parameter: ${var}"
          exit 1
      ;;
    esac
Parallel Execution

The script runs multiple instances of main.py in parallel using &. Ensure that there are no race conditions or shared resources that could cause issues when running in parallel.

    for ((i=0; i<count; i++)); do
        export CUDA_VISIBLE_DEVICES=${gpu_ids[i]}
        python3 main.py \
            --output_video_path ${output_video_path} \
    	--dataset_location ${dataset_location} \
            --ratio ${ratio} \
            --limit ${limit} \
            --dimension_list ${dimensions[i]} \
            ${extra_cmd} &
        program_pid+=($!)
        echo "Start (PID: ${program_pid[-1]}, GPU: ${i})"
    done
    wait "${program_pid[@]}"
else

@PRAgent4INC
Copy link
Collaborator

Failed to generate code suggestions for PR

pip install -r requirements.txt
pip install --update neural-compressor-pt
pip install --update auto-round
git clone --depth 1 https://github.com/lllyasviel/FramePack.git
Copy link
Contributor

@chensuyue chensuyue Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we freeze to a tag or commit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,141 @@
#!/bin/bash
set -x
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use set -ex, so script will exit with the first error.

@@ -0,0 +1,35 @@
Pillow
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add gdown, used by sh vbench2_beta_i2v/download_data.sh

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's freeze the deps versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants