Comments (6)
For now I think a decent solution would be to add Int128/UInt128 to check_eltype and then make adapt_storage specific to Float64 which would have the (intended) side-effect of BigFloat erroring for not being stored inline.
from metal.jl.
mtl[]
does not seem to adapt datatypes likemtl([])
does
This functionality is terrible and should be removed. mtl
is a function, mtl[...]
is a horrible pun. I forgot I had ported that over from CUDA.jl, where IIRC I've removed it since.
from metal.jl.
I'm the one that ported it in #194. I probably noticed it didn't behave like CUDA and took the opportunity to "fix" it. My apologies. What about the second thing? If it's intended I'll repurpose the pull request to remove mtl[...]
only.
from metal.jl.
Ah, I see. Unless you feel strongly, I would vote for removing it again (even though that would be a breaking change, so we should verify nobody is relying on it). It's IMO not a good API.
mtl(Float16[])
does not promote up to Float32 butmtl(ComplexF16[])
promotes up to ComplexF32
Yeah that seems wrong, neither should promote. I guess the same bug will exist in CUDA.jl as well, and I wonder if we shouldn't just restrict the scope of the promotion to only Float64->Float32 and the complex equivalents (so that it doesn't cover Float16 and whatever we add in the future): https://github.com/JuliaGPU/CUDA.jl/blob/7a9a0a2a6becc4fba27fc664d1051194037a41e6/src/array.jl#L737-L748
from metal.jl.
Ah, I see. Unless you feel strongly, I would vote for removing it again (even though that would be a breaking change, so we should verify nobody is relying on it). It's IMO not a good API.
Not at all. I've updated the PR to remove it.
I wonder if we shouldn't just restrict the scope of the promotion to only Float64->Float32 and the complex equivalents (so that it doesn't cover Float16 and whatever we add in the future)
Float16 promotion is explicitly covered here. Would explicitly preventing promotion on the supported types and then defaulting to promoting to Float64 for any other AbstractFloat be better? That way types like BigFloat also get converted to Float32.
from metal.jl.
That way types like BigFloat also get converted to Float32.
I know it behaves like that right now, but I'm not sure that's great. Generally, we're pretty strict wrt. (dis)allowing types in GPU kernels, so transparently supporting BigFloat when working with arrays (and losing a bunch of precision because of that conversion) seems questionable to me. The exception has been Float64->Float32 because of the massive performance difference on consumer hardware.
from metal.jl.
Related Issues (20)
- Audit exports/public symbols HOT 1
- Generalize `adapt` to allow specifying the storage mode but not the element type and/or number of dimensions HOT 3
- sqrt(::Complex) unsupported due to conversion exceptions HOT 3
- Compilation failure on 1.11 HOT 4
- Metal 3.1 and 3.2 HOT 4
- M1/M2: Large matrix multiplications can contains NaNs HOT 24
- `MTLBinaryArchive`
- `Metal.code_agx()` failing in MacOS 15 Beta 3 HOT 2
- Test for min / max broadcasting issue HOT 5
- Add a `metal_version` function
- Type piracy HOT 1
- Potentially unused code in gpuarrays.jl
- Control flow-related miscompilation: HOT 1
- Implement MPSMatrixSolve HOT 1
- `Shared` vs `SharedStorage` in examples/unified_memory HOT 2
- Unsuported call to an unknown function when calling `Distributions` HOT 3
- More sporadic 1.11 hangs HOT 4
- EnzymeRules for MTLArray Constructor
- Support for `LinearAlgebra.kron` HOT 2
- Can't use gemm! methods with Metal HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metal.jl.