Unverified Commit 6501bd07 authored by Lei Wang's avatar Lei Wang Committed by GitHub
Browse files

[Refactor] Update condition for benchmarking in example_gemv.py and simplify...

[Refactor] Update condition for benchmarking in example_gemv.py and simplify cached library path handling in sparse.py (#1365)
parent d88594a3
......@@ -360,7 +360,7 @@ def main(do_bench: bool = True):
print("Test passed!")
if not do_bench:
if do_bench:
best_result = get_autotuned_kernel(N, K)
best_config = best_result.config
kernel = splitk_gemv_vectorized_tvm(N, K, **best_config)
......
......@@ -16,11 +16,10 @@ os.makedirs(_CACHE_DIR, exist_ok=True)
def _get_cached_lib():
name = 'compress_lib'
cached_path = os.path.join(_CACHE_DIR, f"{name}.so")
if os.path.exists(cached_path):
if os.path.exists(os.path.join(_CACHE_DIR, f"{name}.so")):
try:
return _import_module_from_library(name, cached_path)
return _import_module_from_library(name, _CACHE_DIR, is_python_module=True)
except Exception:
# If loading fails, recompile
pass
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment