Skip to content

fix(strata): build main for Metal again (cudaPointerAttributes in mtp.cpp, link latent_tables.cpp) - #243

Merged
shuk777 merged 1 commit into
Edge0-AI:mainfrom
toshi38:stelau/fix-metal-build-mtp-pointer-attributes
Nov 16, 2026
Merged

shuk777 merged 1 commit into
Edge0-AI:mainfrom
toshi38:stelau/fix-metal-build-mtp-pointer-attributes

Conversation

@toshi38

@toshi38 toshi38 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

What & why

main does not build for Metal since 753269a. Two things, both small:

  1. src/core/mtp.cpp uses cudaPointerAttributes, which the Metal runtime does not have, in mtp_dev_of (the STRATA_MTP_DEV diagnostic) and in the cross-card check of the drafter's prefill. On Metal mtp_dev_of now reports device 0 and the cross-card check is compiled out: there is one device and one memory, so rows never come from another card.
  2. The engine references LatentTables, and metal/CMakeLists.txt does not list src/core/latent_tables.cpp. It joins the Metal host sources; it compiles there unchanged.

Nothing changes for the CUDA and HIP builds: the two mtp.cpp edits are inside #if defined(STRATA_GPU_METAL) / #if !defined(STRATA_GPU_METAL), and the other is in the Metal CMake file only.

Fixes #242

Area

  • Engine, CLI or server (edge0-infer/)
  • Model asset tools (edge0-infer/tools/assets/)
  • Chat app examples (edge0-infer/examples/)
  • Model docs (docs/)
  • Other (edge0-strata/src/core/mtp.cpp, edge0-strata/metal/CMakeLists.txt)

How was it tested?

Machine: MacBook Pro, Apple M4 Max, 64 GB, Metal. Built on main at 257ff84 as EDGE0.md describes.

Not done:

  • A comparison of first tokens and log-probabilities against the last commit that built (7b60076). I started one and the machine ran out of memory under other work, so I have no result either way. verify_metal_latent.py passing is the evidence that the engine answers.
  • The edge0-infer test levels: the change does not touch edge0-infer/.
  • STRATA_MTP_DEV=1 on Metal (it now prints device 0 for every buffer).
  • Linux and Windows builds. The edits are guarded so they should compile as before, but I did not build them.

Checklist

  • ctest --preset cpu -L "L0|L1" passes locally in edge0-infer/ (engine changes): not run, edge0-infer/ is untouched
  • Ran the higher test levels this change affects: moe_mm_parity, the Metal ctest, tools/verify_metal_latent.py
  • Added/updated tests for new behavior: none; a Metal build in CI would have caught this
  • Updated relevant docs / READMEs: none needed

Since 753269a the Metal build fails twice: src/core/mtp.cpp uses cudaPointerAttributes, which the Metal runtime does
not have, in mtp_dev_of and in the cross-card check of the drafter's prefill; and the engine references
LatentTables, whose source file metal/CMakeLists.txt does not list.

On Metal mtp_dev_of reports device 0 and the cross-card check is compiled out (one device, one memory), and
src/core/latent_tables.cpp joins the Metal host sources.
@toshi38
toshi38 marked this pull request as ready for review November 16, 2026 07:48

@shuk777 shuk777 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shuk777
shuk777 merged commit 1d01fc3 into Edge0-AI:main Nov 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

main does not build for Metal since 753269a (cudaPointerAttributes in mtp.cpp, LatentTables not linked)

2 participants