Compare commits

...

3 Commits

Author SHA1 Message Date
Cheng
4ac55015b1 Do not define _VERSION_ in python bindings 2025-09-07 18:41:33 +09:00
Cheng
a24c28ab1b Fix ccache cache miss 2025-09-07 18:41:33 +09:00
Cheng
c1e3340b23 Set ccache size before building (#2570) 2025-09-07 09:00:31 +09:00
6 changed files with 10 additions and 10 deletions

View File

@@ -230,6 +230,9 @@ jobs:
sudo mv ccache-4.11.3-linux-x86_64/ccache /usr/bin/ccache
rm -rf ccache-4.11.3-linux-x86_64
curl -LsSf https://astral.sh/uv/install.sh | sh
- run:
name: Set CCache size
command: ccache --max-size 1G
- run:
name: Install Python package
command: |
@@ -260,7 +263,6 @@ jobs:
command: |
ccache --show-stats
ccache --zero-stats
ccache --max-size 400MB
ccache --cleanup
- save_cache:
key: cuda-<< parameters.image_date >>-{{ arch }}-{{ epoch }}

View File

@@ -1,10 +1,8 @@
// Copyright © 2025 Apple Inc.
#include <string>
namespace mlx::core {
std::string version() {
const char* version() {
return MLX_VERSION;
}

View File

@@ -15,6 +15,6 @@ namespace mlx::core {
*
* For dev builds, the version will include the suffix ".devYYYYMMDD+hash"
*/
std::string version();
const char* version();
} // namespace mlx::core

View File

@@ -52,7 +52,6 @@ set_target_properties(
${MLX_PYTHON_BINDINGS_OUTPUT_DIRECTORY})
target_link_libraries(core PRIVATE mlx)
target_compile_definitions(core PRIVATE _VERSION_=${MLX_VERSION})
if(BUILD_SHARED_LIBS)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

View File

@@ -2,9 +2,9 @@
#include <nanobind/nanobind.h>
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
#include "mlx/version.h"
namespace mx = mlx::core;
namespace nb = nanobind;
void init_mlx_func(nb::module_&);
@@ -48,5 +48,5 @@ NB_MODULE(core, m) {
init_distributed(m);
init_export(m);
m.attr("__version__") = TOSTRING(_VERSION_);
m.attr("__version__") = mx::version();
}

View File

@@ -121,7 +121,8 @@ class CMakeBuild(build_ext):
build_args += [f"-j{os.cpu_count()}"]
# Avoid cache miss when building from temporary dirs.
os.environ["CCACHE_BASEDIR"] = os.path.abspath(self.build_temp)
os.environ["CCACHE_BASEDIR"] = os.path.realpath(self.build_temp)
os.environ["CCACHE_NOHASHDIR"] = "true"
subprocess.run(
["cmake", ext.sourcedir, *cmake_args], cwd=build_temp, check=True