PhilippvK opened a new pull request, #12525: URL: https://github.com/apache/tvm/pull/12525
This adds a `--tasks` flag to the `tvmc tune` command to filter the lists of tasks to be tuned. See examples below. ## Motivation - As auto-tuning can be quite time consuming, it is often desirable to cut down the number of tuned tasks in a session. - If the tuning session was canceled halfway through, it would be a bad idea to start from scratch. Instead continue with the last untuned task - Some tasks have more impact on the model performance than others, thus we should be able to train some tasks longer than others ## Examples 1. Use `--task list` to show which tasks are available for tuning ``` $ tvmc tune toycar.tflite -o out.txt --task list Available Tasks for tuning: 0. Task(func_name=dense_nopack.x86, args=(('TENSOR', (1, 640), 'int16'), ('TENSOR', (128, 640), 'int... 1. Task(func_name=dense_pack.x86, args=(('TENSOR', (1, 640), 'int16'), ('TENSOR', (128, 640), 'int16... 2. Task(func_name=dense_nopack.x86, args=(('TENSOR', (1, 128), 'int16'), ('TENSOR', (128, 128), 'int... 3. Task(func_name=dense_pack.x86, args=(('TENSOR', (1, 128), 'int16'), ('TENSOR', (128, 128), 'int16... 4. Task(func_name=dense_nopack.x86, args=(('TENSOR', (1, 128), 'int16'), ('TENSOR', (8, 128), 'int16... 5. Task(func_name=dense_pack.x86, args=(('TENSOR', (1, 128), 'int16'), ('TENSOR', (8, 128), 'int16')... 6. Task(func_name=dense_nopack.x86, args=(('TENSOR', (1, 8), 'int16'), ('TENSOR', (128, 8), 'int16')... 7. Task(func_name=dense_pack.x86, args=(('TENSOR', (1, 8), 'int16'), ('TENSOR', (128, 8), 'int16'), ... 8. Task(func_name=dense_nopack.x86, args=(('TENSOR', (1, 128), 'int16'), ('TENSOR', (640, 128), 'int... 9. Task(func_name=dense_pack.x86, args=(('TENSOR', (1, 128), 'int16'), ('TENSOR', (640, 128), 'int16... ``` 2. Filter the list of tasks to be tuned: ``` # Only tune a single task (index 5) tvmc tune toycar.tflite -o out.txt --tasks 5 # Tunes tasks starting with index 6 tvmc tune toycar.tflite -o out.txt --tasks "6-" # Tune tasks 1,4,5,6,8,9 tvmc tune toycar.tflite -o out.txt --tasks "1,4-6,8-" ``` ## Tests I added a basic unit test for the `filter_tasks` utility in `tests/python/driver/tvmc/test_autotuner.py`. ## Open Questions - While the (truncated) string representations of AutoTVM tasks are quite helpful to pick the correct tasks, using AutoScheduler the tasks can not really be distinguished from each other (only by index). Is there a way to get similar information from AutoScheduler tasks? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@tvm.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org