-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TVMC] Allow selecting a subset of tasks to be used in
tvmc tune
(#…
…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?~~
- Loading branch information
Showing
3 changed files
with
227 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters