-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue - 42 WhisperKit support simulator fixed #52
Conversation
Sources/WhisperKit/Core/Models.swift
Outdated
@@ -129,7 +129,7 @@ public struct ModelComputeOptions { | |||
public var prefillCompute: MLComputeUnits | |||
|
|||
public init( | |||
melCompute: MLComputeUnits = .cpuAndGPU, | |||
melCompute: MLComputeUnits = .cpuOnly, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at least, we should use compiler macro and then use CPU only for simulator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep like @muukii mentioned, we'll want this to be default only for the simulator - see comment suggestion
Here's another example of how it should work https://github.com/huggingface/swift-transformers/pull/46/files
Sources/WhisperKit/Core/Models.swift
Outdated
melCompute: MLComputeUnits = .cpuOnly, | ||
audioEncoderCompute: MLComputeUnits = .cpuAndNeuralEngine, | ||
textDecoderCompute: MLComputeUnits = .cpuAndNeuralEngine, | ||
prefillCompute: MLComputeUnits = .cpuOnly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
melCompute: MLComputeUnits = .cpuOnly, | |
audioEncoderCompute: MLComputeUnits = .cpuAndNeuralEngine, | |
textDecoderCompute: MLComputeUnits = .cpuAndNeuralEngine, | |
prefillCompute: MLComputeUnits = .cpuOnly | |
#if targetEnvironment(simulator) | |
melCompute: MLComputeUnits = .cpuOnly, | |
audioEncoderCompute: MLComputeUnits = .cpuOnly, | |
textDecoderCompute: MLComputeUnits = .cpuOnly, | |
prefillCompute: MLComputeUnits = .cpuOnly | |
#else | |
melCompute: MLComputeUnits = .cpuAndGpu, | |
audioEncoderCompute: MLComputeUnits = .cpuAndNeuralEngine, | |
textDecoderCompute: MLComputeUnits = .cpuAndNeuralEngine, | |
prefillCompute: MLComputeUnits = .cpuOnly | |
#endif |
@bharat9806 based on this issue #65 I'd also like to push a fix to this branch and bundle them together, the tests are currently failing - will want to merge with main as well |
#42