Build Information
Successful build of MetalHLO, reference main (44b3a0), with Swift 6.3 for macOS (SPM) on 27 Jun 2026 22:09:22 UTC.
Swift 6 data race errors: 0
Build Command
env DEVELOPER_DIR=/Applications/Xcode-26.4.0.app xcrun swift build --arch arm64Build Log
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
4812 | let zero = graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4813 | let colJ = graph.select(predicate: keepMask, trueTensor: divided, falseTensor: zero, name: nil)
4814 |
[401/437] Compiling MetalHLOCore EmbeddedAttentionSplitter.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:694:13: warning: initialization of immutable value 'approximate' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
692 |
693 | let x = inputs[0]
694 | let approximate = BackendConfigParser.getBool(config, key: "approximate", default: false)
| `- warning: initialization of immutable value 'approximate' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
695 |
696 | // GELU: 0.5 * x * (1 + tanh(sqrt(2/pi) * (x + 0.044715 * x^3)))
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:749:13: warning: variable 'startIndices1' was never mutated; consider changing to 'let' constant
747 | // Split x into first half and second half along last dimension
748 | // x1 = x[..., :halfDim], x2 = x[..., halfDim:]
749 | var startIndices1 = [Int](repeating: 0, count: rank)
| `- warning: variable 'startIndices1' was never mutated; consider changing to 'let' constant
750 | var endIndices1 = xShape.map { $0.intValue }
751 | endIndices1[rank - 1] = halfDim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:789:17: warning: variable 'cosStart' was never mutated; consider changing to 'let' constant
787 | // freqs contains both cos and sin interleaved or concatenated
788 | // Assume first half is cos, second half is sin
789 | var cosStart = [Int](repeating: 0, count: freqsRank)
| `- warning: variable 'cosStart' was never mutated; consider changing to 'let' constant
790 | var cosEnd = freqsShape.map { $0.intValue }
791 | cosEnd[freqsRank - 1] = halfDim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3333:13: warning: immutable value 'targetInputOrder' was never used; consider removing it [#no-usage]
3331 |
3332 | // Transpose input to target layout
3333 | let targetInputOrder: [Int]
| `- warning: immutable value 'targetInputOrder' was never used; consider removing it [#no-usage]
3334 | switch targetDataLayout {
3335 | case .NHWC:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3364:13: warning: immutable value 'targetKernelOrder' was never used; consider removing it [#no-usage]
3362 |
3363 | // Transpose weights if needed
3364 | let targetKernelOrder: [Int]
| `- warning: immutable value 'targetKernelOrder' was never used; consider removing it [#no-usage]
3365 | switch targetWeightsLayout {
3366 | case .HWIO:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3412:13: warning: immutable value 'mpsOutputOrder' was never used; consider removing it [#no-usage]
3410 | ]
3411 |
3412 | let mpsOutputOrder: [Int]
| `- warning: immutable value 'mpsOutputOrder' was never used; consider removing it [#no-usage]
3413 | switch sourceDataLayout {
3414 | case .NHWC:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4366:17: warning: initialization of immutable value 'mask' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4364 | if bitsToRound > 0 {
4365 | // RNE: absBits = (absBits + ((1<<(bitsToRound-1)) - 1) + keptLSB) & ~mask
4366 | let mask = u32((UInt32(1) << UInt32(bitsToRound)) - 1)
| `- warning: initialization of immutable value 'mask' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4367 | let shifted = graph.bitwiseRightShift(absBits, u32(UInt32(bitsToRound)), name: nil)
4368 | let keptLSB = graph.bitwiseAND(shifted, u32(1), name: nil)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4778:97: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4776 | // entries above the diagonal (row < j) are zero.
4777 | var cols: [MPSGraphTensor] = Array(
4778 | repeating: graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32),
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4779 | count: n
4780 | )
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4809:61: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4807 | // rowIdx[i] = i ; keep where rowIdx >= j.
4808 | let rowIdx = graph.coordinate(alongAxis: 0, withShape: [NSNumber(value: n), 1], name: nil)
4809 | let rowIdxF = graph.cast(rowIdx, to: a.dataType ?? .float32, name: nil)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4810:88: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4808 | let rowIdx = graph.coordinate(alongAxis: 0, withShape: [NSNumber(value: n), 1], name: nil)
4809 | let rowIdxF = graph.cast(rowIdx, to: a.dataType ?? .float32, name: nil)
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
4812 | let zero = graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4812:97: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
4812 | let zero = graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4813 | let colJ = graph.select(predicate: keepMask, trueTensor: divided, falseTensor: zero, name: nil)
4814 |
[402/437] Compiling MetalHLOCore IntegrationTypes.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:694:13: warning: initialization of immutable value 'approximate' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
692 |
693 | let x = inputs[0]
694 | let approximate = BackendConfigParser.getBool(config, key: "approximate", default: false)
| `- warning: initialization of immutable value 'approximate' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
695 |
696 | // GELU: 0.5 * x * (1 + tanh(sqrt(2/pi) * (x + 0.044715 * x^3)))
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:749:13: warning: variable 'startIndices1' was never mutated; consider changing to 'let' constant
747 | // Split x into first half and second half along last dimension
748 | // x1 = x[..., :halfDim], x2 = x[..., halfDim:]
749 | var startIndices1 = [Int](repeating: 0, count: rank)
| `- warning: variable 'startIndices1' was never mutated; consider changing to 'let' constant
750 | var endIndices1 = xShape.map { $0.intValue }
751 | endIndices1[rank - 1] = halfDim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:789:17: warning: variable 'cosStart' was never mutated; consider changing to 'let' constant
787 | // freqs contains both cos and sin interleaved or concatenated
788 | // Assume first half is cos, second half is sin
789 | var cosStart = [Int](repeating: 0, count: freqsRank)
| `- warning: variable 'cosStart' was never mutated; consider changing to 'let' constant
790 | var cosEnd = freqsShape.map { $0.intValue }
791 | cosEnd[freqsRank - 1] = halfDim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3333:13: warning: immutable value 'targetInputOrder' was never used; consider removing it [#no-usage]
3331 |
3332 | // Transpose input to target layout
3333 | let targetInputOrder: [Int]
| `- warning: immutable value 'targetInputOrder' was never used; consider removing it [#no-usage]
3334 | switch targetDataLayout {
3335 | case .NHWC:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3364:13: warning: immutable value 'targetKernelOrder' was never used; consider removing it [#no-usage]
3362 |
3363 | // Transpose weights if needed
3364 | let targetKernelOrder: [Int]
| `- warning: immutable value 'targetKernelOrder' was never used; consider removing it [#no-usage]
3365 | switch targetWeightsLayout {
3366 | case .HWIO:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3412:13: warning: immutable value 'mpsOutputOrder' was never used; consider removing it [#no-usage]
3410 | ]
3411 |
3412 | let mpsOutputOrder: [Int]
| `- warning: immutable value 'mpsOutputOrder' was never used; consider removing it [#no-usage]
3413 | switch sourceDataLayout {
3414 | case .NHWC:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4366:17: warning: initialization of immutable value 'mask' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4364 | if bitsToRound > 0 {
4365 | // RNE: absBits = (absBits + ((1<<(bitsToRound-1)) - 1) + keptLSB) & ~mask
4366 | let mask = u32((UInt32(1) << UInt32(bitsToRound)) - 1)
| `- warning: initialization of immutable value 'mask' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4367 | let shifted = graph.bitwiseRightShift(absBits, u32(UInt32(bitsToRound)), name: nil)
4368 | let keptLSB = graph.bitwiseAND(shifted, u32(1), name: nil)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4778:97: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4776 | // entries above the diagonal (row < j) are zero.
4777 | var cols: [MPSGraphTensor] = Array(
4778 | repeating: graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32),
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4779 | count: n
4780 | )
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4809:61: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4807 | // rowIdx[i] = i ; keep where rowIdx >= j.
4808 | let rowIdx = graph.coordinate(alongAxis: 0, withShape: [NSNumber(value: n), 1], name: nil)
4809 | let rowIdxF = graph.cast(rowIdx, to: a.dataType ?? .float32, name: nil)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4810:88: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4808 | let rowIdx = graph.coordinate(alongAxis: 0, withShape: [NSNumber(value: n), 1], name: nil)
4809 | let rowIdxF = graph.cast(rowIdx, to: a.dataType ?? .float32, name: nil)
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
4812 | let zero = graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4812:97: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
4812 | let zero = graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4813 | let colJ = graph.select(predicate: keepMask, trueTensor: divided, falseTensor: zero, name: nil)
4814 |
[403/437] Compiling MetalHLOCore KernelTypes.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:694:13: warning: initialization of immutable value 'approximate' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
692 |
693 | let x = inputs[0]
694 | let approximate = BackendConfigParser.getBool(config, key: "approximate", default: false)
| `- warning: initialization of immutable value 'approximate' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
695 |
696 | // GELU: 0.5 * x * (1 + tanh(sqrt(2/pi) * (x + 0.044715 * x^3)))
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:749:13: warning: variable 'startIndices1' was never mutated; consider changing to 'let' constant
747 | // Split x into first half and second half along last dimension
748 | // x1 = x[..., :halfDim], x2 = x[..., halfDim:]
749 | var startIndices1 = [Int](repeating: 0, count: rank)
| `- warning: variable 'startIndices1' was never mutated; consider changing to 'let' constant
750 | var endIndices1 = xShape.map { $0.intValue }
751 | endIndices1[rank - 1] = halfDim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:789:17: warning: variable 'cosStart' was never mutated; consider changing to 'let' constant
787 | // freqs contains both cos and sin interleaved or concatenated
788 | // Assume first half is cos, second half is sin
789 | var cosStart = [Int](repeating: 0, count: freqsRank)
| `- warning: variable 'cosStart' was never mutated; consider changing to 'let' constant
790 | var cosEnd = freqsShape.map { $0.intValue }
791 | cosEnd[freqsRank - 1] = halfDim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3333:13: warning: immutable value 'targetInputOrder' was never used; consider removing it [#no-usage]
3331 |
3332 | // Transpose input to target layout
3333 | let targetInputOrder: [Int]
| `- warning: immutable value 'targetInputOrder' was never used; consider removing it [#no-usage]
3334 | switch targetDataLayout {
3335 | case .NHWC:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3364:13: warning: immutable value 'targetKernelOrder' was never used; consider removing it [#no-usage]
3362 |
3363 | // Transpose weights if needed
3364 | let targetKernelOrder: [Int]
| `- warning: immutable value 'targetKernelOrder' was never used; consider removing it [#no-usage]
3365 | switch targetWeightsLayout {
3366 | case .HWIO:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3412:13: warning: immutable value 'mpsOutputOrder' was never used; consider removing it [#no-usage]
3410 | ]
3411 |
3412 | let mpsOutputOrder: [Int]
| `- warning: immutable value 'mpsOutputOrder' was never used; consider removing it [#no-usage]
3413 | switch sourceDataLayout {
3414 | case .NHWC:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4366:17: warning: initialization of immutable value 'mask' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4364 | if bitsToRound > 0 {
4365 | // RNE: absBits = (absBits + ((1<<(bitsToRound-1)) - 1) + keptLSB) & ~mask
4366 | let mask = u32((UInt32(1) << UInt32(bitsToRound)) - 1)
| `- warning: initialization of immutable value 'mask' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4367 | let shifted = graph.bitwiseRightShift(absBits, u32(UInt32(bitsToRound)), name: nil)
4368 | let keptLSB = graph.bitwiseAND(shifted, u32(1), name: nil)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4778:97: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4776 | // entries above the diagonal (row < j) are zero.
4777 | var cols: [MPSGraphTensor] = Array(
4778 | repeating: graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32),
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4779 | count: n
4780 | )
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4809:61: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4807 | // rowIdx[i] = i ; keep where rowIdx >= j.
4808 | let rowIdx = graph.coordinate(alongAxis: 0, withShape: [NSNumber(value: n), 1], name: nil)
4809 | let rowIdxF = graph.cast(rowIdx, to: a.dataType ?? .float32, name: nil)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4810:88: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4808 | let rowIdx = graph.coordinate(alongAxis: 0, withShape: [NSNumber(value: n), 1], name: nil)
4809 | let rowIdxF = graph.cast(rowIdx, to: a.dataType ?? .float32, name: nil)
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
4812 | let zero = graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4812:97: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
4812 | let zero = graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4813 | let colJ = graph.select(predicate: keepMask, trueTensor: divided, falseTensor: zero, name: nil)
4814 |
[404/437] Compiling MetalHLOCore MPSGraphCompiler.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:694:13: warning: initialization of immutable value 'approximate' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
692 |
693 | let x = inputs[0]
694 | let approximate = BackendConfigParser.getBool(config, key: "approximate", default: false)
| `- warning: initialization of immutable value 'approximate' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
695 |
696 | // GELU: 0.5 * x * (1 + tanh(sqrt(2/pi) * (x + 0.044715 * x^3)))
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:749:13: warning: variable 'startIndices1' was never mutated; consider changing to 'let' constant
747 | // Split x into first half and second half along last dimension
748 | // x1 = x[..., :halfDim], x2 = x[..., halfDim:]
749 | var startIndices1 = [Int](repeating: 0, count: rank)
| `- warning: variable 'startIndices1' was never mutated; consider changing to 'let' constant
750 | var endIndices1 = xShape.map { $0.intValue }
751 | endIndices1[rank - 1] = halfDim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:789:17: warning: variable 'cosStart' was never mutated; consider changing to 'let' constant
787 | // freqs contains both cos and sin interleaved or concatenated
788 | // Assume first half is cos, second half is sin
789 | var cosStart = [Int](repeating: 0, count: freqsRank)
| `- warning: variable 'cosStart' was never mutated; consider changing to 'let' constant
790 | var cosEnd = freqsShape.map { $0.intValue }
791 | cosEnd[freqsRank - 1] = halfDim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3333:13: warning: immutable value 'targetInputOrder' was never used; consider removing it [#no-usage]
3331 |
3332 | // Transpose input to target layout
3333 | let targetInputOrder: [Int]
| `- warning: immutable value 'targetInputOrder' was never used; consider removing it [#no-usage]
3334 | switch targetDataLayout {
3335 | case .NHWC:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3364:13: warning: immutable value 'targetKernelOrder' was never used; consider removing it [#no-usage]
3362 |
3363 | // Transpose weights if needed
3364 | let targetKernelOrder: [Int]
| `- warning: immutable value 'targetKernelOrder' was never used; consider removing it [#no-usage]
3365 | switch targetWeightsLayout {
3366 | case .HWIO:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3412:13: warning: immutable value 'mpsOutputOrder' was never used; consider removing it [#no-usage]
3410 | ]
3411 |
3412 | let mpsOutputOrder: [Int]
| `- warning: immutable value 'mpsOutputOrder' was never used; consider removing it [#no-usage]
3413 | switch sourceDataLayout {
3414 | case .NHWC:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4366:17: warning: initialization of immutable value 'mask' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4364 | if bitsToRound > 0 {
4365 | // RNE: absBits = (absBits + ((1<<(bitsToRound-1)) - 1) + keptLSB) & ~mask
4366 | let mask = u32((UInt32(1) << UInt32(bitsToRound)) - 1)
| `- warning: initialization of immutable value 'mask' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4367 | let shifted = graph.bitwiseRightShift(absBits, u32(UInt32(bitsToRound)), name: nil)
4368 | let keptLSB = graph.bitwiseAND(shifted, u32(1), name: nil)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4778:97: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4776 | // entries above the diagonal (row < j) are zero.
4777 | var cols: [MPSGraphTensor] = Array(
4778 | repeating: graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32),
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4779 | count: n
4780 | )
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4809:61: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4807 | // rowIdx[i] = i ; keep where rowIdx >= j.
4808 | let rowIdx = graph.coordinate(alongAxis: 0, withShape: [NSNumber(value: n), 1], name: nil)
4809 | let rowIdxF = graph.cast(rowIdx, to: a.dataType ?? .float32, name: nil)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4810:88: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4808 | let rowIdx = graph.coordinate(alongAxis: 0, withShape: [NSNumber(value: n), 1], name: nil)
4809 | let rowIdxF = graph.cast(rowIdx, to: a.dataType ?? .float32, name: nil)
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
4812 | let zero = graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4812:97: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
4812 | let zero = graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4813 | let colJ = graph.select(predicate: keepMask, trueTensor: divided, falseTensor: zero, name: nil)
4814 |
[405/437] Compiling MetalHLOCore MetalHLOCompiler.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:694:13: warning: initialization of immutable value 'approximate' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
692 |
693 | let x = inputs[0]
694 | let approximate = BackendConfigParser.getBool(config, key: "approximate", default: false)
| `- warning: initialization of immutable value 'approximate' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
695 |
696 | // GELU: 0.5 * x * (1 + tanh(sqrt(2/pi) * (x + 0.044715 * x^3)))
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:749:13: warning: variable 'startIndices1' was never mutated; consider changing to 'let' constant
747 | // Split x into first half and second half along last dimension
748 | // x1 = x[..., :halfDim], x2 = x[..., halfDim:]
749 | var startIndices1 = [Int](repeating: 0, count: rank)
| `- warning: variable 'startIndices1' was never mutated; consider changing to 'let' constant
750 | var endIndices1 = xShape.map { $0.intValue }
751 | endIndices1[rank - 1] = halfDim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:789:17: warning: variable 'cosStart' was never mutated; consider changing to 'let' constant
787 | // freqs contains both cos and sin interleaved or concatenated
788 | // Assume first half is cos, second half is sin
789 | var cosStart = [Int](repeating: 0, count: freqsRank)
| `- warning: variable 'cosStart' was never mutated; consider changing to 'let' constant
790 | var cosEnd = freqsShape.map { $0.intValue }
791 | cosEnd[freqsRank - 1] = halfDim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3333:13: warning: immutable value 'targetInputOrder' was never used; consider removing it [#no-usage]
3331 |
3332 | // Transpose input to target layout
3333 | let targetInputOrder: [Int]
| `- warning: immutable value 'targetInputOrder' was never used; consider removing it [#no-usage]
3334 | switch targetDataLayout {
3335 | case .NHWC:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3364:13: warning: immutable value 'targetKernelOrder' was never used; consider removing it [#no-usage]
3362 |
3363 | // Transpose weights if needed
3364 | let targetKernelOrder: [Int]
| `- warning: immutable value 'targetKernelOrder' was never used; consider removing it [#no-usage]
3365 | switch targetWeightsLayout {
3366 | case .HWIO:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3412:13: warning: immutable value 'mpsOutputOrder' was never used; consider removing it [#no-usage]
3410 | ]
3411 |
3412 | let mpsOutputOrder: [Int]
| `- warning: immutable value 'mpsOutputOrder' was never used; consider removing it [#no-usage]
3413 | switch sourceDataLayout {
3414 | case .NHWC:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4366:17: warning: initialization of immutable value 'mask' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4364 | if bitsToRound > 0 {
4365 | // RNE: absBits = (absBits + ((1<<(bitsToRound-1)) - 1) + keptLSB) & ~mask
4366 | let mask = u32((UInt32(1) << UInt32(bitsToRound)) - 1)
| `- warning: initialization of immutable value 'mask' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4367 | let shifted = graph.bitwiseRightShift(absBits, u32(UInt32(bitsToRound)), name: nil)
4368 | let keptLSB = graph.bitwiseAND(shifted, u32(1), name: nil)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4778:97: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4776 | // entries above the diagonal (row < j) are zero.
4777 | var cols: [MPSGraphTensor] = Array(
4778 | repeating: graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32),
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4779 | count: n
4780 | )
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4809:61: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4807 | // rowIdx[i] = i ; keep where rowIdx >= j.
4808 | let rowIdx = graph.coordinate(alongAxis: 0, withShape: [NSNumber(value: n), 1], name: nil)
4809 | let rowIdxF = graph.cast(rowIdx, to: a.dataType ?? .float32, name: nil)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4810:88: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4808 | let rowIdx = graph.coordinate(alongAxis: 0, withShape: [NSNumber(value: n), 1], name: nil)
4809 | let rowIdxF = graph.cast(rowIdx, to: a.dataType ?? .float32, name: nil)
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
4812 | let zero = graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4812:97: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
4812 | let zero = graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4813 | let colJ = graph.select(predicate: keepMask, trueTensor: divided, falseTensor: zero, name: nil)
4814 |
[406/437] Compiling MetalHLOCore NAXGemmBundle.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:694:13: warning: initialization of immutable value 'approximate' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
692 |
693 | let x = inputs[0]
694 | let approximate = BackendConfigParser.getBool(config, key: "approximate", default: false)
| `- warning: initialization of immutable value 'approximate' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
695 |
696 | // GELU: 0.5 * x * (1 + tanh(sqrt(2/pi) * (x + 0.044715 * x^3)))
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:749:13: warning: variable 'startIndices1' was never mutated; consider changing to 'let' constant
747 | // Split x into first half and second half along last dimension
748 | // x1 = x[..., :halfDim], x2 = x[..., halfDim:]
749 | var startIndices1 = [Int](repeating: 0, count: rank)
| `- warning: variable 'startIndices1' was never mutated; consider changing to 'let' constant
750 | var endIndices1 = xShape.map { $0.intValue }
751 | endIndices1[rank - 1] = halfDim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:789:17: warning: variable 'cosStart' was never mutated; consider changing to 'let' constant
787 | // freqs contains both cos and sin interleaved or concatenated
788 | // Assume first half is cos, second half is sin
789 | var cosStart = [Int](repeating: 0, count: freqsRank)
| `- warning: variable 'cosStart' was never mutated; consider changing to 'let' constant
790 | var cosEnd = freqsShape.map { $0.intValue }
791 | cosEnd[freqsRank - 1] = halfDim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3333:13: warning: immutable value 'targetInputOrder' was never used; consider removing it [#no-usage]
3331 |
3332 | // Transpose input to target layout
3333 | let targetInputOrder: [Int]
| `- warning: immutable value 'targetInputOrder' was never used; consider removing it [#no-usage]
3334 | switch targetDataLayout {
3335 | case .NHWC:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3364:13: warning: immutable value 'targetKernelOrder' was never used; consider removing it [#no-usage]
3362 |
3363 | // Transpose weights if needed
3364 | let targetKernelOrder: [Int]
| `- warning: immutable value 'targetKernelOrder' was never used; consider removing it [#no-usage]
3365 | switch targetWeightsLayout {
3366 | case .HWIO:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3412:13: warning: immutable value 'mpsOutputOrder' was never used; consider removing it [#no-usage]
3410 | ]
3411 |
3412 | let mpsOutputOrder: [Int]
| `- warning: immutable value 'mpsOutputOrder' was never used; consider removing it [#no-usage]
3413 | switch sourceDataLayout {
3414 | case .NHWC:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4366:17: warning: initialization of immutable value 'mask' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4364 | if bitsToRound > 0 {
4365 | // RNE: absBits = (absBits + ((1<<(bitsToRound-1)) - 1) + keptLSB) & ~mask
4366 | let mask = u32((UInt32(1) << UInt32(bitsToRound)) - 1)
| `- warning: initialization of immutable value 'mask' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4367 | let shifted = graph.bitwiseRightShift(absBits, u32(UInt32(bitsToRound)), name: nil)
4368 | let keptLSB = graph.bitwiseAND(shifted, u32(1), name: nil)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4778:97: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4776 | // entries above the diagonal (row < j) are zero.
4777 | var cols: [MPSGraphTensor] = Array(
4778 | repeating: graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32),
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4779 | count: n
4780 | )
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4809:61: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4807 | // rowIdx[i] = i ; keep where rowIdx >= j.
4808 | let rowIdx = graph.coordinate(alongAxis: 0, withShape: [NSNumber(value: n), 1], name: nil)
4809 | let rowIdxF = graph.cast(rowIdx, to: a.dataType ?? .float32, name: nil)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4810:88: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4808 | let rowIdx = graph.coordinate(alongAxis: 0, withShape: [NSNumber(value: n), 1], name: nil)
4809 | let rowIdxF = graph.cast(rowIdx, to: a.dataType ?? .float32, name: nil)
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
4812 | let zero = graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4812:97: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
4812 | let zero = graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4813 | let colJ = graph.select(predicate: keepMask, trueTensor: divided, falseTensor: zero, name: nil)
4814 |
[407/437] Compiling MetalHLOCore OpEmitter.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:694:13: warning: initialization of immutable value 'approximate' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
692 |
693 | let x = inputs[0]
694 | let approximate = BackendConfigParser.getBool(config, key: "approximate", default: false)
| `- warning: initialization of immutable value 'approximate' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
695 |
696 | // GELU: 0.5 * x * (1 + tanh(sqrt(2/pi) * (x + 0.044715 * x^3)))
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:749:13: warning: variable 'startIndices1' was never mutated; consider changing to 'let' constant
747 | // Split x into first half and second half along last dimension
748 | // x1 = x[..., :halfDim], x2 = x[..., halfDim:]
749 | var startIndices1 = [Int](repeating: 0, count: rank)
| `- warning: variable 'startIndices1' was never mutated; consider changing to 'let' constant
750 | var endIndices1 = xShape.map { $0.intValue }
751 | endIndices1[rank - 1] = halfDim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CustomCallHandlers.swift:789:17: warning: variable 'cosStart' was never mutated; consider changing to 'let' constant
787 | // freqs contains both cos and sin interleaved or concatenated
788 | // Assume first half is cos, second half is sin
789 | var cosStart = [Int](repeating: 0, count: freqsRank)
| `- warning: variable 'cosStart' was never mutated; consider changing to 'let' constant
790 | var cosEnd = freqsShape.map { $0.intValue }
791 | cosEnd[freqsRank - 1] = halfDim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3333:13: warning: immutable value 'targetInputOrder' was never used; consider removing it [#no-usage]
3331 |
3332 | // Transpose input to target layout
3333 | let targetInputOrder: [Int]
| `- warning: immutable value 'targetInputOrder' was never used; consider removing it [#no-usage]
3334 | switch targetDataLayout {
3335 | case .NHWC:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3364:13: warning: immutable value 'targetKernelOrder' was never used; consider removing it [#no-usage]
3362 |
3363 | // Transpose weights if needed
3364 | let targetKernelOrder: [Int]
| `- warning: immutable value 'targetKernelOrder' was never used; consider removing it [#no-usage]
3365 | switch targetWeightsLayout {
3366 | case .HWIO:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:3412:13: warning: immutable value 'mpsOutputOrder' was never used; consider removing it [#no-usage]
3410 | ]
3411 |
3412 | let mpsOutputOrder: [Int]
| `- warning: immutable value 'mpsOutputOrder' was never used; consider removing it [#no-usage]
3413 | switch sourceDataLayout {
3414 | case .NHWC:
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4366:17: warning: initialization of immutable value 'mask' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4364 | if bitsToRound > 0 {
4365 | // RNE: absBits = (absBits + ((1<<(bitsToRound-1)) - 1) + keptLSB) & ~mask
4366 | let mask = u32((UInt32(1) << UInt32(bitsToRound)) - 1)
| `- warning: initialization of immutable value 'mask' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4367 | let shifted = graph.bitwiseRightShift(absBits, u32(UInt32(bitsToRound)), name: nil)
4368 | let keptLSB = graph.bitwiseAND(shifted, u32(1), name: nil)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4778:97: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4776 | // entries above the diagonal (row < j) are zero.
4777 | var cols: [MPSGraphTensor] = Array(
4778 | repeating: graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32),
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4779 | count: n
4780 | )
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4809:61: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4807 | // rowIdx[i] = i ; keep where rowIdx >= j.
4808 | let rowIdx = graph.coordinate(alongAxis: 0, withShape: [NSNumber(value: n), 1], name: nil)
4809 | let rowIdxF = graph.cast(rowIdx, to: a.dataType ?? .float32, name: nil)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4810:88: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4808 | let rowIdx = graph.coordinate(alongAxis: 0, withShape: [NSNumber(value: n), 1], name: nil)
4809 | let rowIdxF = graph.cast(rowIdx, to: a.dataType ?? .float32, name: nil)
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
4812 | let zero = graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/MPSGraphCompiler.swift:4812:97: warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4810 | let jConst = graph.constant(Double(j), shape: [1, 1], dataType: a.dataType ?? .float32)
4811 | let keepMask = graph.greaterThanOrEqualTo(rowIdxF, jConst, name: nil) // bool [N,1]
4812 | let zero = graph.constant(0.0, shape: [NSNumber(value: n), 1], dataType: a.dataType ?? .float32)
| `- warning: left side of nil coalescing operator '??' has non-optional type 'MPSDataType', so the right side is never used
4813 | let colJ = graph.select(predicate: keepMask, trueTensor: divided, falseTensor: zero, name: nil)
4814 |
[408/437] Compiling MetalHLOCore MetalEmitter.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:505:13: warning: initialization of immutable value 'totalElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
503 | ) -> (String, String, TuningConfig?) {
504 | let outputShape = outputShapes.first ?? []
505 | let totalElements = outputShape.reduce(1, *)
| `- warning: initialization of immutable value 'totalElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
506 | let entryPoint = "kernel_\(opKind.rawValue)"
507 | let metalType = metalTypeName(for: elementType)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1428:13: warning: initialization of immutable value 'indexGridSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1426 | if i != dimNumbers.indexVectorDim { indexGridShape.append(s) }
1427 | }
1428 | let indexGridSize = max(indexGridShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'indexGridSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1429 |
1430 | // Non-collapsed, non-batched operand dims → these are offset dims in order
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1443:13: warning: initialization of immutable value 'offsetTotalSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1441 | offsetSizes.append(sliceSizes[d])
1442 | }
1443 | let offsetTotalSize = max(offsetSizes.reduce(1, *), 1)
| `- warning: initialization of immutable value 'offsetTotalSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1444 |
1445 | // Number of index components per grid point
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1446:13: warning: initialization of immutable value 'numIndexComponents' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1444 |
1445 | // Number of index components per grid point
1446 | let numIndexComponents = dimNumbers.startIndexMap.count
| `- warning: initialization of immutable value 'numIndexComponents' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1447 |
1448 | // Indices stride for index_vector_dim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1578:13: warning: initialization of immutable value 'sliceSizes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1576 | let batchSize = operandShape[batchDim]
1577 | let startIndexMap = dimNumbers.startIndexMap
1578 | let sliceSizes = dimNumbers.sliceSizes
| `- warning: initialization of immutable value 'sliceSizes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1579 | let numStartIndices = startIndexMap.count
1580 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2124:13: warning: initialization of immutable value 'updateElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2122 | let rank = operandShape.count
2123 | let totalElements = operandShape.reduce(1, *)
2124 | let updateElements = updateShape.reduce(1, *)
| `- warning: initialization of immutable value 'updateElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2125 |
2126 | // Calculate strides
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2751:13: warning: initialization of immutable value 'totalInputElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2749 | ) -> (String, String, TuningConfig?) {
2750 | // Compute reduction parameters
2751 | let totalInputElements = inputShape.reduce(1, *)
| `- warning: initialization of immutable value 'totalInputElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2752 | let reduceDimSorted = reduceDims.sorted()
2753 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2765:13: warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2763 | if !reduceDimSorted.contains(i) { outputShape.append(s) }
2764 | }
2765 | let outputCount = max(outputShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2766 |
2767 | // innerSize = product of dims after last reduce dim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2769:13: warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2767 | // innerSize = product of dims after last reduce dim
2768 | let lastReduceDim = reduceDimSorted.last ?? 0
2769 | let innerSize = lastReduceDim + 1 < inputShape.count
| `- warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2770 | ? inputShape.suffix(from: lastReduceDim + 1).reduce(1, *)
2771 | : 1
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3017:13: warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3015 | outputShape.append(s)
3016 | }
3017 | let outputCount = max(outputShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3018 |
3019 | // innerSize = product of dims after the last reduced dim, so the scan
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3022:13: warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3020 | // strides over the reduce axis correctly for non-trailing reductions.
3021 | let lastReduceDim = reduceDimSorted.last ?? 0
3022 | let innerSize = lastReduceDim + 1 < inputShape.count
| `- warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3023 | ? inputShape.suffix(from: lastReduceDim + 1).reduce(1, *)
3024 | : 1
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3414:13: warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3412 |
3413 | let totalOutputElements = outputShape.reduce(1, *)
3414 | let batchSize = totalOutputElements / (fftType == .rfft ? (N / 2 + 1) : N)
| `- warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3415 | let isInverse = (fftType == .ifft || fftType == .irfft)
3416 | let sign = isInverse ? "1.0" : "-1.0"
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:4308:13: warning: initialization of immutable value 'sm' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4306 | private func generateMatMul2dNAXSource() -> (String, String, TuningConfig?) {
4307 | let c = CodeGenerator.naxGemmConfig()
4308 | let sm = c.bm / c.wm
| `- warning: initialization of immutable value 'sm' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4309 | let sn = c.bn / c.wn
4310 | let nsg = c.wm * c.wn
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:4309:13: warning: initialization of immutable value 'sn' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4307 | let c = CodeGenerator.naxGemmConfig()
4308 | let sm = c.bm / c.wm
4309 | let sn = c.bn / c.wn
| `- warning: initialization of immutable value 'sn' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4310 | let nsg = c.wm * c.wn
4311 | // MLX uses swizzle_log=2 for 's'/Pro devices: reshapes the launch grid
[409/437] Compiling MetalHLOCore MetalIR.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:505:13: warning: initialization of immutable value 'totalElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
503 | ) -> (String, String, TuningConfig?) {
504 | let outputShape = outputShapes.first ?? []
505 | let totalElements = outputShape.reduce(1, *)
| `- warning: initialization of immutable value 'totalElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
506 | let entryPoint = "kernel_\(opKind.rawValue)"
507 | let metalType = metalTypeName(for: elementType)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1428:13: warning: initialization of immutable value 'indexGridSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1426 | if i != dimNumbers.indexVectorDim { indexGridShape.append(s) }
1427 | }
1428 | let indexGridSize = max(indexGridShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'indexGridSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1429 |
1430 | // Non-collapsed, non-batched operand dims → these are offset dims in order
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1443:13: warning: initialization of immutable value 'offsetTotalSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1441 | offsetSizes.append(sliceSizes[d])
1442 | }
1443 | let offsetTotalSize = max(offsetSizes.reduce(1, *), 1)
| `- warning: initialization of immutable value 'offsetTotalSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1444 |
1445 | // Number of index components per grid point
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1446:13: warning: initialization of immutable value 'numIndexComponents' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1444 |
1445 | // Number of index components per grid point
1446 | let numIndexComponents = dimNumbers.startIndexMap.count
| `- warning: initialization of immutable value 'numIndexComponents' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1447 |
1448 | // Indices stride for index_vector_dim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1578:13: warning: initialization of immutable value 'sliceSizes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1576 | let batchSize = operandShape[batchDim]
1577 | let startIndexMap = dimNumbers.startIndexMap
1578 | let sliceSizes = dimNumbers.sliceSizes
| `- warning: initialization of immutable value 'sliceSizes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1579 | let numStartIndices = startIndexMap.count
1580 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2124:13: warning: initialization of immutable value 'updateElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2122 | let rank = operandShape.count
2123 | let totalElements = operandShape.reduce(1, *)
2124 | let updateElements = updateShape.reduce(1, *)
| `- warning: initialization of immutable value 'updateElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2125 |
2126 | // Calculate strides
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2751:13: warning: initialization of immutable value 'totalInputElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2749 | ) -> (String, String, TuningConfig?) {
2750 | // Compute reduction parameters
2751 | let totalInputElements = inputShape.reduce(1, *)
| `- warning: initialization of immutable value 'totalInputElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2752 | let reduceDimSorted = reduceDims.sorted()
2753 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2765:13: warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2763 | if !reduceDimSorted.contains(i) { outputShape.append(s) }
2764 | }
2765 | let outputCount = max(outputShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2766 |
2767 | // innerSize = product of dims after last reduce dim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2769:13: warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2767 | // innerSize = product of dims after last reduce dim
2768 | let lastReduceDim = reduceDimSorted.last ?? 0
2769 | let innerSize = lastReduceDim + 1 < inputShape.count
| `- warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2770 | ? inputShape.suffix(from: lastReduceDim + 1).reduce(1, *)
2771 | : 1
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3017:13: warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3015 | outputShape.append(s)
3016 | }
3017 | let outputCount = max(outputShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3018 |
3019 | // innerSize = product of dims after the last reduced dim, so the scan
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3022:13: warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3020 | // strides over the reduce axis correctly for non-trailing reductions.
3021 | let lastReduceDim = reduceDimSorted.last ?? 0
3022 | let innerSize = lastReduceDim + 1 < inputShape.count
| `- warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3023 | ? inputShape.suffix(from: lastReduceDim + 1).reduce(1, *)
3024 | : 1
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3414:13: warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3412 |
3413 | let totalOutputElements = outputShape.reduce(1, *)
3414 | let batchSize = totalOutputElements / (fftType == .rfft ? (N / 2 + 1) : N)
| `- warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3415 | let isInverse = (fftType == .ifft || fftType == .irfft)
3416 | let sign = isInverse ? "1.0" : "-1.0"
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:4308:13: warning: initialization of immutable value 'sm' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4306 | private func generateMatMul2dNAXSource() -> (String, String, TuningConfig?) {
4307 | let c = CodeGenerator.naxGemmConfig()
4308 | let sm = c.bm / c.wm
| `- warning: initialization of immutable value 'sm' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4309 | let sn = c.bn / c.wn
4310 | let nsg = c.wm * c.wn
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:4309:13: warning: initialization of immutable value 'sn' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4307 | let c = CodeGenerator.naxGemmConfig()
4308 | let sm = c.bm / c.wm
4309 | let sn = c.bn / c.wn
| `- warning: initialization of immutable value 'sn' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4310 | let nsg = c.wm * c.wn
4311 | // MLX uses swizzle_log=2 for 's'/Pro devices: reshapes the launch grid
[410/437] Compiling MetalHLOCore PatternCodegen.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:505:13: warning: initialization of immutable value 'totalElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
503 | ) -> (String, String, TuningConfig?) {
504 | let outputShape = outputShapes.first ?? []
505 | let totalElements = outputShape.reduce(1, *)
| `- warning: initialization of immutable value 'totalElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
506 | let entryPoint = "kernel_\(opKind.rawValue)"
507 | let metalType = metalTypeName(for: elementType)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1428:13: warning: initialization of immutable value 'indexGridSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1426 | if i != dimNumbers.indexVectorDim { indexGridShape.append(s) }
1427 | }
1428 | let indexGridSize = max(indexGridShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'indexGridSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1429 |
1430 | // Non-collapsed, non-batched operand dims → these are offset dims in order
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1443:13: warning: initialization of immutable value 'offsetTotalSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1441 | offsetSizes.append(sliceSizes[d])
1442 | }
1443 | let offsetTotalSize = max(offsetSizes.reduce(1, *), 1)
| `- warning: initialization of immutable value 'offsetTotalSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1444 |
1445 | // Number of index components per grid point
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1446:13: warning: initialization of immutable value 'numIndexComponents' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1444 |
1445 | // Number of index components per grid point
1446 | let numIndexComponents = dimNumbers.startIndexMap.count
| `- warning: initialization of immutable value 'numIndexComponents' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1447 |
1448 | // Indices stride for index_vector_dim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1578:13: warning: initialization of immutable value 'sliceSizes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1576 | let batchSize = operandShape[batchDim]
1577 | let startIndexMap = dimNumbers.startIndexMap
1578 | let sliceSizes = dimNumbers.sliceSizes
| `- warning: initialization of immutable value 'sliceSizes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1579 | let numStartIndices = startIndexMap.count
1580 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2124:13: warning: initialization of immutable value 'updateElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2122 | let rank = operandShape.count
2123 | let totalElements = operandShape.reduce(1, *)
2124 | let updateElements = updateShape.reduce(1, *)
| `- warning: initialization of immutable value 'updateElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2125 |
2126 | // Calculate strides
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2751:13: warning: initialization of immutable value 'totalInputElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2749 | ) -> (String, String, TuningConfig?) {
2750 | // Compute reduction parameters
2751 | let totalInputElements = inputShape.reduce(1, *)
| `- warning: initialization of immutable value 'totalInputElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2752 | let reduceDimSorted = reduceDims.sorted()
2753 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2765:13: warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2763 | if !reduceDimSorted.contains(i) { outputShape.append(s) }
2764 | }
2765 | let outputCount = max(outputShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2766 |
2767 | // innerSize = product of dims after last reduce dim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2769:13: warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2767 | // innerSize = product of dims after last reduce dim
2768 | let lastReduceDim = reduceDimSorted.last ?? 0
2769 | let innerSize = lastReduceDim + 1 < inputShape.count
| `- warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2770 | ? inputShape.suffix(from: lastReduceDim + 1).reduce(1, *)
2771 | : 1
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3017:13: warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3015 | outputShape.append(s)
3016 | }
3017 | let outputCount = max(outputShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3018 |
3019 | // innerSize = product of dims after the last reduced dim, so the scan
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3022:13: warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3020 | // strides over the reduce axis correctly for non-trailing reductions.
3021 | let lastReduceDim = reduceDimSorted.last ?? 0
3022 | let innerSize = lastReduceDim + 1 < inputShape.count
| `- warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3023 | ? inputShape.suffix(from: lastReduceDim + 1).reduce(1, *)
3024 | : 1
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3414:13: warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3412 |
3413 | let totalOutputElements = outputShape.reduce(1, *)
3414 | let batchSize = totalOutputElements / (fftType == .rfft ? (N / 2 + 1) : N)
| `- warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3415 | let isInverse = (fftType == .ifft || fftType == .irfft)
3416 | let sign = isInverse ? "1.0" : "-1.0"
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:4308:13: warning: initialization of immutable value 'sm' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4306 | private func generateMatMul2dNAXSource() -> (String, String, TuningConfig?) {
4307 | let c = CodeGenerator.naxGemmConfig()
4308 | let sm = c.bm / c.wm
| `- warning: initialization of immutable value 'sm' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4309 | let sn = c.bn / c.wn
4310 | let nsg = c.wm * c.wn
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:4309:13: warning: initialization of immutable value 'sn' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4307 | let c = CodeGenerator.naxGemmConfig()
4308 | let sm = c.bm / c.wm
4309 | let sn = c.bn / c.wn
| `- warning: initialization of immutable value 'sn' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4310 | let nsg = c.wm * c.wn
4311 | // MLX uses swizzle_log=2 for 's'/Pro devices: reshapes the launch grid
[411/437] Compiling MetalHLOCore ReductionKernelGenerator.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:505:13: warning: initialization of immutable value 'totalElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
503 | ) -> (String, String, TuningConfig?) {
504 | let outputShape = outputShapes.first ?? []
505 | let totalElements = outputShape.reduce(1, *)
| `- warning: initialization of immutable value 'totalElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
506 | let entryPoint = "kernel_\(opKind.rawValue)"
507 | let metalType = metalTypeName(for: elementType)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1428:13: warning: initialization of immutable value 'indexGridSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1426 | if i != dimNumbers.indexVectorDim { indexGridShape.append(s) }
1427 | }
1428 | let indexGridSize = max(indexGridShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'indexGridSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1429 |
1430 | // Non-collapsed, non-batched operand dims → these are offset dims in order
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1443:13: warning: initialization of immutable value 'offsetTotalSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1441 | offsetSizes.append(sliceSizes[d])
1442 | }
1443 | let offsetTotalSize = max(offsetSizes.reduce(1, *), 1)
| `- warning: initialization of immutable value 'offsetTotalSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1444 |
1445 | // Number of index components per grid point
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1446:13: warning: initialization of immutable value 'numIndexComponents' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1444 |
1445 | // Number of index components per grid point
1446 | let numIndexComponents = dimNumbers.startIndexMap.count
| `- warning: initialization of immutable value 'numIndexComponents' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1447 |
1448 | // Indices stride for index_vector_dim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1578:13: warning: initialization of immutable value 'sliceSizes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1576 | let batchSize = operandShape[batchDim]
1577 | let startIndexMap = dimNumbers.startIndexMap
1578 | let sliceSizes = dimNumbers.sliceSizes
| `- warning: initialization of immutable value 'sliceSizes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1579 | let numStartIndices = startIndexMap.count
1580 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2124:13: warning: initialization of immutable value 'updateElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2122 | let rank = operandShape.count
2123 | let totalElements = operandShape.reduce(1, *)
2124 | let updateElements = updateShape.reduce(1, *)
| `- warning: initialization of immutable value 'updateElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2125 |
2126 | // Calculate strides
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2751:13: warning: initialization of immutable value 'totalInputElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2749 | ) -> (String, String, TuningConfig?) {
2750 | // Compute reduction parameters
2751 | let totalInputElements = inputShape.reduce(1, *)
| `- warning: initialization of immutable value 'totalInputElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2752 | let reduceDimSorted = reduceDims.sorted()
2753 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2765:13: warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2763 | if !reduceDimSorted.contains(i) { outputShape.append(s) }
2764 | }
2765 | let outputCount = max(outputShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2766 |
2767 | // innerSize = product of dims after last reduce dim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2769:13: warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2767 | // innerSize = product of dims after last reduce dim
2768 | let lastReduceDim = reduceDimSorted.last ?? 0
2769 | let innerSize = lastReduceDim + 1 < inputShape.count
| `- warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2770 | ? inputShape.suffix(from: lastReduceDim + 1).reduce(1, *)
2771 | : 1
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3017:13: warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3015 | outputShape.append(s)
3016 | }
3017 | let outputCount = max(outputShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3018 |
3019 | // innerSize = product of dims after the last reduced dim, so the scan
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3022:13: warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3020 | // strides over the reduce axis correctly for non-trailing reductions.
3021 | let lastReduceDim = reduceDimSorted.last ?? 0
3022 | let innerSize = lastReduceDim + 1 < inputShape.count
| `- warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3023 | ? inputShape.suffix(from: lastReduceDim + 1).reduce(1, *)
3024 | : 1
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3414:13: warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3412 |
3413 | let totalOutputElements = outputShape.reduce(1, *)
3414 | let batchSize = totalOutputElements / (fftType == .rfft ? (N / 2 + 1) : N)
| `- warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3415 | let isInverse = (fftType == .ifft || fftType == .irfft)
3416 | let sign = isInverse ? "1.0" : "-1.0"
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:4308:13: warning: initialization of immutable value 'sm' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4306 | private func generateMatMul2dNAXSource() -> (String, String, TuningConfig?) {
4307 | let c = CodeGenerator.naxGemmConfig()
4308 | let sm = c.bm / c.wm
| `- warning: initialization of immutable value 'sm' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4309 | let sn = c.bn / c.wn
4310 | let nsg = c.wm * c.wn
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:4309:13: warning: initialization of immutable value 'sn' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4307 | let c = CodeGenerator.naxGemmConfig()
4308 | let sm = c.bm / c.wm
4309 | let sn = c.bn / c.wn
| `- warning: initialization of immutable value 'sn' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4310 | let nsg = c.wm * c.wn
4311 | // MLX uses swizzle_log=2 for 's'/Pro devices: reshapes the launch grid
[412/437] Compiling MetalHLOCore SpecializedAttention.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:505:13: warning: initialization of immutable value 'totalElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
503 | ) -> (String, String, TuningConfig?) {
504 | let outputShape = outputShapes.first ?? []
505 | let totalElements = outputShape.reduce(1, *)
| `- warning: initialization of immutable value 'totalElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
506 | let entryPoint = "kernel_\(opKind.rawValue)"
507 | let metalType = metalTypeName(for: elementType)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1428:13: warning: initialization of immutable value 'indexGridSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1426 | if i != dimNumbers.indexVectorDim { indexGridShape.append(s) }
1427 | }
1428 | let indexGridSize = max(indexGridShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'indexGridSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1429 |
1430 | // Non-collapsed, non-batched operand dims → these are offset dims in order
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1443:13: warning: initialization of immutable value 'offsetTotalSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1441 | offsetSizes.append(sliceSizes[d])
1442 | }
1443 | let offsetTotalSize = max(offsetSizes.reduce(1, *), 1)
| `- warning: initialization of immutable value 'offsetTotalSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1444 |
1445 | // Number of index components per grid point
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1446:13: warning: initialization of immutable value 'numIndexComponents' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1444 |
1445 | // Number of index components per grid point
1446 | let numIndexComponents = dimNumbers.startIndexMap.count
| `- warning: initialization of immutable value 'numIndexComponents' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1447 |
1448 | // Indices stride for index_vector_dim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1578:13: warning: initialization of immutable value 'sliceSizes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1576 | let batchSize = operandShape[batchDim]
1577 | let startIndexMap = dimNumbers.startIndexMap
1578 | let sliceSizes = dimNumbers.sliceSizes
| `- warning: initialization of immutable value 'sliceSizes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1579 | let numStartIndices = startIndexMap.count
1580 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2124:13: warning: initialization of immutable value 'updateElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2122 | let rank = operandShape.count
2123 | let totalElements = operandShape.reduce(1, *)
2124 | let updateElements = updateShape.reduce(1, *)
| `- warning: initialization of immutable value 'updateElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2125 |
2126 | // Calculate strides
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2751:13: warning: initialization of immutable value 'totalInputElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2749 | ) -> (String, String, TuningConfig?) {
2750 | // Compute reduction parameters
2751 | let totalInputElements = inputShape.reduce(1, *)
| `- warning: initialization of immutable value 'totalInputElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2752 | let reduceDimSorted = reduceDims.sorted()
2753 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2765:13: warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2763 | if !reduceDimSorted.contains(i) { outputShape.append(s) }
2764 | }
2765 | let outputCount = max(outputShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2766 |
2767 | // innerSize = product of dims after last reduce dim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2769:13: warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2767 | // innerSize = product of dims after last reduce dim
2768 | let lastReduceDim = reduceDimSorted.last ?? 0
2769 | let innerSize = lastReduceDim + 1 < inputShape.count
| `- warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2770 | ? inputShape.suffix(from: lastReduceDim + 1).reduce(1, *)
2771 | : 1
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3017:13: warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3015 | outputShape.append(s)
3016 | }
3017 | let outputCount = max(outputShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3018 |
3019 | // innerSize = product of dims after the last reduced dim, so the scan
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3022:13: warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3020 | // strides over the reduce axis correctly for non-trailing reductions.
3021 | let lastReduceDim = reduceDimSorted.last ?? 0
3022 | let innerSize = lastReduceDim + 1 < inputShape.count
| `- warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3023 | ? inputShape.suffix(from: lastReduceDim + 1).reduce(1, *)
3024 | : 1
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3414:13: warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3412 |
3413 | let totalOutputElements = outputShape.reduce(1, *)
3414 | let batchSize = totalOutputElements / (fftType == .rfft ? (N / 2 + 1) : N)
| `- warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3415 | let isInverse = (fftType == .ifft || fftType == .irfft)
3416 | let sign = isInverse ? "1.0" : "-1.0"
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:4308:13: warning: initialization of immutable value 'sm' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4306 | private func generateMatMul2dNAXSource() -> (String, String, TuningConfig?) {
4307 | let c = CodeGenerator.naxGemmConfig()
4308 | let sm = c.bm / c.wm
| `- warning: initialization of immutable value 'sm' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4309 | let sn = c.bn / c.wn
4310 | let nsg = c.wm * c.wn
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:4309:13: warning: initialization of immutable value 'sn' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4307 | let c = CodeGenerator.naxGemmConfig()
4308 | let sm = c.bm / c.wm
4309 | let sn = c.bn / c.wn
| `- warning: initialization of immutable value 'sn' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4310 | let nsg = c.wm * c.wn
4311 | // MLX uses swizzle_log=2 for 's'/Pro devices: reshapes the launch grid
[413/437] Compiling MetalHLOCore SpecializedMatMul.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:505:13: warning: initialization of immutable value 'totalElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
503 | ) -> (String, String, TuningConfig?) {
504 | let outputShape = outputShapes.first ?? []
505 | let totalElements = outputShape.reduce(1, *)
| `- warning: initialization of immutable value 'totalElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
506 | let entryPoint = "kernel_\(opKind.rawValue)"
507 | let metalType = metalTypeName(for: elementType)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1428:13: warning: initialization of immutable value 'indexGridSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1426 | if i != dimNumbers.indexVectorDim { indexGridShape.append(s) }
1427 | }
1428 | let indexGridSize = max(indexGridShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'indexGridSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1429 |
1430 | // Non-collapsed, non-batched operand dims → these are offset dims in order
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1443:13: warning: initialization of immutable value 'offsetTotalSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1441 | offsetSizes.append(sliceSizes[d])
1442 | }
1443 | let offsetTotalSize = max(offsetSizes.reduce(1, *), 1)
| `- warning: initialization of immutable value 'offsetTotalSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1444 |
1445 | // Number of index components per grid point
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1446:13: warning: initialization of immutable value 'numIndexComponents' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1444 |
1445 | // Number of index components per grid point
1446 | let numIndexComponents = dimNumbers.startIndexMap.count
| `- warning: initialization of immutable value 'numIndexComponents' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1447 |
1448 | // Indices stride for index_vector_dim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1578:13: warning: initialization of immutable value 'sliceSizes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1576 | let batchSize = operandShape[batchDim]
1577 | let startIndexMap = dimNumbers.startIndexMap
1578 | let sliceSizes = dimNumbers.sliceSizes
| `- warning: initialization of immutable value 'sliceSizes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1579 | let numStartIndices = startIndexMap.count
1580 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2124:13: warning: initialization of immutable value 'updateElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2122 | let rank = operandShape.count
2123 | let totalElements = operandShape.reduce(1, *)
2124 | let updateElements = updateShape.reduce(1, *)
| `- warning: initialization of immutable value 'updateElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2125 |
2126 | // Calculate strides
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2751:13: warning: initialization of immutable value 'totalInputElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2749 | ) -> (String, String, TuningConfig?) {
2750 | // Compute reduction parameters
2751 | let totalInputElements = inputShape.reduce(1, *)
| `- warning: initialization of immutable value 'totalInputElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2752 | let reduceDimSorted = reduceDims.sorted()
2753 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2765:13: warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2763 | if !reduceDimSorted.contains(i) { outputShape.append(s) }
2764 | }
2765 | let outputCount = max(outputShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2766 |
2767 | // innerSize = product of dims after last reduce dim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2769:13: warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2767 | // innerSize = product of dims after last reduce dim
2768 | let lastReduceDim = reduceDimSorted.last ?? 0
2769 | let innerSize = lastReduceDim + 1 < inputShape.count
| `- warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2770 | ? inputShape.suffix(from: lastReduceDim + 1).reduce(1, *)
2771 | : 1
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3017:13: warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3015 | outputShape.append(s)
3016 | }
3017 | let outputCount = max(outputShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3018 |
3019 | // innerSize = product of dims after the last reduced dim, so the scan
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3022:13: warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3020 | // strides over the reduce axis correctly for non-trailing reductions.
3021 | let lastReduceDim = reduceDimSorted.last ?? 0
3022 | let innerSize = lastReduceDim + 1 < inputShape.count
| `- warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3023 | ? inputShape.suffix(from: lastReduceDim + 1).reduce(1, *)
3024 | : 1
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3414:13: warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3412 |
3413 | let totalOutputElements = outputShape.reduce(1, *)
3414 | let batchSize = totalOutputElements / (fftType == .rfft ? (N / 2 + 1) : N)
| `- warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3415 | let isInverse = (fftType == .ifft || fftType == .irfft)
3416 | let sign = isInverse ? "1.0" : "-1.0"
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:4308:13: warning: initialization of immutable value 'sm' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4306 | private func generateMatMul2dNAXSource() -> (String, String, TuningConfig?) {
4307 | let c = CodeGenerator.naxGemmConfig()
4308 | let sm = c.bm / c.wm
| `- warning: initialization of immutable value 'sm' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4309 | let sn = c.bn / c.wn
4310 | let nsg = c.wm * c.wn
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:4309:13: warning: initialization of immutable value 'sn' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4307 | let c = CodeGenerator.naxGemmConfig()
4308 | let sm = c.bm / c.wm
4309 | let sn = c.bn / c.wn
| `- warning: initialization of immutable value 'sn' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4310 | let nsg = c.wm * c.wn
4311 | // MLX uses swizzle_log=2 for 's'/Pro devices: reshapes the launch grid
[414/437] Compiling MetalHLOCore TileCalculator.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:505:13: warning: initialization of immutable value 'totalElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
503 | ) -> (String, String, TuningConfig?) {
504 | let outputShape = outputShapes.first ?? []
505 | let totalElements = outputShape.reduce(1, *)
| `- warning: initialization of immutable value 'totalElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
506 | let entryPoint = "kernel_\(opKind.rawValue)"
507 | let metalType = metalTypeName(for: elementType)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1428:13: warning: initialization of immutable value 'indexGridSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1426 | if i != dimNumbers.indexVectorDim { indexGridShape.append(s) }
1427 | }
1428 | let indexGridSize = max(indexGridShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'indexGridSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1429 |
1430 | // Non-collapsed, non-batched operand dims → these are offset dims in order
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1443:13: warning: initialization of immutable value 'offsetTotalSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1441 | offsetSizes.append(sliceSizes[d])
1442 | }
1443 | let offsetTotalSize = max(offsetSizes.reduce(1, *), 1)
| `- warning: initialization of immutable value 'offsetTotalSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1444 |
1445 | // Number of index components per grid point
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1446:13: warning: initialization of immutable value 'numIndexComponents' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1444 |
1445 | // Number of index components per grid point
1446 | let numIndexComponents = dimNumbers.startIndexMap.count
| `- warning: initialization of immutable value 'numIndexComponents' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1447 |
1448 | // Indices stride for index_vector_dim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1578:13: warning: initialization of immutable value 'sliceSizes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1576 | let batchSize = operandShape[batchDim]
1577 | let startIndexMap = dimNumbers.startIndexMap
1578 | let sliceSizes = dimNumbers.sliceSizes
| `- warning: initialization of immutable value 'sliceSizes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1579 | let numStartIndices = startIndexMap.count
1580 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2124:13: warning: initialization of immutable value 'updateElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2122 | let rank = operandShape.count
2123 | let totalElements = operandShape.reduce(1, *)
2124 | let updateElements = updateShape.reduce(1, *)
| `- warning: initialization of immutable value 'updateElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2125 |
2126 | // Calculate strides
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2751:13: warning: initialization of immutable value 'totalInputElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2749 | ) -> (String, String, TuningConfig?) {
2750 | // Compute reduction parameters
2751 | let totalInputElements = inputShape.reduce(1, *)
| `- warning: initialization of immutable value 'totalInputElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2752 | let reduceDimSorted = reduceDims.sorted()
2753 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2765:13: warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2763 | if !reduceDimSorted.contains(i) { outputShape.append(s) }
2764 | }
2765 | let outputCount = max(outputShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2766 |
2767 | // innerSize = product of dims after last reduce dim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2769:13: warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2767 | // innerSize = product of dims after last reduce dim
2768 | let lastReduceDim = reduceDimSorted.last ?? 0
2769 | let innerSize = lastReduceDim + 1 < inputShape.count
| `- warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2770 | ? inputShape.suffix(from: lastReduceDim + 1).reduce(1, *)
2771 | : 1
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3017:13: warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3015 | outputShape.append(s)
3016 | }
3017 | let outputCount = max(outputShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3018 |
3019 | // innerSize = product of dims after the last reduced dim, so the scan
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3022:13: warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3020 | // strides over the reduce axis correctly for non-trailing reductions.
3021 | let lastReduceDim = reduceDimSorted.last ?? 0
3022 | let innerSize = lastReduceDim + 1 < inputShape.count
| `- warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3023 | ? inputShape.suffix(from: lastReduceDim + 1).reduce(1, *)
3024 | : 1
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3414:13: warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3412 |
3413 | let totalOutputElements = outputShape.reduce(1, *)
3414 | let batchSize = totalOutputElements / (fftType == .rfft ? (N / 2 + 1) : N)
| `- warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3415 | let isInverse = (fftType == .ifft || fftType == .irfft)
3416 | let sign = isInverse ? "1.0" : "-1.0"
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:4308:13: warning: initialization of immutable value 'sm' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4306 | private func generateMatMul2dNAXSource() -> (String, String, TuningConfig?) {
4307 | let c = CodeGenerator.naxGemmConfig()
4308 | let sm = c.bm / c.wm
| `- warning: initialization of immutable value 'sm' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4309 | let sn = c.bn / c.wn
4310 | let nsg = c.wm * c.wn
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:4309:13: warning: initialization of immutable value 'sn' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4307 | let c = CodeGenerator.naxGemmConfig()
4308 | let sm = c.bm / c.wm
4309 | let sn = c.bn / c.wn
| `- warning: initialization of immutable value 'sn' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4310 | let nsg = c.wm * c.wn
4311 | // MLX uses swizzle_log=2 for 's'/Pro devices: reshapes the launch grid
[415/437] Compiling MetalHLOCore Analyzer.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:505:13: warning: initialization of immutable value 'totalElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
503 | ) -> (String, String, TuningConfig?) {
504 | let outputShape = outputShapes.first ?? []
505 | let totalElements = outputShape.reduce(1, *)
| `- warning: initialization of immutable value 'totalElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
506 | let entryPoint = "kernel_\(opKind.rawValue)"
507 | let metalType = metalTypeName(for: elementType)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1428:13: warning: initialization of immutable value 'indexGridSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1426 | if i != dimNumbers.indexVectorDim { indexGridShape.append(s) }
1427 | }
1428 | let indexGridSize = max(indexGridShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'indexGridSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1429 |
1430 | // Non-collapsed, non-batched operand dims → these are offset dims in order
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1443:13: warning: initialization of immutable value 'offsetTotalSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1441 | offsetSizes.append(sliceSizes[d])
1442 | }
1443 | let offsetTotalSize = max(offsetSizes.reduce(1, *), 1)
| `- warning: initialization of immutable value 'offsetTotalSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1444 |
1445 | // Number of index components per grid point
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1446:13: warning: initialization of immutable value 'numIndexComponents' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1444 |
1445 | // Number of index components per grid point
1446 | let numIndexComponents = dimNumbers.startIndexMap.count
| `- warning: initialization of immutable value 'numIndexComponents' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1447 |
1448 | // Indices stride for index_vector_dim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1578:13: warning: initialization of immutable value 'sliceSizes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1576 | let batchSize = operandShape[batchDim]
1577 | let startIndexMap = dimNumbers.startIndexMap
1578 | let sliceSizes = dimNumbers.sliceSizes
| `- warning: initialization of immutable value 'sliceSizes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1579 | let numStartIndices = startIndexMap.count
1580 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2124:13: warning: initialization of immutable value 'updateElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2122 | let rank = operandShape.count
2123 | let totalElements = operandShape.reduce(1, *)
2124 | let updateElements = updateShape.reduce(1, *)
| `- warning: initialization of immutable value 'updateElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2125 |
2126 | // Calculate strides
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2751:13: warning: initialization of immutable value 'totalInputElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2749 | ) -> (String, String, TuningConfig?) {
2750 | // Compute reduction parameters
2751 | let totalInputElements = inputShape.reduce(1, *)
| `- warning: initialization of immutable value 'totalInputElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2752 | let reduceDimSorted = reduceDims.sorted()
2753 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2765:13: warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2763 | if !reduceDimSorted.contains(i) { outputShape.append(s) }
2764 | }
2765 | let outputCount = max(outputShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2766 |
2767 | // innerSize = product of dims after last reduce dim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2769:13: warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2767 | // innerSize = product of dims after last reduce dim
2768 | let lastReduceDim = reduceDimSorted.last ?? 0
2769 | let innerSize = lastReduceDim + 1 < inputShape.count
| `- warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2770 | ? inputShape.suffix(from: lastReduceDim + 1).reduce(1, *)
2771 | : 1
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3017:13: warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3015 | outputShape.append(s)
3016 | }
3017 | let outputCount = max(outputShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3018 |
3019 | // innerSize = product of dims after the last reduced dim, so the scan
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3022:13: warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3020 | // strides over the reduce axis correctly for non-trailing reductions.
3021 | let lastReduceDim = reduceDimSorted.last ?? 0
3022 | let innerSize = lastReduceDim + 1 < inputShape.count
| `- warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3023 | ? inputShape.suffix(from: lastReduceDim + 1).reduce(1, *)
3024 | : 1
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3414:13: warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3412 |
3413 | let totalOutputElements = outputShape.reduce(1, *)
3414 | let batchSize = totalOutputElements / (fftType == .rfft ? (N / 2 + 1) : N)
| `- warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3415 | let isInverse = (fftType == .ifft || fftType == .irfft)
3416 | let sign = isInverse ? "1.0" : "-1.0"
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:4308:13: warning: initialization of immutable value 'sm' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4306 | private func generateMatMul2dNAXSource() -> (String, String, TuningConfig?) {
4307 | let c = CodeGenerator.naxGemmConfig()
4308 | let sm = c.bm / c.wm
| `- warning: initialization of immutable value 'sm' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4309 | let sn = c.bn / c.wn
4310 | let nsg = c.wm * c.wn
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:4309:13: warning: initialization of immutable value 'sn' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4307 | let c = CodeGenerator.naxGemmConfig()
4308 | let sm = c.bm / c.wm
4309 | let sn = c.bn / c.wn
| `- warning: initialization of immutable value 'sn' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4310 | let nsg = c.wm * c.wn
4311 | // MLX uses swizzle_log=2 for 's'/Pro devices: reshapes the launch grid
[416/437] Compiling MetalHLOCore CodeGenerator.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:505:13: warning: initialization of immutable value 'totalElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
503 | ) -> (String, String, TuningConfig?) {
504 | let outputShape = outputShapes.first ?? []
505 | let totalElements = outputShape.reduce(1, *)
| `- warning: initialization of immutable value 'totalElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
506 | let entryPoint = "kernel_\(opKind.rawValue)"
507 | let metalType = metalTypeName(for: elementType)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1428:13: warning: initialization of immutable value 'indexGridSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1426 | if i != dimNumbers.indexVectorDim { indexGridShape.append(s) }
1427 | }
1428 | let indexGridSize = max(indexGridShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'indexGridSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1429 |
1430 | // Non-collapsed, non-batched operand dims → these are offset dims in order
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1443:13: warning: initialization of immutable value 'offsetTotalSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1441 | offsetSizes.append(sliceSizes[d])
1442 | }
1443 | let offsetTotalSize = max(offsetSizes.reduce(1, *), 1)
| `- warning: initialization of immutable value 'offsetTotalSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1444 |
1445 | // Number of index components per grid point
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1446:13: warning: initialization of immutable value 'numIndexComponents' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1444 |
1445 | // Number of index components per grid point
1446 | let numIndexComponents = dimNumbers.startIndexMap.count
| `- warning: initialization of immutable value 'numIndexComponents' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1447 |
1448 | // Indices stride for index_vector_dim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:1578:13: warning: initialization of immutable value 'sliceSizes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1576 | let batchSize = operandShape[batchDim]
1577 | let startIndexMap = dimNumbers.startIndexMap
1578 | let sliceSizes = dimNumbers.sliceSizes
| `- warning: initialization of immutable value 'sliceSizes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
1579 | let numStartIndices = startIndexMap.count
1580 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2124:13: warning: initialization of immutable value 'updateElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2122 | let rank = operandShape.count
2123 | let totalElements = operandShape.reduce(1, *)
2124 | let updateElements = updateShape.reduce(1, *)
| `- warning: initialization of immutable value 'updateElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2125 |
2126 | // Calculate strides
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2751:13: warning: initialization of immutable value 'totalInputElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2749 | ) -> (String, String, TuningConfig?) {
2750 | // Compute reduction parameters
2751 | let totalInputElements = inputShape.reduce(1, *)
| `- warning: initialization of immutable value 'totalInputElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2752 | let reduceDimSorted = reduceDims.sorted()
2753 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2765:13: warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2763 | if !reduceDimSorted.contains(i) { outputShape.append(s) }
2764 | }
2765 | let outputCount = max(outputShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2766 |
2767 | // innerSize = product of dims after last reduce dim
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:2769:13: warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2767 | // innerSize = product of dims after last reduce dim
2768 | let lastReduceDim = reduceDimSorted.last ?? 0
2769 | let innerSize = lastReduceDim + 1 < inputShape.count
| `- warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
2770 | ? inputShape.suffix(from: lastReduceDim + 1).reduce(1, *)
2771 | : 1
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3017:13: warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3015 | outputShape.append(s)
3016 | }
3017 | let outputCount = max(outputShape.reduce(1, *), 1)
| `- warning: initialization of immutable value 'outputCount' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3018 |
3019 | // innerSize = product of dims after the last reduced dim, so the scan
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3022:13: warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3020 | // strides over the reduce axis correctly for non-trailing reductions.
3021 | let lastReduceDim = reduceDimSorted.last ?? 0
3022 | let innerSize = lastReduceDim + 1 < inputShape.count
| `- warning: initialization of immutable value 'innerSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3023 | ? inputShape.suffix(from: lastReduceDim + 1).reduce(1, *)
3024 | : 1
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:3414:13: warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3412 |
3413 | let totalOutputElements = outputShape.reduce(1, *)
3414 | let batchSize = totalOutputElements / (fftType == .rfft ? (N / 2 + 1) : N)
| `- warning: initialization of immutable value 'batchSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
3415 | let isInverse = (fftType == .ifft || fftType == .irfft)
3416 | let sign = isInverse ? "1.0" : "-1.0"
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:4308:13: warning: initialization of immutable value 'sm' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4306 | private func generateMatMul2dNAXSource() -> (String, String, TuningConfig?) {
4307 | let c = CodeGenerator.naxGemmConfig()
4308 | let sm = c.bm / c.wm
| `- warning: initialization of immutable value 'sm' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4309 | let sn = c.bn / c.wn
4310 | let nsg = c.wm * c.wn
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Compiler/CodeGenerator.swift:4309:13: warning: initialization of immutable value 'sn' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4307 | let c = CodeGenerator.naxGemmConfig()
4308 | let sm = c.bm / c.wm
4309 | let sn = c.bn / c.wn
| `- warning: initialization of immutable value 'sn' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
4310 | let nsg = c.wm * c.wn
4311 | // MLX uses swizzle_log=2 for 's'/Pro devices: reshapes the launch grid
[417/437] Compiling MetalHLOCore QuantizationAware.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:193:13: warning: initialization of immutable value 'originalMemory' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
191 |
192 | // Compute original memory usage
193 | let originalMemory = computePeakMemory(function, decisions: [:])
| `- warning: initialization of immutable value 'originalMemory' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
194 |
195 | // Decide which tensors to rematerialize
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:334:14: warning: immutable value 'opIndex' was never used; consider replacing with '_' or removing it [#no-usage]
332 | var costs: [String: RecomputationCost] = [:]
333 |
334 | for (opIndex, op) in function.operations.enumerated() {
| `- warning: immutable value 'opIndex' was never used; consider replacing with '_' or removing it [#no-usage]
335 | let memoryCost = op.resultType.byteCount
336 | let computeCost = estimateComputeCost(op)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:470:13: warning: initialization of immutable value 'averageSegmentSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
468 | // With checkpointing, only need to store activations between checkpoints
469 | let numSegments = checkpoints.count + 1
470 | let averageSegmentSize = function.operations.count / numSegments
| `- warning: initialization of immutable value 'averageSegmentSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
471 |
472 | // Estimate memory per segment
[418/437] Compiling MetalHLOCore Rematerialization.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:193:13: warning: initialization of immutable value 'originalMemory' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
191 |
192 | // Compute original memory usage
193 | let originalMemory = computePeakMemory(function, decisions: [:])
| `- warning: initialization of immutable value 'originalMemory' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
194 |
195 | // Decide which tensors to rematerialize
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:334:14: warning: immutable value 'opIndex' was never used; consider replacing with '_' or removing it [#no-usage]
332 | var costs: [String: RecomputationCost] = [:]
333 |
334 | for (opIndex, op) in function.operations.enumerated() {
| `- warning: immutable value 'opIndex' was never used; consider replacing with '_' or removing it [#no-usage]
335 | let memoryCost = op.resultType.byteCount
336 | let computeCost = estimateComputeCost(op)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:470:13: warning: initialization of immutable value 'averageSegmentSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
468 | // With checkpointing, only need to store activations between checkpoints
469 | let numSegments = checkpoints.count + 1
470 | let averageSegmentSize = function.operations.count / numSegments
| `- warning: initialization of immutable value 'averageSegmentSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
471 |
472 | // Estimate memory per segment
[419/437] Compiling MetalHLOCore SiblingFusion.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:193:13: warning: initialization of immutable value 'originalMemory' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
191 |
192 | // Compute original memory usage
193 | let originalMemory = computePeakMemory(function, decisions: [:])
| `- warning: initialization of immutable value 'originalMemory' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
194 |
195 | // Decide which tensors to rematerialize
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:334:14: warning: immutable value 'opIndex' was never used; consider replacing with '_' or removing it [#no-usage]
332 | var costs: [String: RecomputationCost] = [:]
333 |
334 | for (opIndex, op) in function.operations.enumerated() {
| `- warning: immutable value 'opIndex' was never used; consider replacing with '_' or removing it [#no-usage]
335 | let memoryCost = op.resultType.byteCount
336 | let computeCost = estimateComputeCost(op)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:470:13: warning: initialization of immutable value 'averageSegmentSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
468 | // With checkpointing, only need to store activations between checkpoints
469 | let numSegments = checkpoints.count + 1
470 | let averageSegmentSize = function.operations.count / numSegments
| `- warning: initialization of immutable value 'averageSegmentSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
471 |
472 | // Estimate memory per segment
[420/437] Compiling MetalHLOCore WhileLoopUnroller.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:193:13: warning: initialization of immutable value 'originalMemory' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
191 |
192 | // Compute original memory usage
193 | let originalMemory = computePeakMemory(function, decisions: [:])
| `- warning: initialization of immutable value 'originalMemory' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
194 |
195 | // Decide which tensors to rematerialize
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:334:14: warning: immutable value 'opIndex' was never used; consider replacing with '_' or removing it [#no-usage]
332 | var costs: [String: RecomputationCost] = [:]
333 |
334 | for (opIndex, op) in function.operations.enumerated() {
| `- warning: immutable value 'opIndex' was never used; consider replacing with '_' or removing it [#no-usage]
335 | let memoryCost = op.resultType.byteCount
336 | let computeCost = estimateComputeCost(op)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:470:13: warning: initialization of immutable value 'averageSegmentSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
468 | // With checkpointing, only need to store activations between checkpoints
469 | let numSegments = checkpoints.count + 1
470 | let averageSegmentSize = function.operations.count / numSegments
| `- warning: initialization of immutable value 'averageSegmentSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
471 |
472 | // Estimate memory per segment
[421/437] Compiling MetalHLOCore Lexer.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:193:13: warning: initialization of immutable value 'originalMemory' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
191 |
192 | // Compute original memory usage
193 | let originalMemory = computePeakMemory(function, decisions: [:])
| `- warning: initialization of immutable value 'originalMemory' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
194 |
195 | // Decide which tensors to rematerialize
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:334:14: warning: immutable value 'opIndex' was never used; consider replacing with '_' or removing it [#no-usage]
332 | var costs: [String: RecomputationCost] = [:]
333 |
334 | for (opIndex, op) in function.operations.enumerated() {
| `- warning: immutable value 'opIndex' was never used; consider replacing with '_' or removing it [#no-usage]
335 | let memoryCost = op.resultType.byteCount
336 | let computeCost = estimateComputeCost(op)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:470:13: warning: initialization of immutable value 'averageSegmentSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
468 | // With checkpointing, only need to store activations between checkpoints
469 | let numSegments = checkpoints.count + 1
470 | let averageSegmentSize = function.operations.count / numSegments
| `- warning: initialization of immutable value 'averageSegmentSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
471 |
472 | // Estimate memory per segment
[422/437] Compiling MetalHLOCore ParseError.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:193:13: warning: initialization of immutable value 'originalMemory' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
191 |
192 | // Compute original memory usage
193 | let originalMemory = computePeakMemory(function, decisions: [:])
| `- warning: initialization of immutable value 'originalMemory' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
194 |
195 | // Decide which tensors to rematerialize
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:334:14: warning: immutable value 'opIndex' was never used; consider replacing with '_' or removing it [#no-usage]
332 | var costs: [String: RecomputationCost] = [:]
333 |
334 | for (opIndex, op) in function.operations.enumerated() {
| `- warning: immutable value 'opIndex' was never used; consider replacing with '_' or removing it [#no-usage]
335 | let memoryCost = op.resultType.byteCount
336 | let computeCost = estimateComputeCost(op)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:470:13: warning: initialization of immutable value 'averageSegmentSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
468 | // With checkpointing, only need to store activations between checkpoints
469 | let numSegments = checkpoints.count + 1
470 | let averageSegmentSize = function.operations.count / numSegments
| `- warning: initialization of immutable value 'averageSegmentSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
471 |
472 | // Estimate memory per segment
[423/437] Compiling MetalHLOCore Parser.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:193:13: warning: initialization of immutable value 'originalMemory' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
191 |
192 | // Compute original memory usage
193 | let originalMemory = computePeakMemory(function, decisions: [:])
| `- warning: initialization of immutable value 'originalMemory' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
194 |
195 | // Decide which tensors to rematerialize
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:334:14: warning: immutable value 'opIndex' was never used; consider replacing with '_' or removing it [#no-usage]
332 | var costs: [String: RecomputationCost] = [:]
333 |
334 | for (opIndex, op) in function.operations.enumerated() {
| `- warning: immutable value 'opIndex' was never used; consider replacing with '_' or removing it [#no-usage]
335 | let memoryCost = op.resultType.byteCount
336 | let computeCost = estimateComputeCost(op)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:470:13: warning: initialization of immutable value 'averageSegmentSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
468 | // With checkpointing, only need to store activations between checkpoints
469 | let numSegments = checkpoints.count + 1
470 | let averageSegmentSize = function.operations.count / numSegments
| `- warning: initialization of immutable value 'averageSegmentSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
471 |
472 | // Estimate memory per segment
[424/437] Compiling MetalHLOCore Token.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:193:13: warning: initialization of immutable value 'originalMemory' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
191 |
192 | // Compute original memory usage
193 | let originalMemory = computePeakMemory(function, decisions: [:])
| `- warning: initialization of immutable value 'originalMemory' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
194 |
195 | // Decide which tensors to rematerialize
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:334:14: warning: immutable value 'opIndex' was never used; consider replacing with '_' or removing it [#no-usage]
332 | var costs: [String: RecomputationCost] = [:]
333 |
334 | for (opIndex, op) in function.operations.enumerated() {
| `- warning: immutable value 'opIndex' was never used; consider replacing with '_' or removing it [#no-usage]
335 | let memoryCost = op.resultType.byteCount
336 | let computeCost = estimateComputeCost(op)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOCore/Optimizer/Rematerialization.swift:470:13: warning: initialization of immutable value 'averageSegmentSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
468 | // With checkpointing, only need to store activations between checkpoints
469 | let numSegments = checkpoints.count + 1
470 | let averageSegmentSize = function.operations.count / numSegments
| `- warning: initialization of immutable value 'averageSegmentSize' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
471 |
472 | // Estimate memory per segment
[425/446] Compiling MetalHLO MetalHLO.swift
[426/446] Compiling MetalHLO TensorType.swift
[427/446] Compiling MetalHLO ElementType.swift
[428/446] Compiling MetalHLO Errors.swift
[429/446] Compiling MetalHLO CompilationConfig.swift
[430/446] Compiling MetalHLO Client.swift
[431/446] Compiling MetalHLO Buffer.swift
[432/446] Emitting module MetalHLO
[433/446] Compiling MetalHLO Executable.swift
[434/468] Compiling MetalHLOBenchmarks PowerEfficiencyBenchmarks.swift
[435/469] Compiling PJRTMetalHLO PJRTMemory.swift
[436/470] Compiling PJRTMetalHLO PJRTBuffer.swift
[437/470] Compiling PJRTMetalHLO OpaquePointerHelpers.swift
[438/470] Compiling PJRTMetalHLO PJRTApi.swift
[439/470] Compiling PJRTMetalHLO PJRTTopology.swift
[440/470] Compiling MetalHLOBenchmarks TestDataGenerator.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/TestDataGenerator.swift:144:16: warning: no calls to throwing functions occur within 'try' expression
142 |
143 | let data = uniformFloat32(count: count)
144 | return try client.createBuffer(data, shape: shape)
| `- warning: no calls to throwing functions occur within 'try' expression
145 | }
146 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/TestDataGenerator.swift:170:16: warning: no calls to throwing functions occur within 'try' expression
168 |
169 | let data = uniformFloat32(count: count, min: min, max: max)
170 | return try client.createBuffer(data, shape: shape)
| `- warning: no calls to throwing functions occur within 'try' expression
171 | }
172 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/TestDataGenerator.swift:182:16: warning: no calls to throwing functions occur within 'try' expression
180 | let count = shape.reduce(1, *)
181 | let data = normalFloat32(count: count, mean: mean, stdDev: stdDev)
182 | return try client.createBuffer(data, shape: shape)
| `- warning: no calls to throwing functions occur within 'try' expression
183 | }
184 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/TestDataGenerator.swift:205:20: warning: no calls to throwing functions occur within 'try' expression
203 | switch elementType {
204 | case .float32:
205 | return try client.createBuffer(zerosFloat32(count: count), shape: shape)
| `- warning: no calls to throwing functions occur within 'try' expression
206 | case .float16:
207 | let data = [Float16](repeating: 0, count: count)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/TestDataGenerator.swift:214:20: warning: no calls to throwing functions occur within 'try' expression
212 | default:
213 | // Fallback to float32
214 | return try client.createBuffer(zerosFloat32(count: count), shape: shape)
| `- warning: no calls to throwing functions occur within 'try' expression
215 | }
216 | }
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/TestDataGenerator.swift:227:16: warning: no calls to throwing functions occur within 'try' expression
225 | data[i * size + i] = 1.0
226 | }
227 | return try client.createBuffer(data, shape: [size, size])
| `- warning: no calls to throwing functions occur within 'try' expression
228 | }
229 | }
[441/470] Compiling MetalHLOBenchmarks ModelBenchmarks.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/ModelBenchmarks.swift:479:33: warning: no calls to throwing functions occur within 'try' expression
477 | let input = try gen.createUniformFloat32Buffer(client: client, shape: [1, 56, 56, 64])
478 | let conv1_w = try gen.createNormalFloat32Buffer(client: client, shape: [3, 3, 64, 64], mean: 0, stdDev: 0.05)
479 | let bn1_scale = try client.createBuffer([Float](repeating: 1.0, count: 64), shape: [64])
| `- warning: no calls to throwing functions occur within 'try' expression
480 | let bn1_offset = try gen.createZerosBuffer(client: client, shape: [64], elementType: .float32)
481 | let bn1_mean = try gen.createZerosBuffer(client: client, shape: [64], elementType: .float32)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/ModelBenchmarks.swift:482:31: warning: no calls to throwing functions occur within 'try' expression
480 | let bn1_offset = try gen.createZerosBuffer(client: client, shape: [64], elementType: .float32)
481 | let bn1_mean = try gen.createZerosBuffer(client: client, shape: [64], elementType: .float32)
482 | let bn1_var = try client.createBuffer([Float](repeating: 1.0, count: 64), shape: [64])
| `- warning: no calls to throwing functions occur within 'try' expression
483 | let conv2_w = try gen.createNormalFloat32Buffer(client: client, shape: [3, 3, 64, 64], mean: 0, stdDev: 0.05)
484 | let bn2_scale = try client.createBuffer([Float](repeating: 1.0, count: 64), shape: [64])
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/ModelBenchmarks.swift:484:33: warning: no calls to throwing functions occur within 'try' expression
482 | let bn1_var = try client.createBuffer([Float](repeating: 1.0, count: 64), shape: [64])
483 | let conv2_w = try gen.createNormalFloat32Buffer(client: client, shape: [3, 3, 64, 64], mean: 0, stdDev: 0.05)
484 | let bn2_scale = try client.createBuffer([Float](repeating: 1.0, count: 64), shape: [64])
| `- warning: no calls to throwing functions occur within 'try' expression
485 | let bn2_offset = try gen.createZerosBuffer(client: client, shape: [64], elementType: .float32)
486 | let bn2_mean = try gen.createZerosBuffer(client: client, shape: [64], elementType: .float32)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/ModelBenchmarks.swift:487:31: warning: no calls to throwing functions occur within 'try' expression
485 | let bn2_offset = try gen.createZerosBuffer(client: client, shape: [64], elementType: .float32)
486 | let bn2_mean = try gen.createZerosBuffer(client: client, shape: [64], elementType: .float32)
487 | let bn2_var = try client.createBuffer([Float](repeating: 1.0, count: 64), shape: [64])
| `- warning: no calls to throwing functions occur within 'try' expression
488 | return [input, conv1_w, bn1_scale, bn1_offset, bn1_mean, bn1_var, conv2_w, bn2_scale, bn2_offset, bn2_mean, bn2_var]
489 | }
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/ModelBenchmarks.swift:530:33: warning: no calls to throwing functions occur within 'try' expression
528 | let input = try gen.createUniformFloat32Buffer(client: client, shape: [8, 56, 56, 64])
529 | let conv1_w = try gen.createNormalFloat32Buffer(client: client, shape: [3, 3, 64, 64], mean: 0, stdDev: 0.05)
530 | let bn1_scale = try client.createBuffer([Float](repeating: 1.0, count: 64), shape: [64])
| `- warning: no calls to throwing functions occur within 'try' expression
531 | let bn1_offset = try gen.createZerosBuffer(client: client, shape: [64], elementType: .float32)
532 | let bn1_mean = try gen.createZerosBuffer(client: client, shape: [64], elementType: .float32)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/ModelBenchmarks.swift:533:31: warning: no calls to throwing functions occur within 'try' expression
531 | let bn1_offset = try gen.createZerosBuffer(client: client, shape: [64], elementType: .float32)
532 | let bn1_mean = try gen.createZerosBuffer(client: client, shape: [64], elementType: .float32)
533 | let bn1_var = try client.createBuffer([Float](repeating: 1.0, count: 64), shape: [64])
| `- warning: no calls to throwing functions occur within 'try' expression
534 | let conv2_w = try gen.createNormalFloat32Buffer(client: client, shape: [3, 3, 64, 64], mean: 0, stdDev: 0.05)
535 | let bn2_scale = try client.createBuffer([Float](repeating: 1.0, count: 64), shape: [64])
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/ModelBenchmarks.swift:535:33: warning: no calls to throwing functions occur within 'try' expression
533 | let bn1_var = try client.createBuffer([Float](repeating: 1.0, count: 64), shape: [64])
534 | let conv2_w = try gen.createNormalFloat32Buffer(client: client, shape: [3, 3, 64, 64], mean: 0, stdDev: 0.05)
535 | let bn2_scale = try client.createBuffer([Float](repeating: 1.0, count: 64), shape: [64])
| `- warning: no calls to throwing functions occur within 'try' expression
536 | let bn2_offset = try gen.createZerosBuffer(client: client, shape: [64], elementType: .float32)
537 | let bn2_mean = try gen.createZerosBuffer(client: client, shape: [64], elementType: .float32)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/ModelBenchmarks.swift:538:31: warning: no calls to throwing functions occur within 'try' expression
536 | let bn2_offset = try gen.createZerosBuffer(client: client, shape: [64], elementType: .float32)
537 | let bn2_mean = try gen.createZerosBuffer(client: client, shape: [64], elementType: .float32)
538 | let bn2_var = try client.createBuffer([Float](repeating: 1.0, count: 64), shape: [64])
| `- warning: no calls to throwing functions occur within 'try' expression
539 | return [input, conv1_w, bn1_scale, bn1_offset, bn1_mean, bn1_var, conv2_w, bn2_scale, bn2_offset, bn2_mean, bn2_var]
540 | }
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/ModelBenchmarks.swift:1020:29: warning: no calls to throwing functions occur within 'try' expression
1018 | let gen = TestDataGenerator(seed: 42)
1019 | let x = try gen.createUniformFloat32Buffer(client: client, shape: [1, 128, 768])
1020 | let ln1_g = try client.createBuffer([Float](repeating: 1.0, count: 768), shape: [768])
| `- warning: no calls to throwing functions occur within 'try' expression
1021 | let ln1_b = try gen.createZerosBuffer(client: client, shape: [768], elementType: .float32)
1022 | let wq = try gen.createNormalFloat32Buffer(client: client, shape: [768, 768], mean: 0, stdDev: 0.02)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/ModelBenchmarks.swift:1026:29: warning: no calls to throwing functions occur within 'try' expression
1024 | let wv = try gen.createNormalFloat32Buffer(client: client, shape: [768, 768], mean: 0, stdDev: 0.02)
1025 | let wo = try gen.createNormalFloat32Buffer(client: client, shape: [768, 768], mean: 0, stdDev: 0.02)
1026 | let ln2_g = try client.createBuffer([Float](repeating: 1.0, count: 768), shape: [768])
| `- warning: no calls to throwing functions occur within 'try' expression
1027 | let ln2_b = try gen.createZerosBuffer(client: client, shape: [768], elementType: .float32)
1028 | let ff_w1 = try gen.createNormalFloat32Buffer(client: client, shape: [768, 3072], mean: 0, stdDev: 0.02)
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/ModelBenchmarks.swift:1159:38: warning: no calls to throwing functions occur within 'try' expression
1157 | tokenIds.append(Int32(gen.uniformFloat32(count: 1)[0] * 29999))
1158 | }
1159 | let tokenIdsBuffer = try client.createBuffer(tokenIds, shape: [8, 128])
| `- warning: no calls to throwing functions occur within 'try' expression
1160 | return [embeddings, tokenIdsBuffer]
1161 | },
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/ModelBenchmarks.swift:1201:28: warning: no calls to throwing functions occur within 'try' expression
1199 | let images = try gen.createUniformFloat32Buffer(client: client, shape: [32, 224, 224, 3], min: 0, max: 255)
1200 | // ImageNet mean and std
1201 | let mean = try client.createBuffer([Float(123.675), Float(116.28), Float(103.53)], shape: [3])
| `- warning: no calls to throwing functions occur within 'try' expression
1202 | let std = try client.createBuffer([Float(58.395), Float(57.12), Float(57.375)], shape: [3])
1203 | return [images, mean, std]
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/ModelBenchmarks.swift:1202:27: warning: no calls to throwing functions occur within 'try' expression
1200 | // ImageNet mean and std
1201 | let mean = try client.createBuffer([Float(123.675), Float(116.28), Float(103.53)], shape: [3])
1202 | let std = try client.createBuffer([Float(58.395), Float(57.12), Float(57.375)], shape: [3])
| `- warning: no calls to throwing functions occur within 'try' expression
1203 | return [images, mean, std]
1204 | }
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/ModelBenchmarks.swift:1261:36: warning: no calls to throwing functions occur within 'try' expression
1259 | labels.append(Int32(gen.uniformFloat32(count: 1)[0] * 999))
1260 | }
1261 | let labelsBuffer = try client.createBuffer(labels, shape: [32])
| `- warning: no calls to throwing functions occur within 'try' expression
1262 | return [logits, labelsBuffer]
1263 | }
[442/470] Compiling MetalHLOBenchmarks FusionAnalysisBenchmarks.swift
[443/470] Compiling MetalHLOBenchmarks MemoryBenchmarks.swift
[444/470] Compiling MetalHLOBenchmarks GPUMetrics.swift
[445/470] Compiling MetalHLOBenchmarks CompilerBenchmarks.swift
[446/470] Compiling MetalHLOBenchmarks BenchmarkRunner.swift
[447/470] Emitting module MetalHLOBenchmarks
[448/470] Compiling MetalHLOBenchmarks BenchmarkResult.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/BenchmarkResult.swift:262:24: warning: 'init(cString:)' is deprecated: Use String(decoding: array, as: UTF8.self) instead, after truncating the null termination. [#DeprecatedDeclaration]
260 | var buffer = [CChar](repeating: 0, count: size)
261 | sysctlbyname("machdep.cpu.brand_string", &buffer, &size, nil, 0)
262 | chipName = String(cString: buffer)
| `- warning: 'init(cString:)' is deprecated: Use String(decoding: array, as: UTF8.self) instead, after truncating the null termination. [#DeprecatedDeclaration]
263 | }
264 |
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/BenchmarkResult.swift:272:28: warning: 'init(cString:)' is deprecated: Use String(decoding: array, as: UTF8.self) instead, after truncating the null termination. [#DeprecatedDeclaration]
270 | var buffer = [CChar](repeating: 0, count: size)
271 | sysctlbyname("hw.model", &buffer, &size, nil, 0)
272 | chipName = String(cString: buffer)
| `- warning: 'init(cString:)' is deprecated: Use String(decoding: array, as: UTF8.self) instead, after truncating the null termination. [#DeprecatedDeclaration]
273 | }
274 | }
[#DeprecatedDeclaration]: <https://docs.swift.org/compiler/documentation/diagnostics/deprecated-declaration>
[449/470] Compiling MetalHLOBenchmarks OperationBenchmarks.swift
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/OperationBenchmarks.swift:493:25: warning: no calls to throwing functions occur within 'try' expression
491 | let gen = TestDataGenerator(seed: 42)
492 | let a = try gen.createUniformFloat32Buffer(client: client, shape: [1024, 1024])
493 | let b = try client.createBuffer([1.5], shape: [1])
| `- warning: no calls to throwing functions occur within 'try' expression
494 | return [a, b]
495 | }
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/OperationBenchmarks.swift:870:25: warning: no calls to throwing functions occur within 'try' expression
868 | """,
869 | inputGenerator: { client in
870 | return [try client.createBuffer([Int32(0)], shape: [1])]
| `- warning: no calls to throwing functions occur within 'try' expression
871 | }
872 | ))
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/OperationBenchmarks.swift:1082:30: warning: no calls to throwing functions occur within 'try' expression
1080 | let gen = TestDataGenerator(seed: 42)
1081 | let input = try gen.createUniformFloat32Buffer(client: client, shape: [1024, 1024])
1082 | let start0 = try client.createBuffer([Int32(128)], shape: [1])
| `- warning: no calls to throwing functions occur within 'try' expression
1083 | let start1 = try client.createBuffer([Int32(128)], shape: [1])
1084 | return [input, start0, start1]
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/OperationBenchmarks.swift:1083:30: warning: no calls to throwing functions occur within 'try' expression
1081 | let input = try gen.createUniformFloat32Buffer(client: client, shape: [1024, 1024])
1082 | let start0 = try client.createBuffer([Int32(128)], shape: [1])
1083 | let start1 = try client.createBuffer([Int32(128)], shape: [1])
| `- warning: no calls to throwing functions occur within 'try' expression
1084 | return [input, start0, start1]
1085 | }
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/OperationBenchmarks.swift:1107:30: warning: no calls to throwing functions occur within 'try' expression
1105 | let input = try gen.createUniformFloat32Buffer(client: client, shape: [1024, 1024])
1106 | let update = try gen.createUniformFloat32Buffer(client: client, shape: [256, 256])
1107 | let start0 = try client.createBuffer([Int32(128)], shape: [1])
| `- warning: no calls to throwing functions occur within 'try' expression
1108 | let start1 = try client.createBuffer([Int32(128)], shape: [1])
1109 | return [input, update, start0, start1]
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/OperationBenchmarks.swift:1108:30: warning: no calls to throwing functions occur within 'try' expression
1106 | let update = try gen.createUniformFloat32Buffer(client: client, shape: [256, 256])
1107 | let start0 = try client.createBuffer([Int32(128)], shape: [1])
1108 | let start1 = try client.createBuffer([Int32(128)], shape: [1])
| `- warning: no calls to throwing functions occur within 'try' expression
1109 | return [input, update, start0, start1]
1110 | }
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/OperationBenchmarks.swift:1141:37: warning: no calls to throwing functions occur within 'try' expression
1139 | indices.append(Int32(gen.uniformFloat32(count: 1)[0] * 9999))
1140 | }
1141 | let indicesBuffer = try client.createBuffer(indices, shape: [1024])
| `- warning: no calls to throwing functions occur within 'try' expression
1142 | return [table, indicesBuffer]
1143 | },
/Users/admin/builder/spi-builder-workspace/Sources/MetalHLOBenchmarks/OperationBenchmarks.swift:1188:37: warning: no calls to throwing functions occur within 'try' expression
1186 | indices.append(Int32(gen.uniformFloat32(count: 1)[0] * 9999))
1187 | }
1188 | let indicesBuffer = try client.createBuffer(indices, shape: [1024, 1])
| `- warning: no calls to throwing functions occur within 'try' expression
1189 | let updates = try gen.createUniformFloat32Buffer(client: client, shape: [1024, 256])
1190 | return [table, indicesBuffer, updates]
[450/470] Emitting module PJRTMetalHLO
[451/476] Compiling CMetalHLO CInterface.swift
[452/476] Emitting module CMetalHLO
[452/476] Write Objects.LinkFileList
[453/476] Linking libCMetalHLO.dylib
[455/476] Compiling PJRTMetalHLO PJRTEvent.swift
[456/476] Compiling PJRTMetalHLO PJRTError.swift
[457/476] Compiling PJRTMetalHLO PJRTDevice.swift
/Users/admin/builder/spi-builder-workspace/Sources/PJRTMetalHLO/PJRTDevice.swift:279:9: warning: initialization of immutable value 'totalBytes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
277 |
278 | // Report recommended max working set size as total memory
279 | let totalBytes = Int64(mtl.recommendedMaxWorkingSetSize)
| `- warning: initialization of immutable value 'totalBytes' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
280 | args.pointee.bytes_in_use = 0 // Not easily tracked per-device in Metal
281 | return nil
[458/476] Compiling PJRTMetalHLO PJRTClient.swift
[459/476] Compiling PJRTMetalHLO PJRTExecutable.swift
[459/476] Write Objects.LinkFileList
[461/476] Compiling BenchmarkRunner main.swift
[462/476] Emitting module BenchmarkRunner
[462/476] Write Objects.LinkFileList
[464/476] Compiling DepthAttentionBenchmark main.swift
/Users/admin/builder/spi-builder-workspace/Sources/DepthAttentionBenchmark/main.swift:341:17: warning: initialization of immutable value 'params' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
339 | for i in 0..<numCalls {
340 | let depth = i + 2
341 | let params = DepthAttentionParams(batchSize: batchSize, depthDim: depth, hiddenDim: hiddenDim, scale: scale)
| `- warning: initialization of immutable value 'params' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
342 | let numSG = DepthAttentionKernel.optimalSimdgroups(hiddenDim: hiddenDim)
343 | var gpuParams = GPUDepthAttentionParamsPublic(
/Users/admin/builder/spi-builder-workspace/Sources/DepthAttentionBenchmark/main.swift:410:9: warning: initialization of immutable value 'layersPerBlock' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
408 | let numLayers = 12
409 | let numBlocks = 8
410 | let layersPerBlock = numLayers / numBlocks
| `- warning: initialization of immutable value 'layersPerBlock' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
411 | let hiddenDim = 768
412 | let scale: Float = 1.0 / sqrt(Float(hiddenDim))
/Users/admin/builder/spi-builder-workspace/Sources/DepthAttentionBenchmark/main.swift:420:13: warning: initialization of immutable value 'matmulElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
418 | for batchSize in [1, 4, 8, 16, 32] {
419 | let totalQ = batchSize * hiddenDim
420 | let matmulElements = batchSize * hiddenDim * hiddenDim
| `- warning: initialization of immutable value 'matmulElements' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
421 |
422 | // Allocate weight matrix and hidden state buffers
/Users/admin/builder/spi-builder-workspace/Sources/DepthAttentionBenchmark/main.swift:425:13: warning: initialization of immutable value 'weightBuf' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
423 | var weightData = [Float](repeating: 0, count: hiddenDim * hiddenDim)
424 | for i in 0..<weightData.count { weightData[i] = Float.random(in: -0.01...0.01) }
425 | let weightBuf = device.makeBuffer(bytes: weightData, length: hiddenDim * hiddenDim * 4, options: .storageModeShared)!
| `- warning: initialization of immutable value 'weightBuf' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
426 |
427 | var hData = [Float](repeating: 0, count: totalQ)
/Users/admin/builder/spi-builder-workspace/Sources/DepthAttentionBenchmark/main.swift:429:13: warning: initialization of immutable value 'hBuf' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
427 | var hData = [Float](repeating: 0, count: totalQ)
428 | for i in 0..<totalQ { hData[i] = Float.random(in: -0.5...0.5) }
429 | let hBuf = device.makeBuffer(bytes: hData, length: totalQ * 4, options: .storageModeShared)!
| `- warning: initialization of immutable value 'hBuf' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
430 | let outBuf = device.makeBuffer(length: totalQ * 4, options: .storageModeShared)!
431 |
/Users/admin/builder/spi-builder-workspace/Sources/DepthAttentionBenchmark/main.swift:430:13: warning: initialization of immutable value 'outBuf' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
428 | for i in 0..<totalQ { hData[i] = Float.random(in: -0.5...0.5) }
429 | let hBuf = device.makeBuffer(bytes: hData, length: totalQ * 4, options: .storageModeShared)!
430 | let outBuf = device.makeBuffer(length: totalQ * 4, options: .storageModeShared)!
| `- warning: initialization of immutable value 'outBuf' was never used; consider replacing with assignment to '_' or removing it [#no-usage]
431 |
432 | // --- Standard path: 12 matmuls (simulate layer compute), no depth attention ---
[465/476] Emitting module DepthAttentionBenchmark
[465/476] Write Objects.LinkFileList
[467/476] Emitting module MLXBenchmarks
[468/476] Compiling MLXBenchmarks MLXBenchmarks.swift
[468/478] Linking libPJRTMetalHLO.dylib
[469/478] Linking benchmark-runner
[470/478] Applying benchmark-runner
[471/478] Linking DepthAttentionBenchmark
[472/478] Applying DepthAttentionBenchmark
[474/478] Emitting module MLXComparison
[475/478] Compiling MLXComparison main.swift
[475/478] Write Objects.LinkFileList
[476/478] Linking mlx-comparison
[477/478] Applying mlx-comparison
Build complete! (44.47s)
Build complete.
{
"dependencies" : [
{
"identity" : "mlx-swift",
"requirement" : {
"range" : [
{
"lower_bound" : "0.21.0",
"upper_bound" : "1.0.0"
}
]
},
"type" : "sourceControl",
"url" : "https://github.com/ml-explore/mlx-swift"
}
],
"manifest_display_name" : "MetalHLO",
"name" : "MetalHLO",
"path" : "/Users/admin/builder/spi-builder-workspace",
"platforms" : [
{
"name" : "macos",
"version" : "14.0"
}
],
"products" : [
{
"name" : "MetalHLO",
"targets" : [
"MetalHLO"
],
"type" : {
"library" : [
"automatic"
]
}
},
{
"name" : "CMetalHLO",
"targets" : [
"CMetalHLO"
],
"type" : {
"library" : [
"dynamic"
]
}
},
{
"name" : "PJRTMetalHLO",
"targets" : [
"PJRTMetalHLO"
],
"type" : {
"library" : [
"dynamic"
]
}
},
{
"name" : "ANERuntime",
"targets" : [
"ANERuntime"
],
"type" : {
"library" : [
"automatic"
]
}
},
{
"name" : "MetalHLOBenchmarks",
"targets" : [
"MetalHLOBenchmarks"
],
"type" : {
"library" : [
"automatic"
]
}
},
{
"name" : "MLXBenchmarks",
"targets" : [
"MLXBenchmarks"
],
"type" : {
"library" : [
"automatic"
]
}
},
{
"name" : "benchmark-runner",
"targets" : [
"BenchmarkRunner"
],
"type" : {
"executable" : null
}
},
{
"name" : "mlx-comparison",
"targets" : [
"MLXComparison"
],
"type" : {
"executable" : null
}
},
{
"name" : "HeterogeneousFusionBenchmark",
"targets" : [
"HeterogeneousFusionBenchmark"
],
"type" : {
"executable" : null
}
},
{
"name" : "GPT2EndToEnd",
"targets" : [
"GPT2EndToEnd"
],
"type" : {
"executable" : null
}
},
{
"name" : "DepthAttentionBenchmark",
"targets" : [
"DepthAttentionBenchmark"
],
"type" : {
"executable" : null
}
},
{
"name" : "CalibrateTest",
"targets" : [
"CalibrateTest"
],
"type" : {
"executable" : null
}
}
],
"swift_languages_versions" : [
"6"
],
"targets" : [
{
"c99name" : "PJRTMetalHLOTests",
"module_type" : "SwiftTarget",
"name" : "PJRTMetalHLOTests",
"path" : "Tests/PJRTMetalHLOTests",
"sources" : [
"PJRTPluginTests.swift"
],
"target_dependencies" : [
"PJRTMetalHLO",
"MetalHLO"
],
"type" : "test"
},
{
"c99name" : "PJRTMetalHLO",
"module_type" : "SwiftTarget",
"name" : "PJRTMetalHLO",
"path" : "Sources/PJRTMetalHLO",
"product_memberships" : [
"PJRTMetalHLO"
],
"sources" : [
"OpaquePointerHelpers.swift",
"PJRTApi.swift",
"PJRTBuffer.swift",
"PJRTClient.swift",
"PJRTDevice.swift",
"PJRTError.swift",
"PJRTEvent.swift",
"PJRTExecutable.swift",
"PJRTMemory.swift",
"PJRTTopology.swift"
],
"target_dependencies" : [
"MetalHLO",
"MetalHLOCore",
"CPJRTApi",
"ANERuntime"
],
"type" : "library"
},
{
"c99name" : "MetalHLOTests",
"module_type" : "SwiftTarget",
"name" : "MetalHLOTests",
"path" : "Tests/MetalHLOTests",
"sources" : [
"ActivationOpsTests.swift",
"CAPITests.swift",
"ClientTests.swift",
"Conformance/ConformanceAnalyzer.swift",
"Conformance/ConformanceTestCLI.swift",
"Conformance/ConformanceTestRunner.swift",
"Conformance/StableHLO/IndexingConformanceTests.swift",
"Conformance/StableHLO/IndexingOperationsDiagnostic.swift",
"Conformance/StableHLO/InterpretTestParser.swift",
"Conformance/StableHLO/InterpretTestRunner.swift",
"Conformance/StableHLO/OfficialConformanceTests.swift",
"Conformance/StableHLO/OfficialTestManager.swift",
"Conformance/StableHLO/OptimizationBugDiagnostic.swift",
"Conformance/StableHLO/OptimizationCorrectnessTests.swift",
"Conformance/StableHLOConformanceTests.swift",
"Conformance/StableHLOTestManager.swift",
"Conformance/StableHLOTestParser.swift",
"ConstantHandlingTests.swift",
"ControlFlowTests.swift",
"IndexingOpsTests.swift",
"IntegrationTests.swift",
"LinalgMPSTests.swift",
"NewOpsTests.swift",
"OperationTests.swift",
"ProducerConsumerFusionBugTest.swift",
"QuickWinsOpsTests.swift",
"RNGTypesTests.swift",
"TrainingOpsTests.swift"
],
"target_dependencies" : [
"MetalHLO",
"CMetalHLO"
],
"type" : "test"
},
{
"c99name" : "MetalHLOCoreTests",
"module_type" : "SwiftTarget",
"name" : "MetalHLOCoreTests",
"path" : "Tests/MetalHLOCoreTests",
"sources" : [
"ANE/MILEmitterTests.swift",
"ANE/MILWeightPackerTests.swift",
"AllReduceTest.swift",
"AnalyzerTests.swift",
"ArgReduceTest.swift",
"Atan2Test.swift",
"AttentionRoutingTest.swift",
"CanonicalizersTests.swift",
"CaseSwitchTest.swift",
"CodegenTests.swift",
"CrossEntropyTest.swift",
"CrossLayerFusionTests.swift",
"CumsumTest.swift",
"CustomCallTests.swift",
"DepthAttentionTests.swift",
"ElementwiseChainTypeTest.swift",
"GatherBatchingTests.swift",
"GatherMLIRFormatTest.swift",
"HLOOptimizerTests.swift",
"HeterogeneousIntegrationTests.swift",
"HostCallbackTest.swift",
"IntegratedExecutorTests.swift",
"KernelCacheTests.swift",
"KernelDispatchRegressionTests.swift",
"LLMOptimizationsTests.swift",
"LapackRoutingTest.swift",
"LexerTests.swift",
"MILFusionTests.swift",
"ManualComputationTest.swift",
"MemoryPlanningTests.swift",
"MetalKernelTests.swift",
"NeuralEngineTargetingTests.swift",
"OptimizationBarrierTest.swift",
"ParserTests.swift",
"PartitionerTests.swift",
"PassManagerTests.swift",
"PatternCodegenTests.swift",
"PermutationUtilsTests.swift",
"ProfileGuidedOptimizationTests.swift",
"QuantizationAwareTests.swift",
"ReducePrecisionTest.swift",
"ReduceTest.swift",
"RematerializationTests.swift",
"ReshapeViewLivenessTest.swift",
"ScatterTest.swift",
"SearchSortedTest.swift",
"SharedIOSurfaceTests.swift",
"SortTest.swift",
"SpecialFunctionsTest.swift",
"ThreefryRngTest.swift",
"TopKTest.swift",
"TuningTests.swift",
"ZeroAllocExecutionTests.swift"
],
"target_dependencies" : [
"MetalHLOCore",
"MetalHLO"
],
"type" : "test"
},
{
"c99name" : "MetalHLOCore",
"module_type" : "SwiftTarget",
"name" : "MetalHLOCore",
"path" : "Sources/MetalHLOCore",
"product_memberships" : [
"MetalHLO",
"CMetalHLO",
"PJRTMetalHLO",
"MetalHLOBenchmarks",
"MLXBenchmarks",
"benchmark-runner",
"mlx-comparison",
"DepthAttentionBenchmark"
],
"sources" : [
"ANE/CoreMLOpBuilder.swift",
"ANE/MILEmitter.swift",
"ANE/MILFusionRewriter.swift",
"ANE/MILOpTranslator.swift",
"ANE/MILTextBuilder.swift",
"ANE/MILTypeMapper.swift",
"ANE/MILWeightPacker.swift",
"Cache/KernelCache.swift",
"Codegen/KernelSpecializer.swift",
"Codegen/MetalEmitter.swift",
"Codegen/MetalIR.swift",
"Codegen/PatternCodegen.swift",
"Codegen/ReductionKernelGenerator.swift",
"Codegen/SpecializedAttention.swift",
"Codegen/SpecializedMatMul.swift",
"Codegen/TileCalculator.swift",
"Compiler/Analyzer.swift",
"Compiler/CodeGenerator.swift",
"Compiler/CustomCallHandlers.swift",
"Compiler/EmbeddedAttentionSplitter.swift",
"Compiler/IntegrationTypes.swift",
"Compiler/KernelTypes.swift",
"Compiler/MPSGraphCompiler.swift",
"Compiler/MetalHLOCompiler.swift",
"Compiler/NAXGemmBundle.swift",
"Compiler/OpEmitter.swift",
"Compiler/PassManager.swift",
"Compiler/ReductionSplitTransform.swift",
"Compiler/TF32Transform.swift",
"IR/Attributes.swift",
"IR/HLOFunction.swift",
"IR/HLOModule.swift",
"IR/HLOOpKind.swift",
"IR/HLOOperation.swift",
"IR/TensorType.swift",
"LLM/LLMOptimizations.swift",
"Memory/StaticMemoryPlanner.swift",
"Metal/Kernels/DepthAttentionKernel.swift",
"Metal/Kernels/FlashAttentionKernel.swift",
"Metal/Kernels/GELUKernel.swift",
"Metal/Kernels/KernelRegistry.swift",
"Metal/Kernels/LayerNormKernel.swift",
"Metal/Kernels/MetalKernel.swift",
"Metal/Kernels/SoftmaxKernel.swift",
"Metal/Kernels/UnaryKernels.swift",
"Optimizer/AlgebraicSimplifier.swift",
"Optimizer/BufferAssignment.swift",
"Optimizer/Canonicalizers.swift",
"Optimizer/CostModel.swift",
"Optimizer/CrossLayerFusion.swift",
"Optimizer/FunctionInliner.swift",
"Optimizer/FusionPatterns.swift",
"Optimizer/HLOOptimizer.swift",
"Optimizer/HLOPattern.swift",
"Optimizer/HorizontalFusion.swift",
"Optimizer/LayoutAssignment.swift",
"Optimizer/ProducerConsumerFusion.swift",
"Optimizer/ProfileGuidedOptimization.swift",
"Optimizer/QuantizationAware.swift",
"Optimizer/Rematerialization.swift",
"Optimizer/SiblingFusion.swift",
"Optimizer/WhileLoopUnroller.swift",
"Parser/Lexer.swift",
"Parser/ParseError.swift",
"Parser/Parser.swift",
"Parser/Token.swift",
"Runtime/BufferStorage.swift",
"Runtime/CompilationCache.swift",
"Runtime/IntegratedExecutor.swift",
"Runtime/LargeTensorPool.swift",
"Runtime/LargeTensorStorage.swift",
"Runtime/LayerAccumulationBuffer.swift",
"Runtime/MetalExecutor.swift",
"Runtime/NeuralEngineTargeting.swift",
"Runtime/SharedIOSurfaceBuffer.swift",
"Runtime/StridedTensorView.swift",
"Runtime/SubFunctionExtractor.swift",
"Runtime/TensorTransferManager.swift",
"Runtime/ZeroAllocExecutor.swift",
"Tuning/AutoTuner.swift",
"Tuning/TuningDatabase.swift",
"Utils/PermutationUtils.swift"
],
"target_dependencies" : [
"ANERuntime"
],
"type" : "library"
},
{
"c99name" : "MetalHLOBenchmarks",
"module_type" : "SwiftTarget",
"name" : "MetalHLOBenchmarks",
"path" : "Sources/MetalHLOBenchmarks",
"product_memberships" : [
"MetalHLOBenchmarks",
"MLXBenchmarks",
"benchmark-runner",
"mlx-comparison",
"DepthAttentionBenchmark"
],
"sources" : [
"BenchmarkResult.swift",
"BenchmarkRunner.swift",
"CompilerBenchmarks.swift",
"FusionAnalysisBenchmarks.swift",
"GPUMetrics.swift",
"MemoryBenchmarks.swift",
"ModelBenchmarks.swift",
"OperationBenchmarks.swift",
"PowerEfficiencyBenchmarks.swift",
"TestDataGenerator.swift"
],
"target_dependencies" : [
"MetalHLO"
],
"type" : "library"
},
{
"c99name" : "MetalHLO",
"module_type" : "SwiftTarget",
"name" : "MetalHLO",
"path" : "Sources/MetalHLO",
"product_memberships" : [
"MetalHLO",
"CMetalHLO",
"PJRTMetalHLO",
"MetalHLOBenchmarks",
"MLXBenchmarks",
"benchmark-runner",
"mlx-comparison",
"DepthAttentionBenchmark"
],
"sources" : [
"Buffer.swift",
"Client.swift",
"CompilationConfig.swift",
"ElementType.swift",
"Errors.swift",
"Executable.swift",
"MetalHLO.swift",
"TensorType.swift"
],
"target_dependencies" : [
"MetalHLOCore"
],
"type" : "library"
},
{
"c99name" : "MLXComparison",
"module_type" : "SwiftTarget",
"name" : "MLXComparison",
"path" : "Sources/MLXComparison",
"product_memberships" : [
"mlx-comparison"
],
"sources" : [
"main.swift"
],
"target_dependencies" : [
"MLXBenchmarks",
"MetalHLOBenchmarks"
],
"type" : "executable"
},
{
"c99name" : "MLXBenchmarks",
"module_type" : "SwiftTarget",
"name" : "MLXBenchmarks",
"path" : "Sources/MLXBenchmarks",
"product_dependencies" : [
"MLX",
"MLXRandom"
],
"product_memberships" : [
"MLXBenchmarks",
"mlx-comparison"
],
"sources" : [
"MLXBenchmarks.swift"
],
"target_dependencies" : [
"MetalHLOBenchmarks"
],
"type" : "library"
},
{
"c99name" : "HeterogeneousFusionBenchmark",
"module_type" : "SwiftTarget",
"name" : "HeterogeneousFusionBenchmark",
"path" : "Sources/HeterogeneousFusionBenchmark",
"product_memberships" : [
"HeterogeneousFusionBenchmark"
],
"sources" : [
"main.swift"
],
"target_dependencies" : [
"HeterogeneousFusion"
],
"type" : "executable"
},
{
"c99name" : "HeterogeneousFusion",
"module_type" : "SwiftTarget",
"name" : "HeterogeneousFusion",
"path" : "Sources/HeterogeneousFusion",
"product_memberships" : [
"HeterogeneousFusionBenchmark",
"GPT2EndToEnd",
"CalibrateTest"
],
"sources" : [
"AttentionExecutor.swift",
"BenchmarkHarness.swift",
"ColumnSplitHelper.swift",
"ComputeUnit.swift",
"ContentionModel.swift",
"ConvolutionCPU.swift",
"ConvolutionGPU.swift",
"ConvolutionMPS.swift",
"ElementwiseCPU.swift",
"ElementwiseGPU.swift",
"EligibilityAnnotationPass.swift",
"EmbeddingCPU.swift",
"EmbeddingGPU.swift",
"FusedExecutor.swift",
"FusedMatmul.swift",
"HardwareCalibration.swift",
"HardwareMonitor.swift",
"HardwareProfile.swift",
"HeteroGraph.swift",
"HeterogeneousError.swift",
"HeterogeneousPartitioningPass.swift",
"LayerNormCPU.swift",
"LayerNormGPU.swift",
"MatmulANE.swift",
"MatmulCPU.swift",
"MatmulGPU.swift",
"OpFusionPass.swift",
"OptimalSplitter.swift",
"PartitionDescriptor.swift",
"ProfileDatabase.swift",
"ProfitabilityGuard.swift",
"SequentialScheduler.swift",
"SoftmaxCPU.swift",
"SoftmaxGPU.swift",
"ThroughputCurve.swift"
],
"type" : "library"
},
{
"c99name" : "GPT2EndToEnd",
"module_type" : "SwiftTarget",
"name" : "GPT2EndToEnd",
"path" : "Sources/GPT2EndToEnd",
"product_memberships" : [
"GPT2EndToEnd"
],
"sources" : [
"main.swift"
],
"target_dependencies" : [
"HeterogeneousFusion"
],
"type" : "executable"
},
{
"c99name" : "DepthAttentionBenchmark",
"module_type" : "SwiftTarget",
"name" : "DepthAttentionBenchmark",
"path" : "Sources/DepthAttentionBenchmark",
"product_memberships" : [
"DepthAttentionBenchmark"
],
"sources" : [
"main.swift"
],
"target_dependencies" : [
"MetalHLOCore",
"MetalHLOBenchmarks"
],
"type" : "executable"
},
{
"c99name" : "CalibrateTest",
"module_type" : "SwiftTarget",
"name" : "CalibrateTest",
"path" : "Sources/CalibrateTest",
"product_memberships" : [
"CalibrateTest"
],
"sources" : [
"main.swift"
],
"target_dependencies" : [
"HeterogeneousFusion"
],
"type" : "executable"
},
{
"c99name" : "CPJRTApi",
"module_type" : "ClangTarget",
"name" : "CPJRTApi",
"path" : "Sources/CPJRTApi",
"product_memberships" : [
"PJRTMetalHLO"
],
"sources" : [
"shim.c"
],
"type" : "library"
},
{
"c99name" : "CMetalHLO",
"module_type" : "SwiftTarget",
"name" : "CMetalHLO",
"path" : "Sources/CMetalHLO",
"product_memberships" : [
"CMetalHLO"
],
"sources" : [
"CInterface.swift"
],
"target_dependencies" : [
"MetalHLO",
"ANERuntime"
],
"type" : "library"
},
{
"c99name" : "BenchmarkRunner",
"module_type" : "SwiftTarget",
"name" : "BenchmarkRunner",
"path" : "Sources/BenchmarkRunner",
"product_memberships" : [
"benchmark-runner"
],
"sources" : [
"main.swift"
],
"target_dependencies" : [
"MetalHLOBenchmarks"
],
"type" : "executable"
},
{
"c99name" : "ANERuntimeTests",
"module_type" : "SwiftTarget",
"name" : "ANERuntimeTests",
"path" : "Tests/ANERuntimeTests",
"sources" : [
"ANEAvailabilityTests.swift",
"ANEBufferTests.swift",
"ANECompileCounterTests.swift",
"ANEDeviceTests.swift",
"ANEMILIntegrationTests.swift",
"ANEWatchdogTests.swift",
"CoreMLBridgeTests.swift"
],
"target_dependencies" : [
"ANERuntime",
"MetalHLOCore"
],
"type" : "test"
},
{
"c99name" : "ANERuntime",
"module_type" : "SwiftTarget",
"name" : "ANERuntime",
"path" : "Sources/ANERuntime",
"product_memberships" : [
"MetalHLO",
"CMetalHLO",
"PJRTMetalHLO",
"ANERuntime",
"MetalHLOBenchmarks",
"MLXBenchmarks",
"benchmark-runner",
"mlx-comparison",
"DepthAttentionBenchmark"
],
"sources" : [
"ANEAvailability.swift",
"ANEBuffer.swift",
"ANEDevice.swift",
"ANEError.swift",
"ANEProgram.swift",
"ANEWatchdog.swift",
"CompileCounter.swift",
"CoreMLBridge.swift",
"CoreMLModelBuilder.swift",
"CoreMLOp.swift",
"CoreMLProgram.swift",
"MILWeightTemplate.swift",
"Protobuf/CoreMLProto.swift",
"Protobuf/ProtobufWriter.swift"
],
"type" : "library"
}
],
"tools_version" : "6.0"
}
Done.