Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MetaSchedule] Add Testing Script with ONNX Support #11587

Merged

Conversation

zxybazh
Copy link
Member

@zxybazh zxybazh commented Jun 6, 2022

This PR introduces 2 tuning script for meta schedule and auto scheduler tuning support with onnx files. Now we can easily introduce onnx models benchmarking with command line scripts. Sample tuning call looks similar to the following script

For Meta Schedule ONNX tuning:

python3 -m tvm.meta_schedule.testing.tune_onnx_meta_schedule \
    --model-name   "$MODEL_NAME"                             \
    --onnx-path    "$ONNX_PATH"                              \
    --input-shape  "$INPUT_SHAPE"                            \
    --target       "$TARGET"                                 \
    --num-trials   $NUM_TRIALS                               \
    --rpc-host     $RPC_HOST                                 \
    --rpc-port     $RPC_PORT                                 \
    --rpc-key      $RPC_KEY                                  \
    --rpc-workers  $RPC_WORKERS                              \
    --work-dir     $WORK_DIR                                 \
    |& tee         "$WORK_DIR/$MODEL_NAME.log"

For AutoScheduler ONNX tuning:

python3 -m tvm.meta_schedule.testing.tune_onnx_auto_scheduler \
    --model-name   "$MODEL_NAME"                              \
    --onnx-path    "$ONNX_PATH"                               \
    --input-shape  "$INPUT_SHAPE"                             \
    --target       "$TARGET"                                  \
    --num-trials   $NUM_TRIALS                                \
    --rpc-host     $RPC_HOST                                  \
    --rpc-port     $RPC_PORT                                  \
    --rpc-key      $RPC_KEY                                   \
    --rpc-workers  $RPC_WORKERS                               \
    --log-dir      $WORK_DIR                                  \
    |& tee         "$WORK_DIR/$MODEL_NAME.log"

Copy link
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

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

Thanks @zxybazh! This is amazing work!!

@junrushao junrushao merged commit 1244089 into apache:main Jun 7, 2022
@junrushao
Copy link
Member

Thanks @zxybazh! This is super helpful to have for tuning ONNX from command line

Kathryn-cat pushed a commit to Kathryn-cat/tvm that referenced this pull request Jun 10, 2022
This PR introduces 2 tuning script for meta schedule and auto scheduler tuning support with onnx files. Now we can easily introduce onnx models benchmarking with command line scripts. Sample tuning call looks similar to the following script

For Meta Schedule ONNX tuning:
```
python3 -m tvm.meta_schedule.testing.tune_onnx_meta_schedule \
    --model-name   "$MODEL_NAME"                             \
    --onnx-path    "$ONNX_PATH"                              \
    --input-shape  "$INPUT_SHAPE"                            \
    --target       "$TARGET"                                 \
    --num-trials   $NUM_TRIALS                               \
    --rpc-host     $RPC_HOST                                 \
    --rpc-port     $RPC_PORT                                 \
    --rpc-key      $RPC_KEY                                  \
    --rpc-workers  $RPC_WORKERS                              \
    --work-dir     $WORK_DIR                                 \
    |& tee         "$WORK_DIR/$MODEL_NAME.log"
```

For AutoScheduler ONNX tuning:
```
python3 -m tvm.meta_schedule.testing.tune_onnx_auto_scheduler \
    --model-name   "$MODEL_NAME"                              \
    --onnx-path    "$ONNX_PATH"                               \
    --input-shape  "$INPUT_SHAPE"                             \
    --target       "$TARGET"                                  \
    --num-trials   $NUM_TRIALS                                \
    --rpc-host     $RPC_HOST                                  \
    --rpc-port     $RPC_PORT                                  \
    --rpc-key      $RPC_KEY                                   \
    --rpc-workers  $RPC_WORKERS                               \
    --log-dir      $WORK_DIR                                  \
    |& tee         "$WORK_DIR/$MODEL_NAME.log"
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants