-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR introduces the FlashInfer JIT compilation for TVM, with corresponding TVM bindings. Compared with Torch-based JIT which returns the compiled module, the JIT for TVM returns the generated uri and source files directly, which will be compiled and loaded as a TVM runtime module on TVM side. Some notes: * SM90 prefill is not fully enabled due to the layout mismatch of `indptr`. This will be addressed in the near future. * Unit tests are not yet included. We are still working on getting a plan to test TVM bindings in FlashInfer. * The previous TVM bindings in `src/tvm_wrapper.cu` is removed, and AOT compilation for TVM is no longer supported since this PR.
- Loading branch information
1 parent
1605eaa
commit 7636b6b
Showing
25 changed files
with
2,161 additions
and
962 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
""" | ||
Copyright (c) 2025 by FlashInfer team. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
""" | ||
|
||
from . import pytorch, tvm | ||
from .pytorch import gen_batch_decode_mla_module as gen_batch_decode_mla_module | ||
from .pytorch import gen_batch_decode_module as gen_batch_decode_module | ||
from .pytorch import gen_batch_mla_module as gen_batch_mla_module | ||
from .pytorch import gen_batch_prefill_module as gen_batch_prefill_module | ||
from .pytorch import ( | ||
gen_customize_batch_decode_module as gen_customize_batch_decode_module, | ||
) | ||
from .pytorch import ( | ||
gen_customize_batch_prefill_module as gen_customize_batch_prefill_module, | ||
) | ||
from .pytorch import ( | ||
gen_customize_single_decode_module as gen_customize_single_decode_module, | ||
) | ||
from .pytorch import ( | ||
gen_customize_single_prefill_module as gen_customize_single_prefill_module, | ||
) | ||
from .pytorch import gen_single_decode_module as gen_single_decode_module | ||
from .pytorch import gen_single_prefill_module as gen_single_prefill_module | ||
from .pytorch import get_batch_decode_mla_uri as get_batch_decode_mla_uri | ||
from .pytorch import get_batch_decode_uri as get_batch_decode_uri | ||
from .pytorch import get_batch_mla_uri as get_batch_mla_uri | ||
from .pytorch import get_batch_prefill_uri as get_batch_prefill_uri | ||
from .pytorch import get_single_decode_uri as get_single_decode_uri | ||
from .pytorch import get_single_prefill_uri as get_single_prefill_uri | ||
from .tvm import gen_batch_mla_tvm_binding as gen_batch_mla_tvm_binding | ||
from .tvm import ( | ||
gen_customize_batch_decode_tvm_binding as gen_customize_batch_decode_tvm_binding, | ||
) | ||
from .tvm import ( | ||
gen_customize_batch_prefill_tvm_binding as gen_customize_batch_prefill_tvm_binding, | ||
) |
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
Oops, something went wrong.