metal: the Metal runtime behind a CUDA-name compat layer (the HIP model), so the host files build for Metal unchanged
MAC-PLAN Phase 1, compat design (the alternative to renaming the host calls, f-mac-design S1-S4). metal/include/metal_compat goes first on the Metal build's include path, as include/strata/hip_compat does on HIP: its cuda_runtime.h gives the ~70 CUDA runtime names of the Phase 1 inventory (types, constants, calls) on Metal, each forwarding to metal/src/gpu/runtime.cpp (metal-cpp: gpuAddress device pointers in one residency set, streams = queue + command buffer + shared-event timeline, graphs = recorded dispatch lists), and immintrin.h gives _mm_pause / _mm_sfence on arm64. The CUDA / HIP / SYCL builds never see metal/. Shared files: four preprocessor conditions also exclude STRATA_GPU_METAL from CUDA-only blocks (the cuMem* segmented expert cache, the STRATA_VERIFY_NODES graph listing, the MTP stream priority, cudaInitDevice of the remote experts); nothing else in src/ changes, so the PC objects are byte-identical. On the M5 Max: runtime_hello passes with the unchanged src/core/graph.cpp, and graph, expert_cache, weights, native_head, native_dense, layer, verify, mtp and session compile for Metal as they are (-fsyntax-only); prefill, expert_source and generate stop only at macOS platform items (std::max of size_t vs uint64_t, posix_fadvise / _SC_AVPHYS_PAGES, sys/sysmacros.h).
This commit is contained in:
1 parent
b59e69c7bb
commit
bf4b79abda
14 files changed
+1494
-4
No files matched your search
@@ -3,7 +3,7 @@
|
||||
|
||||
// #533's segmented cache uses CUDA's virtual memory management (cuMem*): not on HIP, neither the RDNA backend nor
|
||||
// the gfx906 compat build (PR #638), which compiles this file as HIP without STRATA_USE_HIP
|
||||
#if defined(STRATA_USE_HIP) || defined(STRATA_HIP_GFX906)
|
||||
#if defined(STRATA_USE_HIP) || defined(STRATA_HIP_GFX906) || defined(STRATA_GPU_METAL)
|
||||
#define STRATA_EC_NO_VMM 1
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user