MPS Deployment Target Mismatch

Hi all. I am are building PyTorch from source with MPS support and am having a problem with the Deployment Target
Some context:
Im using LibTorch to run inference in C++.
My minimum deployment target is currently 11.

My build works correctly on all systems 11 and up as expected for CPU usage, and I also have no problem checking for MPS availability on any system as well.
The problem Im having right now is that inference with MPS only seems to work correctly on the same Mac OSX that PyTorch was built on. Eg, I am building on 15.1 and it works correctly on my own system, but If I attempt to use this build on MacOS 14 it will not work.
Below is the error I see when trying this:

RuntimeError: Failed to created pipeline state object, error: Error Domain=AGXMetalG14X Code=3 "Function kernel_index_offsets_32 has a deployment target (0x00020007) which is incompatible with this OS (0x00020006)." UserInfo={NSLocalizedDescription=Function kernel_index_offsets_32 has a deployment target (0x00020007) which is incompatible with this OS (0x00020006).}

My question is, is it possible to build PyTorch with MPS so that it can be deployed on a MacOS different from the one built on and if so, how can this be done?
Im already setting CMAKE arguments related to the deployment target, but maybe Im missing something critical.

CMAKE_OSX_DEPLOYMENT_TARGET

Any help appreciated, thanks all.

For anyone who finds this issue in the future, it looks like Ive managed to solve the problem. After digging around for a while I managed to figure out how these problem kernels are being built.
In Metal.cmake:

function(metal_to_air SRC TARGET FLAGS)
    add_custom_command(COMMAND xcrun metal -c -mmacosx-version-min=12.3 ${SRC} -o ${TARGET} ${FLAGS} ${METAL_CFLAGS}
                       DEPENDS ${SRC}
                       OUTPUT ${TARGET}
                       COMMENT "Compiling ${SRC} to ${TARGET}"
                       VERBATIM)
endfunction()

I’ve added -mmacosx-version-min=12.3. Without this the deployment target is the OS you are building on (or SDK being built with?)
This suits my needs, but I think it should be the case that when building PyTorch the normal CMAKE arguments for minimum deployment target should make their way here somehow. I might make a fork later of some actual fix, but for now this will do the trick for me.