Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
56c04e3
Add FFT support via AbstractFFTs interface
KaanKesginLW Dec 3, 2025
eba619c
Add real FFT support (rfft, irfft, brfft)
KaanKesginLW Dec 3, 2025
ea12750
Add ComplexF16/Float16 support and improve type documentation
KaanKesginLW Dec 3, 2025
af8635e
Add 1D FFT tests
KaanKesginLW Dec 3, 2025
00e6022
Add in-place FFT variants (fft!, ifft!, bfft!)
KaanKesginLW Dec 3, 2025
1d52619
Apply Runic formatting to FFT implementation
KaanKesginLW Dec 3, 2025
e5348f7
Add missing mul! import in FFT tests
KaanKesginLW Dec 3, 2025
1fc6fd1
Add fused fftshift support for FFT operations
KaanKesginLW Dec 3, 2025
7b6f1d6
Simplify fused fftshift API: extend AbstractFFTs.fft directly
KaanKesginLW Dec 3, 2025
6ca2a8d
Refactor FFT: move @objc wrappers to operations.jl
KaanKesginLW Dec 4, 2025
37f811a
Simplify FFT: remove fused fftshift feature
KaanKesginLW Dec 4, 2025
9dca771
Restructure FFT tests following CUDA.jl pattern
KaanKesginLW Dec 4, 2025
681ba2b
Apply Runic formatting to FFT tests
KaanKesginLW Dec 4, 2025
eab6b22
Address review feedback: remove .gitignore change, restore original f…
KaanKesginLW Dec 4, 2025
537b337
Remove hallucinated kwargs
christiangnrd Jan 15, 2026
7f3a1a1
Add more CUDA tests
christiangnrd Jan 15, 2026
bb402e4
Temp disable some new tests
christiangnrd Jan 30, 2026
9aa1dac
[NFC] Reorganize code
christiangnrd Jan 30, 2026
8de6db7
[NFC] Cleanup
christiangnrd Jan 30, 2026
6bd2d45
Rename to `MPSGraphFFTDescriptor`
christiangnrd Jan 30, 2026
23d9d3a
assert_applicable
christiangnrd Jan 31, 2026
98764ca
Add inplace stuff
christiangnrd Jan 31, 2026
b6e17ec
Merge MtfFFTPlan and MtlFFTInplacePlan
christiangnrd Jan 31, 2026
de5f6c2
Move some code around
christiangnrd Feb 1, 2026
c4ac247
Remove unecessary helper function
christiangnrd Feb 1, 2026
43ad756
Add output type parameter
christiangnrd Feb 1, 2026
18e287e
Big merge
christiangnrd Feb 2, 2026
d8a6b63
Fix show
christiangnrd Feb 2, 2026
bc19414
Metaprogram ALL the things
christiangnrd Feb 2, 2026
ea9d35f
Minor refactor
christiangnrd Feb 2, 2026
3fb0241
Bring implementation more in line with the AbstractFFTs interface
christiangnrd Feb 3, 2026
e2addbc
Add some missing CUDA stuff
christiangnrd Feb 3, 2026
c32ee3e
autoreleasepool tweaks
christiangnrd Feb 3, 2026
7c58133
More validation + fixup tests
christiangnrd Feb 3, 2026
bf39b14
Rename stuff for consistency with CUDA fft test
christiangnrd Feb 4, 2026
db8abf2
Integer FFTs
christiangnrd Feb 4, 2026
2338fe9
Remove unused MPSGraph operations
christiangnrd Feb 4, 2026
9ed8793
Cleanup
christiangnrd Feb 4, 2026
be7ae48
Comment cleanup
christiangnrd Feb 4, 2026
7a87dd3
Cache plans
christiangnrd Apr 11, 2026
7a6fa34
Copilot suggestion
christiangnrd Apr 11, 2026
4848aff
Fix potentially unsafe cache access
christiangnrd May 9, 2026
d63bf16
Address feedback
christiangnrd May 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ version = "1.9.3"
projects = ["test", "docs", "perf", "examples", "res/wrap"]

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
BFloat16s = "ab4f0b2a-ad5b-11e8-123f-65d77653426b"
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
Expand All @@ -25,6 +26,7 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Random123 = "74087812-796a-5b5d-8853-05524746bad3"
RandomNumbers = "e6cf234a-135c-5ec9-84dd-332b85af5143"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
ScopedValues = "7e506255-f358-4e82-b7e4-beb19740aa63"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Expand All @@ -37,6 +39,7 @@ SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
SpecialFunctionsExt = "SpecialFunctions"

[compat]
AbstractFFTs = "1"
Adapt = "4.5"
BFloat16s = "0.5, 0.6"
CEnum = "0.4, 0.5"
Expand All @@ -56,6 +59,7 @@ Printf = "1"
Random = "1"
Random123 = "1.7.1"
RandomNumbers = "1.6.0"
Reexport = "1.2.2"
SHA = "0.7, 1"
ScopedValues = "1.3.0"
SpecialFunctions = "2"
Expand Down
1 change: 1 addition & 0 deletions lib/mpsgraphs/MPSGraphs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@ include("operations.jl")
include("random.jl")

include("matmul.jl")
include("fft.jl")

end
40 changes: 40 additions & 0 deletions lib/mpsgraphs/fft.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

## FFT Descriptor Creation

"""
MPSGraphFFTDescriptor(; inverse=false, scalingMode=MPSGraphFFTScalingModeNone)

Create an MPSGraphFFTDescriptor with the specified parameters.
"""
function MPSGraphFFTDescriptor(; inverse::Bool = false, scalingMode::MPSGraphFFTScalingMode = MPSGraphFFTScalingModeNone)
obj = @objc [MPSGraphFFTDescriptor alloc]::id{MPSGraphFFTDescriptor}
desc = MPSGraphFFTDescriptor(obj)
desc.inverse = inverse
desc.scalingMode = scalingMode
return desc
end

## MPSGraph FFT operations
function fastFourierTransformWithTensor(graph::MPSGraph, tensor::MPSGraphTensor, axes::NSArray, descriptor::MPSGraphFFTDescriptor, name = "fft")
obj = @objc [graph::id{MPSGraph} fastFourierTransformWithTensor:tensor::id{MPSGraphTensor}
axes:axes::id{NSArray}
descriptor:descriptor::id{MPSGraphFFTDescriptor}
name:name::id{NSString}]::id{MPSGraphTensor}
MPSGraphTensor(obj)
end

function realToHermiteanFFTWithTensor(graph::MPSGraph, tensor::MPSGraphTensor, axes::NSArray, descriptor::MPSGraphFFTDescriptor, name = "rfft")
obj = @objc [graph::id{MPSGraph} realToHermiteanFFTWithTensor:tensor::id{MPSGraphTensor}
axes:axes::id{NSArray}
descriptor:descriptor::id{MPSGraphFFTDescriptor}
name:name::id{NSString}]::id{MPSGraphTensor}
MPSGraphTensor(obj)
end

function HermiteanToRealFFTWithTensor(graph::MPSGraph, tensor::MPSGraphTensor, axes::NSArray, descriptor::MPSGraphFFTDescriptor, name = "irfft")
obj = @objc [graph::id{MPSGraph} HermiteanToRealFFTWithTensor:tensor::id{MPSGraphTensor}
axes:axes::id{NSArray}
descriptor:descriptor::id{MPSGraphFFTDescriptor}
name:name::id{NSString}]::id{MPSGraphTensor}
MPSGraphTensor(obj)
end
3 changes: 3 additions & 0 deletions src/Metal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import ObjectiveC: is_macos
import KernelAbstractions
using ScopedValues

using Reexport: @reexport

include("version.jl")
include("storage_type.jl")

Expand Down Expand Up @@ -68,6 +70,7 @@ include("mapreduce.jl")
include("accumulate.jl")
include("indexing.jl")
include("random.jl")
include("fft.jl")

# KernelAbstractions
include("MetalKernels.jl")
Expand Down
Loading
Loading