You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by "oraluben (via GitHub)" <gi...@apache.org> on 2026/06/21 05:51:04 UTC
Re: [PR] [Metal] Enable Metal 4 shader compilation [tvm]
oraluben commented on PR #19595:
URL: https://github.com/apache/tvm/pull/19595#issuecomment-4761057883
Added a runtime/device guard in addition to the SDK-version guard, so `MTLLanguageVersion4_0` is only requested when the binary is built with an SDK that exposes it and the runtime device reports `MTLGPUFamilyMetal4`. Otherwise the existing `MTLLanguageVersion2_3` path is used.
For validation, I tested this through TileLang, which is the downstream user that needs the new MSL 4 cooperative-tensor syntax:
- Metal 4 path: TileLang cooperative-tensor kernels compile and run on a Metal-4-capable Apple GPU with the macOS 26 SDK/runtime.
- Fallback path: TileLang Metal tests also pass on GitHub Actions with macOS 26 on M1. This is the important compatibility case for this PR: the build/runtime environment exposes the Metal 4 SDK symbols, but the M1 device does not support `MTLGPUFamilyMetal4`, so TVM must compile ordinary Metal shaders with `MTLLanguageVersion2_3`. Passing the TileLang Metal test suite in that environment confirms the runtime fallback is working.
So the current branch covers the regression concern from the earlier review: a TVM binary built with a macOS 26 SDK does not unconditionally request MSL 4.0 on older Apple GPUs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org