Skip to content

Commit 09fe1bc

Browse files
authored
[CompilerFlag] Detect if FlashInfer is enabled from libinfo (#1941)
This PR supports the detection of if FlashInfer is enabled when building TVM, so that FlashInfer won't be enabled when TVM is not built with FlashInfer enabled.
1 parent 01527e9 commit 09fe1bc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

python/mlc_llm/interface/compiler_flags.py

+5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
"""Flags for overriding model config."""
2+
23
import dataclasses
34
from io import StringIO
45
from typing import Optional
56

7+
import tvm
8+
69
from mlc_llm.support import argparse, logging
710
from mlc_llm.support.config import ConfigOverrideBase
811

@@ -65,6 +68,8 @@ def _flashinfer(target) -> bool:
6568
return False
6669
if target.kind.name != "cuda":
6770
return False
71+
if tvm.get_global_func("support.GetLibInfo")()["USE_FLASHINFER"] != "ON":
72+
return False
6873
arch_list = detect_cuda_arch_list(target)
6974
for arch in arch_list:
7075
if arch < 80:

0 commit comments

Comments
 (0)