Now I found the descriptions in coremltools document.
In newer hardware, e.g. iPhone 15 pro (A17 pro), there is increased int8-int8 compute available on NE
Impact on Latency and Compute Unit Considerations https://apple.github.io/coremltools/docs-guides/source/quantization-overview.html#impact-on-latency-and-compute-unit-considerations
Linear 8-Bit Quantization https://apple.github.io/coremltools/docs-guides/source/performance-impact.html#linear-8-bit-quantization
The key point for A17 Pro is to quantize both weights and activations by per-tensor quantization.
Post
Replies
Boosts
Views
Activity
I might solve it by myself.
let numerators: [Float] = ...
let denominators: [Float] = ... // actually these are integers in my case
let denominatorsEpsilon = vDSP.add(Float.leastNonzeroMagnitude * 10000000, denominators) // (Float.leastNonzeroMagnitude * 10000000 is minimal number to avoid NaN when dividing.
let divides = vDSP.divide(numerators, denominatorsEpsilon)
let alternativesOfNAN: [Float] = ...
let denominatorsClip = vDSP.clip(denominators, to: 0...1) // denominatorsClip are 0 or 1 since denominators are integers
let result = vDSP.subtract(multiplication: (divides, denominatorsClip), multiplication: (alternativesOfNAN, vDSP.add(-1, denominatorsClip)))
I don't like this code since it is not precise and includes many unnecessary operations, but it is much faster than code checking isNaN.
Sorry, I misunderstood.
What I need is masking nan values, not gathering non-nan values.
As you said, vDSP_vdiv returns nan(, not inf) when you divide by zero. And I cannot find any effective compare operations to mask nan.
Are there any good functions?
What I am really doing is,
let numerators: [Float] = ...
let denominators: [Float] = ...
let divides = vDSP.divide(numerators, denominators)
let alternativesOfNAN: [Float] = ...
for i in divides {
if divides[i].isNaN {
divides[i] = alternativesOfNAN[i]
}
}
The last loop is quite slow compared with other parts using vDSP.
Thank you!
vDSP_vcmprs is what I need!
I solved it by myself.
newDocument argument returns a document with some magic keyword.
If a document of the argument of editor argument has the magic keyword, editor shows a template selector view.
The template selector view updates the document and it trigger showing a real editor view.
Now I noticed that this issue was not posting.
Any notification banners, such as timer alert, are prevented during my broadcast upload extension is running.
Do I need special settings of the extension to allow banners?
I had flied this issue via Feedback Assistant on 2022/09/20.(FB11549664)
No response yet.
Rincewind san,
Thank you for your comment!
However, I confirmed that both windows' isKeyWindow are true and no didBecomeKeyNotification are triggered even when the app has two scenes.
I think that they are deprecated.
Wrapping the related code by autoreleasepool solved this issue.
I have never known existence of autoreleasepool in Swift.
No. What I want is to enable close button of the app window even if a modal is opened.
No.I don't have AirPods so I cannot do any experiment.I am waiting for information to buy it.