Skip to content

Commit

Permalink
x64 mac does not support custom ops
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Nov 14, 2024
1 parent c781284 commit 2bd308d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import {python, torchPath} from './common.mjs';

const config = argv['config'] || 'Release'
const targetArch = argv['target-arch'] || process.arch
const targetArch = argv['target-arch'] || argv['target-cpu'] || process.arch
const targetOs = argv['target-os'] || {
darwin: 'mac',
linux: 'linux',
Expand All @@ -18,7 +18,6 @@ const flags = [
'EXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON',
'EXECUTORCH_BUILD_EXTENSION_MODULE=ON',
'EXECUTORCH_BUILD_EXTENSION_TENSOR=ON',
'EXECUTORCH_BUILD_KERNELS_CUSTOM=ON',
'EXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON',
'EXECUTORCH_BUILD_KERNELS_QUANTIZED=ON',
'EXECUTORCH_BUILD_XNNPACK=ON',
Expand All @@ -29,6 +28,11 @@ if (config == 'Debug') {
'ET_MIN_LOG_LEVEL=Debug')
}

// https://github.com/pytorch/executorch/issues/6839
if (!(process.platform == 'darwin' && targetArch == 'x64')) {
flags.push('EXECUTORCH_BUILD_KERNELS_CUSTOM=ON')
}

if (process.platform == 'darwin') {
flags.push('DEPLOYMENT_TARGET=10.15',
'EXECUTORCH_BUILD_COREML=ON',
Expand Down

0 comments on commit 2bd308d

Please sign in to comment.