mirror of
https://github.com/ml-explore/mlx.git
synced 2025-10-19 08:38:09 +08:00
Separate cpu compilation cache by versions (#2548)
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
#include "mlx/backend/cpu/jit_compiler.h"
|
#include "mlx/backend/cpu/jit_compiler.h"
|
||||||
#include "mlx/device.h"
|
#include "mlx/device.h"
|
||||||
#include "mlx/graph_utils.h"
|
#include "mlx/graph_utils.h"
|
||||||
|
#include "mlx/version.h"
|
||||||
|
|
||||||
namespace mlx::core {
|
namespace mlx::core {
|
||||||
|
|
||||||
@@ -94,7 +95,11 @@ void* compile(
|
|||||||
kernel_file_name = kernel_name;
|
kernel_file_name = kernel_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto output_dir = std::filesystem::temp_directory_path();
|
auto output_dir =
|
||||||
|
std::filesystem::temp_directory_path() / "mlx" / version() / "cpu";
|
||||||
|
if (!std::filesystem::exists(output_dir)) {
|
||||||
|
std::filesystem::create_directories(output_dir);
|
||||||
|
}
|
||||||
|
|
||||||
std::string shared_lib_name = "lib" + kernel_file_name + ".so";
|
std::string shared_lib_name = "lib" + kernel_file_name + ".so";
|
||||||
auto shared_lib_path = (output_dir / shared_lib_name).string();
|
auto shared_lib_path = (output_dir / shared_lib_name).string();
|
||||||
|
Reference in New Issue
Block a user