"git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "3efc59ee494eaefbc3fc3edd344766129d958ef4"
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): ...@@ -360,7 +360,7 @@ def main(do_bench: bool = True):
print("Test passed!") print("Test passed!")
if not do_bench: if do_bench:
best_result = get_autotuned_kernel(N, K) best_result = get_autotuned_kernel(N, K)
best_config = best_result.config best_config = best_result.config
kernel = splitk_gemv_vectorized_tvm(N, K, **best_config) kernel = splitk_gemv_vectorized_tvm(N, K, **best_config)
......
...@@ -16,11 +16,10 @@ os.makedirs(_CACHE_DIR, exist_ok=True) ...@@ -16,11 +16,10 @@ os.makedirs(_CACHE_DIR, exist_ok=True)
def _get_cached_lib(): def _get_cached_lib():
name = 'compress_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: try:
return _import_module_from_library(name, cached_path) return _import_module_from_library(name, _CACHE_DIR, is_python_module=True)
except Exception: except Exception:
# If loading fails, recompile # If loading fails, recompile
pass 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