Skip to content

[MetaSchedule] Enhance tune_tir to tune IRModule of TIR Collections#14784

Merged
junrushao merged 1 commit intoapache:mainfrom
junrushao:feature/2023-05-05/tune-tir-module
May 7, 2023
Merged

[MetaSchedule] Enhance tune_tir to tune IRModule of TIR Collections#14784
junrushao merged 1 commit intoapache:mainfrom
junrushao:feature/2023-05-05/tune-tir-module

Conversation

@junrushao
Copy link
Copy Markdown
Member

@junrushao junrushao commented May 6, 2023

This PR enhances the user-facing API tune_tir that makes it more convenient to feed in an IRModule consists of multiple TIRs and customize the search space for them. This is widely used in our MLC-LLM project where we wanted to customize the search space for some quantization-related operators.

An example usecase:

from tvm import meta_schedule as ms

ms.tir_integration.tune_tir(
    ...
    space="cuda",  <========== by default, the space is "cuda" rather than "cuda-tensorcore"
    special_space={
        "fused_decode1_fused_matmul2_add1_gelu": sch_fused_decode_gemv,
        "decode": sch_decode,
    },
)

@tvm-bot
Copy link
Copy Markdown
Collaborator

tvm-bot commented May 6, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@junrushao junrushao marked this pull request as ready for review May 6, 2023 03:08
@junrushao junrushao force-pushed the feature/2023-05-05/tune-tir-module branch from d3a686d to 6aefbc3 Compare May 6, 2023 06:14
@junrushao junrushao changed the title [MetaSchedule] Introduce tune_tir_module [MetaSchedule] Enhance tune_tir to tune IRModule of TIR Collections May 6, 2023
@junrushao junrushao force-pushed the feature/2023-05-05/tune-tir-module branch 2 times, most recently from 95fe8b8 to 25ba3a4 Compare May 7, 2023 00:17
This PR enhances the user-facing API `tune_tir` that makes it
more convenient to feed in an IRModule consists of multiple TIRs and
customize the search space for them. This is widely used in our MLC-LLM
project where we wanted to customize the search space for some
quantization-related operators.

An example usecase:

```python

from tvm import meta_schedule as ms

ms.tir_integration.tune_tir(
    ...
    space="cuda",  <========== by default, the space is "cuda" rather than "cuda-tensorcore"
    special_space={
        "fused_decode1_fused_matmul2_add1_gelu": sch_fused_decode_gemv,
        "decode": sch_decode,
    },
)
```
@junrushao junrushao force-pushed the feature/2023-05-05/tune-tir-module branch from 25ba3a4 to f55ace0 Compare May 7, 2023 00:17
@junrushao junrushao merged commit e08caef into apache:main May 7, 2023
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.

3 participants