Commit d2089208 authored by YaningGao's avatar YaningGao
Browse files

inference revise

parent d7c560c7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -127,3 +127,4 @@ svg_analysis_results/
temp/
benchmark_results/
env_benchmark_results/
results/
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ VAGEN addresses these challenges by focusing optimization on the most critical d
- New service architecture for efficient distributed training
- Check out our new guides:
  - [Creating Environments](./docs/envs/create-env.md): New environment protocal.
  - [Creating Services](./docs/envs/create-service.md): We now support hosting environments in a seperate process
  - [Creating Services](./docs/envs/create-service.md): We now support hosting environments in a separate process

## Installation

@@ -97,7 +97,7 @@ See our [Creating Environments](./docs/envs/create-env.md) guide. You may also w
## How to Add New Model

1. Refer to [VERL](https://verl.readthedocs.io/en/latest/index.html) for adding new MLLM.
2. Refer to [QwenVLRolloutManager](./vagen/mllm_agent/rollout.py) to understand how rollout works. In most cases, you can use QwenVLRolloutManager directly with only minor modifications to the model's special tokens
2. Refer to [QwenVLRolloutManager](vagen/mllm_agent/training_rollout/rollout.py) to understand how rollout works. In most cases, you can use QwenVLRolloutManager directly with only minor modifications to the model's special tokens

## Experimental Results
> To reproduce our experiment, please refer to document: [Reproduce Experiments](docs/reproduce-exp.md)
+13 −43
Original line number Diff line number Diff line
# Server configuration
server:
  base_url: "http://localhost:5000"  # Environment server URL
  timeout: 600  # Request timeout (seconds)
  max_workers: 10  # Maximum number of concurrent worker threads
batch_size: 32
max_steps: 10
num_workers: 4

# Inference settings
inference:
  max_steps: 10  # Maximum steps per environment
  show_progress: true  # Display progress bar
  debug: false  # Debug mode
  save_images: true  # Save image results
  save_intermediate: false  # Save intermediate results
dataset_dir: data
use_split: test

# Generation parameters (overrides defaults in model config)
generation:
  temperature: 0.7  # Temperature parameter
  top_p: 0.95  # Nucleus sampling parameter
  max_tokens: 512  # Maximum number of tokens to generate
  stop: ["\n\nUser:", "\n\nHuman:"]  # Stop generation at these markers
server_url: http://localhost:5000
server_timeout: 600
server_max_workers: 48

# Batch processing settings
batch:
  batch_size: 4  # Batch size
  batch_size_multiple: 4  # Batch size multiple (for hardware optimization)
output_dir: inference_results
show_progress: true

# Evaluation configuration
evaluation:
  metrics:
    - score  # Overall score
    - done  # Completion rate
    - steps  # Step count statistics

# Weights & Biases logging configuration
wandb:
  project: "qwen-vl-eval"  # Project name
  experiment_name: "qwen2.5-vl-3b-eval"  # Experiment name
  entity: null  # Team/entity name (optional)
  val_generations_to_log_to_wandb: 5  # Number of generated samples to log
  log_model: false  # Whether to save the model to wandb

# Output configuration
output:
  format: "json"  # Output format
  include_metrics: true  # Include evaluation metrics
  include_trajectories: true  # Include full trajectories
  pretty_print: true  # Pretty-print the output
use_wandb: true
wandb_project: vagen-prompting-frozenlake

debug: false
 No newline at end of file
+20 −25
Original line number Diff line number Diff line
type: "vllm"
name: "Qwen2.5-0.5B-Instruct"

# Model path
path: "Qwen/Qwen2.5-0.5B-Instruct"
tokenizer_path: null  # Use the same path as the model
processor_path: null  # Use the same path as the model

# vLLM specific configuration
tensor_parallel_size: 1  # Adjust according to the number of available GPUs
dtype: "bfloat16"  # Options: auto, float16, bfloat16, float32
gpu_memory_utilization: 0.9
trust_remote_code: true
max_model_len: 4096  # Maximum sequence length

# Generation parameters
qwen_0.5b:
  provider: vllm
  model_name: Qwen/Qwen2.5-0.5B-Instruct
  max_tokens: 1024
  temperature: 0.7
top_p: 0.95
  top_p: 0.9
  top_k: 50
max_tokens: 512
repetition_penalty: 1.0
presence_penalty: 0.0
frequency_penalty: 0.0
  tensor_parallel_size: 1
  gpu_memory_utilization: 0.9
  dtype: bfloat16
  trust_remote_code: true

# Multimodal specific configuration
is_multimodal: true
limit_mm_per_prompt:
  image: 4  # Maximum number of images per prompt
# qwen_vl_3b:
#   provider: vllm
#   model_name: Qwen/Qwen2.5-VL-3B-Instruct
#   max_tokens: 1024
#   temperature: 0.7
#   top_p: 0.9
#   top_k: 50
#   tensor_parallel_size: 1
#   gpu_memory_utilization: 0.9
#   dtype: bfloat16
#   trust_remote_code: true
 No newline at end of file
+3 −4
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@ python -m vagen.env.create_dataset \
    --force_gen

python -m vagen.inference.run_inference \
  --model_config "$SCRIPT_DIR/model_config.yaml" \
  --inference_config "$SCRIPT_DIR/inference_config.yaml" \
  --dataset "data/$EXPERIMENT_NAME/test.parquet" \
  --output_dir results
 No newline at end of file
    --inference_config_path="$SCRIPT_DIR/inference_config.yaml" \
    --model_config_path="$SCRIPT_DIR/model_config.yaml" \
    --val_files_path="data/$EXPERIMENT_NAME/test.parquet"
Loading