Skip to content

Commit 68d1177

Browse files
authored
hotfix: bugfix to #756 (#757)
This pull request includes changes to the `flashinfer/jit/__init__.py` file to improve the import structure and handle the `prebuilt_ops_uri` import conditionally. Improvements to import structure: * Removed the unconditional import of `prebuilt_ops_uri` from `aot_config` and added it conditionally within the try-except block to handle cases where `_kernels` or `_kernels_sm90` are not available. [[1]](diffhunk://#diff-39845bb8e1f81f9ca7d510e99dad0c15c7596ebe1ac909dc1b3c25b742700b5cL20) [[2]](diffhunk://#diff-39845bb8e1f81f9ca7d510e99dad0c15c7596ebe1ac909dc1b3c25b742700b5cR48-R52) cc @ByronHsu
1 parent aa9c5d9 commit 68d1177

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

flashinfer/jit/__init__.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
# Re-export
1818
from .activation import gen_act_and_mul_module as gen_act_and_mul_module
1919
from .activation import get_act_and_mul_cu_str as get_act_and_mul_cu_str
20-
from .aot_config import prebuilt_ops_uri as prebuilt_ops_uri
2120
from .attention import gen_batch_decode_mla_module as gen_batch_decode_mla_module
2221
from .attention import gen_batch_decode_module as gen_batch_decode_module
2322
from .attention import gen_batch_prefill_module as gen_batch_prefill_module
@@ -40,13 +39,15 @@
4039
from .attention import get_batch_prefill_uri as get_batch_prefill_uri
4140
from .attention import get_single_decode_uri as get_single_decode_uri
4241
from .attention import get_single_prefill_uri as get_single_prefill_uri
43-
from .core import clear_cache_dir, load_cuda_ops # noqa: F401
42+
from .core import clear_cache_dir, load_cuda_ops # noqa: F401
4443
from .env import *
4544
from .utils import parallel_load_modules as parallel_load_modules
4645

4746
try:
4847
from .. import _kernels, _kernels_sm90 # noqa: F401
48+
from .aot_config import prebuilt_ops_uri as prebuilt_ops_uri
4949

5050
has_prebuilt_ops = True
5151
except ImportError:
52+
prebuilt_ops_uri = {}
5253
has_prebuilt_ops = False

0 commit comments

Comments
 (0)